|
|
@ -27,7 +27,7 @@ class HttpFD(FileDownloader):
|
|
|
|
request = compat_urllib_request.Request(url, None, headers)
|
|
|
|
request = compat_urllib_request.Request(url, None, headers)
|
|
|
|
|
|
|
|
|
|
|
|
if self.params.get('test', False):
|
|
|
|
if self.params.get('test', False):
|
|
|
|
request.add_header('Range','bytes=0-10240')
|
|
|
|
request.add_header('Range', 'bytes=0-10240')
|
|
|
|
|
|
|
|
|
|
|
|
# Establish possible resume length
|
|
|
|
# Establish possible resume length
|
|
|
|
if os.path.isfile(encodeFilename(tmpfilename)):
|
|
|
|
if os.path.isfile(encodeFilename(tmpfilename)):
|
|
|
@ -39,7 +39,7 @@ class HttpFD(FileDownloader):
|
|
|
|
if resume_len != 0:
|
|
|
|
if resume_len != 0:
|
|
|
|
if self.params.get('continuedl', False):
|
|
|
|
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:
|
|
|
|
else:
|
|
|
|
resume_len = 0
|
|
|
|
resume_len = 0
|
|
|
|