Skip to content

Commit 9ce1d98

Browse files
committed
修复upload失败时报错;增加命令行启动方式;增加cookie记录
1 parent e46c88e commit 9ce1d98

File tree

16 files changed

+420
-15
lines changed

16 files changed

+420
-15
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
huaban/
2+
cookie.bk

‎.idea/HuabanBatchUpload.iml‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/misc.xml‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/modules.xml‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/vcs.xml‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/workspace.xml‎

Lines changed: 326 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
+ 批量处理
1616
+ 模拟登陆
1717
+ 并发控制
18+
+ 特殊字符路径支持
19+
1820

19-
## 待实现
20-
+ GUI

‎lib/__init__.pyc‎

130 Bytes
Binary file not shown.

‎lib/auth.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from lib import *
77
import requests
88

9-
def getCookies(account,password):
9+
def getCookie(account,password):
1010
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'}
1111
url = "https://huaban.com/auth/"
1212
data = {
@@ -19,9 +19,19 @@ def getCookies(account,password):
1919
if u'{"error":["用户不存在"]}' in res.text:
2020
print('Login in failed, check account/password')
2121
exit()
22-
cookies = res.headers['Set-Cookie']
22+
if 'Set-Cookie' in res.headers:
23+
cookies = res.headers['Set-Cookie']
24+
elif 'set-cookie' in res.headers:
25+
cookies = res.headers['set-cookie']
26+
else:
27+
print('Cannot get cookies,try to run without cookies!')
28+
cookies = None
2329
return cookies
2430

31+
# TODO 完成cookie测试功能
32+
def test(cookie) :
33+
pass
34+
2535
if __name__ == '__main__':
2636
account = "18200164037"
2737
password = ""

‎lib/auth.pyc‎

1.27 KB
Binary file not shown.

0 commit comments

Comments
 (0)