mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-11-11 20:19:26 +01:00
If --continue is not enabled, set resume_len to zero.
This corrects the reporting of download progress (which previously started at a value greater than zero).
This commit is contained in:
parent
ef357c4bf2
commit
10e7194db1
@ -877,7 +877,6 @@ class FileDownloader(object):
|
|||||||
|
|
||||||
tmpfilename = self.temp_name(filename)
|
tmpfilename = self.temp_name(filename)
|
||||||
stream = None
|
stream = None
|
||||||
open_mode = 'wb'
|
|
||||||
|
|
||||||
# Do not include the Accept-Encoding header
|
# Do not include the Accept-Encoding header
|
||||||
headers = {'Youtubedl-no-compression': 'True'}
|
headers = {'Youtubedl-no-compression': 'True'}
|
||||||
@ -890,11 +889,14 @@ class FileDownloader(object):
|
|||||||
else:
|
else:
|
||||||
resume_len = 0
|
resume_len = 0
|
||||||
|
|
||||||
# Request parameters in case of being able to resume
|
open_mode = 'wb'
|
||||||
if self.params.get('continuedl', False) and resume_len != 0:
|
if resume_len != 0:
|
||||||
|
if self.params.get('continuedl', False):
|
||||||
self.report_resuming_byte(resume_len)
|
self.report_resuming_byte(resume_len)
|
||||||
request.add_header('Range','bytes=%d-' % resume_len)
|
request.add_header('Range','bytes=%d-' % resume_len)
|
||||||
open_mode = 'ab'
|
open_mode = 'ab'
|
||||||
|
else:
|
||||||
|
resume_len = 0
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
retries = self.params.get('retries', 0)
|
retries = self.params.get('retries', 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user