[extractor/generic] Use _extract_url for mtvservices
authorSergey M․ <dstftw@gmail.com>
Sat, 26 Sep 2015 13:47:20 +0000 (19:47 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 26 Sep 2015 13:47:20 +0000 (19:47 +0600)
youtube_dl/extractor/generic.py

index 8881a8a237bfe809f5fe924afcc70109166f66af..22ec78a022fb9c71e3195d20d01ccdc9aba49050 100644 (file)
@@ -50,6 +50,7 @@ from .dailymotion import DailymotionCloudIE
 from .onionstudios import OnionStudiosIE
 from .snagfilms import SnagFilmsEmbedIE
 from .screenwavemedia import ScreenwaveMediaIE
+from .mtv import MTVServicesEmbeddedIE
 
 
 class GenericIE(InfoExtractor):
@@ -1611,12 +1612,9 @@ class GenericIE(InfoExtractor):
             return self.url_result(url, ie='Vulture')
 
         # Look for embedded mtvservices player
-        mobj = re.search(
-            r'<iframe src="(?P<url>https?://media\.mtvnservices\.com/embed/[^"]+)"',
-            webpage)
-        if mobj is not None:
-            url = unescapeHTML(mobj.group('url'))
-            return self.url_result(url, ie='MTVServicesEmbedded')
+        mtvservices_url = MTVServicesEmbeddedIE._extract_url(webpage)
+        if mtvservices_url:
+            return self.url_result(mtvservices_url, ie='MTVServicesEmbedded')
 
         # Look for embedded yahoo player
         mobj = re.search(