projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Retry to disable YT ratelimit to unlock full bandwidth
[youtube-dl]
/
test
/
test_download.py
diff --git
a/test/test_download.py
b/test/test_download.py
index a8de1d0025357b72ce39eeebe54960a3f42c867a..3eca333f269748cabb1f09b62a11f70ace25b3ac 100644
(file)
--- a/
test/test_download.py
+++ b/
test/test_download.py
@@
-58,6
+58,7
@@
with io.open(PARAMETERS_FILE, encoding='utf-8') as pf:
class TestDownload(unittest.TestCase):
class TestDownload(unittest.TestCase):
+ maxDiff = None
def setUp(self):
self.parameters = parameters
self.defs = defs
def setUp(self):
self.parameters = parameters
self.defs = defs
@@
-66,7
+67,7
@@
class TestDownload(unittest.TestCase):
def generator(test_case):
def test_template(self):
def generator(test_case):
def test_template(self):
- ie =
getattr(youtube_dl.InfoExtractors, test_case['name'] + 'IE'
)
+ ie =
youtube_dl.InfoExtractors.get_info_extractor(test_case['name']
)
if not ie._WORKING:
print('Skipping: IE marked as not _WORKING')
return
if not ie._WORKING:
print('Skipping: IE marked as not _WORKING')
return
@@
-81,9
+82,8
@@
def generator(test_case):
params.update(test_case.get('params', {}))
fd = FileDownloader(params)
params.update(test_case.get('params', {}))
fd = FileDownloader(params)
- fd.add_info_extractor(ie())
- for ien in test_case.get('add_ie', []):
- fd.add_info_extractor(getattr(youtube_dl.InfoExtractors, ien + 'IE')())
+ for ie in youtube_dl.InfoExtractors.gen_extractors():
+ fd.add_info_extractor(ie)
finished_hook_called = set()
def _hook(status):
if status['status'] == 'finished':
finished_hook_called = set()
def _hook(status):
if status['status'] == 'finished':
@@
-103,7
+103,7
@@
def generator(test_case):
if retry == RETRIES: raise
# Check if the exception is not a network related one
if retry == RETRIES: raise
# Check if the exception is not a network related one
- if not err.exc_info[0] in (
ZeroDivisionError, compat_urllib_error.URLError, socket.timeout
):
+ if not err.exc_info[0] in (
compat_urllib_error.URLError, socket.timeout, UnavailableVideoError
):
raise
print('Retrying: {0} failed tries\n\n##########\n\n'.format(retry))
raise
print('Retrying: {0} failed tries\n\n##########\n\n'.format(retry))