提交 d28a2abe 编写于 作者: M Mort Yao

fix incorrect range response issue

上级 768ac4be
......@@ -161,7 +161,10 @@ def url_save(url, filepath, bar, refer = None, is_part = False):
headers['Referer'] = refer
response = request.urlopen(request.Request(url, headers = headers), None)
assert file_size == received + int(response.headers['content-length'])
if file_size != received + int(response.headers['content-length']):
received = 0
open_mode = 'wb'
with open(temp_filepath, open_mode) as output:
while True:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册