about summary refs log tree commit diff
path: root/youtube_dl/extractor/mtv.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-01-28 20:29:22 +0700
committerSergey M․ <dstftw@gmail.com>2017-01-28 20:29:22 +0700
commit008f247077027f10c947060d8f3bb886c9af6aa7 (patch)
tree2bdd336928bdfe9d16d233d862ea7bc0a250b6d3 /youtube_dl/extractor/mtv.py
parent661cc229d2e885dd303d26535477c8905805ddf1 (diff)
downloadyoutube-dl-008f247077027f10c947060d8f3bb886c9af6aa7.tar.gz
youtube-dl-008f247077027f10c947060d8f3bb886c9af6aa7.tar.xz
youtube-dl-008f247077027f10c947060d8f3bb886c9af6aa7.zip
[mtv81] Add extractor (closes #7619)
Diffstat (limited to 'youtube_dl/extractor/mtv.py')
-rw-r--r--youtube_dl/extractor/mtv.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py
index 855c3996f..8acea1461 100644
--- a/youtube_dl/extractor/mtv.py
+++ b/youtube_dl/extractor/mtv.py
@@ -327,6 +327,35 @@ class MTVIE(MTVServicesInfoExtractor):
     }]
 
 
+class MTV81IE(InfoExtractor):
+    IE_NAME = 'mtv81'
+    _VALID_URL = r'https?://(?:www\.)?mtv81\.com/videos/(?P<id>[^/?#.]+)'
+
+    _TEST = {
+        'url': 'http://www.mtv81.com/videos/artist-to-watch/the-godfather-of-japanese-hip-hop-segment-1/',
+        'md5': '1edbcdf1e7628e414a8c5dcebca3d32b',
+        'info_dict': {
+            'id': '5e14040d-18a4-47c4-a582-43ff602de88e',
+            'ext': 'mp4',
+            'title': 'Unlocking The Truth|July 18, 2016|1|101|Trailer',
+            'description': '"Unlocking the Truth" premieres August 17th at 11/10c.',
+            'timestamp': 1468846800,
+            'upload_date': '20160718',
+        },
+    }
+
+    def _extract_mgid(self, webpage):
+        return self._search_regex(
+            r'getTheVideo\((["\'])(?P<id>mgid:.+?)\1', webpage,
+            'mgid', group='id')
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+        mgid = self._extract_mgid(webpage)
+        return self.url_result('http://media.mtvnservices.com/embed/%s' % mgid)
+
+
 class MTVVideoIE(MTVServicesInfoExtractor):
     IE_NAME = 'mtv:video'
     _VALID_URL = r'''(?x)^https?://