mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-14 11:02:58 +08:00
[http] Don't try to compare a string and an integer when running the tests
This commit is contained in:
parent
0c13f378de
commit
8b7d375610
@ -105,14 +105,6 @@ class HttpFD(FileDownloader):
|
|||||||
|
|
||||||
data_len = data.info().get('Content-length', None)
|
data_len = data.info().get('Content-length', None)
|
||||||
|
|
||||||
# Range HTTP header may be ignored/unsupported by a webserver
|
|
||||||
# (e.g. extractor/scivee.py, extractor/bambuser.py).
|
|
||||||
# However, for a test we still would like to download just a piece of a file.
|
|
||||||
# To achieve this we limit data_len to _TEST_FILE_SIZE and manually control
|
|
||||||
# block size when downloading a file.
|
|
||||||
if is_test and data_len > self._TEST_FILE_SIZE:
|
|
||||||
data_len = self._TEST_FILE_SIZE
|
|
||||||
|
|
||||||
if data_len is not None:
|
if data_len is not None:
|
||||||
data_len = int(data_len) + resume_len
|
data_len = int(data_len) + resume_len
|
||||||
min_data_len = self.params.get("min_filesize", None)
|
min_data_len = self.params.get("min_filesize", None)
|
||||||
@ -124,6 +116,14 @@ class HttpFD(FileDownloader):
|
|||||||
self.to_screen(u'\r[download] File is larger than max-filesize (%s bytes > %s bytes). Aborting.' % (data_len, max_data_len))
|
self.to_screen(u'\r[download] File is larger than max-filesize (%s bytes > %s bytes). Aborting.' % (data_len, max_data_len))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# Range HTTP header may be ignored/unsupported by a webserver
|
||||||
|
# (e.g. extractor/scivee.py, extractor/bambuser.py).
|
||||||
|
# However, for a test we still would like to download just a piece of a file.
|
||||||
|
# To achieve this we limit data_len to _TEST_FILE_SIZE and manually control
|
||||||
|
# block size when downloading a file.
|
||||||
|
if is_test and data_len > self._TEST_FILE_SIZE:
|
||||||
|
data_len = self._TEST_FILE_SIZE
|
||||||
|
|
||||||
data_len_str = format_bytes(data_len)
|
data_len_str = format_bytes(data_len)
|
||||||
byte_counter = 0 + resume_len
|
byte_counter = 0 + resume_len
|
||||||
block_size = self.params.get('buffersize', 1024)
|
block_size = self.params.get('buffersize', 1024)
|
||||||
|
Loading…
Reference in New Issue
Block a user