]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[UDNEmbed] Fix generic UDN pages
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 19 Nov 2015 14:22:57 +0000 (22:22 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 19 Nov 2015 14:32:56 +0000 (22:32 +0800)
Closes #7547

youtube_dl/extractor/generic.py
youtube_dl/extractor/udn.py

index 51516a38a14646f29bdc160b60e0298ad1234739..b483eba653d7928dfdd1dc51efcd19aee570b176 100644 (file)
@@ -1739,7 +1739,7 @@ class GenericIE(InfoExtractor):
 
         # Look for UDN embeds
         mobj = re.search(
-            r'<iframe[^>]+src="(?P<url>%s)"' % UDNEmbedIE._VALID_URL, webpage)
+            r'<iframe[^>]+src="(?P<url>%s)"' % UDNEmbedIE._PROTOCOL_RELATIVE_VALID_URL, webpage)
         if mobj is not None:
             return self.url_result(
                 compat_urlparse.urljoin(url, mobj.group('url')), 'UDNEmbed')
index 2151f83382d6b3185722b54de2d0eab2a988c6ae..ee35b7227372c0ddc128dfc694577578f9fc6009 100644 (file)
@@ -12,7 +12,8 @@ from ..compat import compat_urlparse
 
 class UDNEmbedIE(InfoExtractor):
     IE_DESC = '聯合影音'
-    _VALID_URL = r'https?://video\.udn\.com/(?:embed|play)/news/(?P<id>\d+)'
+    _PROTOCOL_RELATIVE_VALID_URL = r'//video\.udn\.com/(?:embed|play)/news/(?P<id>\d+)'
+    _VALID_URL = r'https?:' + _PROTOCOL_RELATIVE_VALID_URL
     _TESTS = [{
         'url': 'http://video.udn.com/embed/news/300040',
         'md5': 'de06b4c90b042c128395a88f0384817e',