[mtv] Look for sm4:video:embed (Closes #6936, closes #6970)
authorSergey M․ <dstftw@gmail.com>
Sat, 26 Sep 2015 13:45:43 +0000 (19:45 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 26 Sep 2015 13:45:43 +0000 (19:45 +0600)
youtube_dl/extractor/mtv.py

index a597714e97c2cc7313449d6b52a64978d4023d9d..4020cc2a9d0096f2ca39f67fe4c1489f7cabc711 100644 (file)
@@ -200,7 +200,13 @@ class MTVServicesInfoExtractor(InfoExtractor):
         if mgid is None or ':' not in mgid:
             mgid = self._search_regex(
                 [r'data-mgid="(.*?)"', r'swfobject.embedSWF\(".*?(mgid:.*?)"'],
-                webpage, 'mgid')
+                webpage, 'mgid', default=None)
+
+        if not mgid:
+            sm4_embed = self._html_search_meta(
+                'sm4:video:embed', webpage, 'sm4 embed', default='')
+            mgid = self._search_regex(
+                r'embed/(mgid:.+?)["\'&?/]', sm4_embed, 'mgid')
 
         videos_info = self._get_videos_info(mgid)
         return videos_info