diff options
author | Rogério Brito <rbrito@ime.usp.br> | 2017-11-08 04:34:01 -0200 |
---|---|---|
committer | Rogério Brito <rbrito@ime.usp.br> | 2017-11-08 04:34:01 -0200 |
commit | 32ad8acade51269177cd01c5aa3c7169557eeac8 (patch) | |
tree | 7a5ba379cab32c1ef9f9452646b93b555aa84d62 /test/test_InfoExtractor.py | |
parent | 4eb7d8923b3bad26edab01df0fd2650b0563ea8b (diff) | |
download | youtube-dl-32ad8acade51269177cd01c5aa3c7169557eeac8.zip youtube-dl-32ad8acade51269177cd01c5aa3c7169557eeac8.tar.gz youtube-dl-32ad8acade51269177cd01c5aa3c7169557eeac8.tar.bz2 |
New upstream version 2017.11.06
Diffstat (limited to 'test/test_InfoExtractor.py')
-rw-r--r-- | test/test_InfoExtractor.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_InfoExtractor.py b/test/test_InfoExtractor.py index f18a823..686c63e 100644 --- a/test/test_InfoExtractor.py +++ b/test/test_InfoExtractor.py @@ -574,6 +574,32 @@ jwplayer("mediaplayer").setup({"abouttext":"Visit Indie DB","aboutlink":"http:\/ self.ie._sort_formats(formats) expect_value(self, formats, expected_formats, None) + def test_parse_f4m_formats(self): + _TEST_CASES = [ + ( + # https://github.com/rg3/youtube-dl/issues/14660 + 'custom_base_url', + 'http://api.new.livestream.com/accounts/6115179/events/6764928/videos/144884262.f4m', + [{ + 'manifest_url': 'http://api.new.livestream.com/accounts/6115179/events/6764928/videos/144884262.f4m', + 'ext': 'flv', + 'format_id': '2148', + 'protocol': 'f4m', + 'tbr': 2148, + 'width': 1280, + 'height': 720, + }] + ), + ] + + for f4m_file, f4m_url, expected_formats in _TEST_CASES: + with io.open('./test/testdata/f4m/%s.f4m' % f4m_file, + mode='r', encoding='utf-8') as f: + formats = self.ie._parse_f4m_formats( + compat_etree_fromstring(f.read().encode('utf-8')), + f4m_url, None) + self.ie._sort_formats(formats) + expect_value(self, formats, expected_formats, None) if __name__ == '__main__': unittest.main() |