Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

老师好。importer.py输入太慢,可以改用文件插入 #7

Open
framelei opened this issue May 17, 2019 · 0 comments
Open

老师好。importer.py输入太慢,可以改用文件插入 #7

framelei opened this issue May 17, 2019 · 0 comments

Comments

@framelei
Copy link

from cookiespool.db import RedisClient

conn = RedisClient('accounts', 'weibo')

def set(username, password):
result = conn.set(username, password)
if result:
print('账号', username, '密码', password)
print('录入成功')
else:
#如果插入失败,说明username已存在。删除重新插入
conn.delete(username)
set(username,password)

def scan(sep='----'):
print('正在读取密码本')
with open('account_pwd.txt') as f:
accounts = f.readlines()
for account in accounts:
username, password = account.split(sep)
#去掉密码结尾的换行符
password = password.strip()
set(username, password)

if name == 'main':
scan()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant