Skip to content

Commit bc7491f

Browse files
committed
Merge pull request egrcc#64 from Enaunimes/master
一些改善和修正
2 parents 0bd093b + d029066 commit bc7491f

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ docs/_build/
5252

5353
# PyBuilder
5454
target/
55+
56+
# Prevent accidental cookie leak
57+
cookie

auth.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Build-in / Std
55
import os, sys, time, platform, random
66
import re, json, cookielib
7+
from getpass import getpass
78

89
# requirements
910
import requests, termcolor
@@ -82,15 +83,7 @@ def download_captcha():
8283
elif platform.system() == "Darwin":
8384
Logging.info(u"Command: open %s &" % image_name )
8485
os.system("open %s &" % image_name )
85-
elif platform.system() == "SunOS":
86-
os.system("open %s &" % image_name )
87-
elif platform.system() == "FreeBSD":
88-
os.system("open %s &" % image_name )
89-
elif platform.system() == "Unix":
90-
os.system("open %s &" % image_name )
91-
elif platform.system() == "OpenBSD":
92-
os.system("open %s &" % image_name )
93-
elif platform.system() == "NetBSD":
86+
elif platform.system() in ("SunOS", "FreeBSD", "Unix", "OpenBSD", "NetBSD"):
9487
os.system("open %s &" % image_name )
9588
elif platform.system() == "Windows":
9689
os.system("%s" % image_name )
@@ -215,8 +208,7 @@ def login(account=None, password=None):
215208
if account == None:
216209
sys.stdout.write(u"请输入登录账号: ")
217210
account = raw_input()
218-
sys.stdout.write(u"请输入登录密码: ")
219-
password = raw_input()
211+
password = getpass("请输入登录密码: ")
220212

221213
form_data = build_form(account, password)
222214
"""

0 commit comments

Comments
 (0)