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:
parent
85c99fbc70
commit
c6e9442782
@ -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>
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user