mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
fix incorrect range response issue
This commit is contained in:
parent
768ac4be05
commit
d28a2abe07
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user