We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd7a402 commit 76e5868Copy full SHA for 76e5868
1 file changed
fuck/pconline.py
@@ -54,13 +54,17 @@ def get_link(url, token):
54
55
def download(file_path):
56
"""
57
- 执行下载
+ 执行下载,支持断点续传
58
59
- response = s.get(file_path, headers=header)
+ import os
60
file_name = file_path.split('/')[-1]
61
+ save_file_path = '../static/download/'+file_name
62
print file_name
- with open('../static/download/'+file_name, 'wb') as f:
63
- f.write(response.content)
+ print save_file_path
64
+ # 伪装浏览器,组装下载命令
65
+ cmd = "wget --user-agent=\"%s\" -c -O %s %s" % (header['User-Agent'], save_file_path, file_path)
66
+ print cmd
67
+ os.system(cmd)
68
69
70
def fuck():
0 commit comments