1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-11 05:37:17 +08:00

[openload] added test for determine_ext and determining file extension was simplified

This commit is contained in:
Enes 2018-06-01 02:13:47 +03:00
parent 85c99fbc70
commit c6e9442782
2 changed files with 2 additions and 3 deletions

View File

@ -360,6 +360,7 @@ class TestUtil(unittest.TestCase):
self.assertEqual(determine_ext('http://example.com/foo/bar.nonext/?download', None), None)
self.assertEqual(determine_ext('http://example.com/foo/bar/mp4?download', None), None)
self.assertEqual(determine_ext('http://example.com/foo/bar.m3u8//?download'), 'm3u8')
self.assertEqual(determine_ext('foobar', None), None)
def test_find_xpath_attr(self):
testxml = '''<root>

View File

@ -361,9 +361,7 @@ class OpenloadIE(InfoExtractor):
# Some videos have special name and some of these
# have not got their extension on their title
# If url has their file name, it has always its extension
video_ext = determine_ext(title, None)
if video_ext is None:
video_ext = determine_ext(url, 'mp4')
video_ext = determine_ext(title, None) or determine_ext(url, 'mp4')
info_dict = {
'id': video_id,