[udn] Add new extractor
This commit is contained in:
parent
de5c545648
commit
418c5cc3fc
5 changed files with 103 additions and 0 deletions
|
@ -53,6 +53,7 @@ from youtube_dl.utils import (
|
|||
uppercase_escape,
|
||||
url_basename,
|
||||
urlencode_postdata,
|
||||
url_infer_protocol,
|
||||
version_tuple,
|
||||
xpath_with_ns,
|
||||
xpath_text,
|
||||
|
@ -296,6 +297,10 @@ class TestUtil(unittest.TestCase):
|
|||
url_basename('http://media.w3.org/2010/05/sintel/trailer.mp4'),
|
||||
'trailer.mp4')
|
||||
|
||||
def test_url_infer_protocol(self):
|
||||
self.assertEqual(url_infer_protocol('http://foo.com/', '//bar.com/'), 'http://bar.com/')
|
||||
self.assertEqual(url_infer_protocol('http://foo.com/', 'https://bar.com/'), 'https://bar.com/')
|
||||
|
||||
def test_parse_duration(self):
|
||||
self.assertEqual(parse_duration(None), None)
|
||||
self.assertEqual(parse_duration(False), None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue