aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_YoutubeDL.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-02-24 04:34:59 +0800
committerJesús <heckyel@hyperbola.info>2022-02-24 04:34:59 +0800
commit50d9ac9fa684f0190021be23756575f989a70dc7 (patch)
treee8ad809e09f76ff6ac65a51846c06d0d3f58b432 /test/test_YoutubeDL.py
parent21cc56c6e71361ccf17cebb6b131113501815ae6 (diff)
parent09b49e1f688831c3ad7181decf38c90f8451e6c4 (diff)
downloadhypervideo-pre-50d9ac9fa684f0190021be23756575f989a70dc7.tar.lz
hypervideo-pre-50d9ac9fa684f0190021be23756575f989a70dc7.tar.xz
hypervideo-pre-50d9ac9fa684f0190021be23756575f989a70dc7.zip
updated from upstream | 24/02/2022 at 04:34
Diffstat (limited to 'test/test_YoutubeDL.py')
-rw-r--r--test/test_YoutubeDL.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py
index 34ed814b4..7637297be 100644
--- a/test/test_YoutubeDL.py
+++ b/test/test_YoutubeDL.py
@@ -30,9 +30,7 @@ class YDL(FakeYDL):
self.msgs = []
def process_info(self, info_dict):
- info_dict = info_dict.copy()
- info_dict.pop('__original_infodict', None)
- self.downloaded_info_dicts.append(info_dict)
+ self.downloaded_info_dicts.append(info_dict.copy())
def to_screen(self, msg):
self.msgs.append(msg)
@@ -898,20 +896,6 @@ class TestYoutubeDL(unittest.TestCase):
os.unlink(filename)
def test_match_filter(self):
- class FilterYDL(YDL):
- def __init__(self, *args, **kwargs):
- super(FilterYDL, self).__init__(*args, **kwargs)
- self.params['simulate'] = True
-
- def process_info(self, info_dict):
- super(YDL, self).process_info(info_dict)
-
- def _match_entry(self, info_dict, incomplete=False):
- res = super(FilterYDL, self)._match_entry(info_dict, incomplete)
- if res is None:
- self.downloaded_info_dicts.append(info_dict.copy())
- return res
-
first = {
'id': '1',
'url': TEST_URL,
@@ -939,7 +923,7 @@ class TestYoutubeDL(unittest.TestCase):
videos = [first, second]
def get_videos(filter_=None):
- ydl = FilterYDL({'match_filter': filter_})
+ ydl = YDL({'match_filter': filter_, 'simulate': True})
for v in videos:
ydl.process_ie_result(v, download=True)
return [v['id'] for v in ydl.downloaded_info_dicts]