aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-16 22:18:37 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-16 22:18:37 +0100
commit88bb52ee18275adf46f764e8fbc7e31b271cf254 (patch)
tree1922c9df5f0791616e18687a7fd255742185ecc2
parentd90df974c3164ea377f2ce2b04742e6ff21379e8 (diff)
parent5c541b2cb79113952efbdb72be72db568c8132a8 (diff)
Merge branch 'master' of github.com:rg3/youtube-dl
-rw-r--r--youtube_dl/extractor/mtv.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py
index 5b2bd9633..ed11f521a 100644
--- a/youtube_dl/extractor/mtv.py
+++ b/youtube_dl/extractor/mtv.py
@@ -93,7 +93,9 @@ class MTVServicesInfoExtractor(InfoExtractor):
class MTVIE(MTVServicesInfoExtractor):
- _VALID_URL = r'^https?://(?:www\.)?mtv\.com/videos/.+?/(?P<videoid>[0-9]+)/[^/]+$'
+ _VALID_URL = r'''(?x)^https?://
+ (?:(?:www\.)?mtv\.com/videos/.+?/(?P<videoid>[0-9]+)/[^/]+$|
+ m\.mtv\.com/videos/video\.rbml\?.*?id=(?P<mgid>[^&]+))'''
_FEED_URL = 'http://www.mtv.com/player/embed/AS3/rss/'
@@ -127,16 +129,17 @@ class MTVIE(MTVServicesInfoExtractor):
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('videoid')
-
- webpage = self._download_webpage(url, video_id)
-
- # Some videos come from Vevo.com
- m_vevo = re.search(r'isVevoVideo = true;.*?vevoVideoId = "(.*?)";',
- webpage, re.DOTALL)
- if m_vevo:
- vevo_id = m_vevo.group(1);
- self.to_screen(u'Vevo video detected: %s' % vevo_id)
- return self.url_result('vevo:%s' % vevo_id, ie='Vevo')
-
- uri = self._html_search_regex(r'/uri/(.*?)\?', webpage, u'uri')
+ uri = mobj.group('mgid')
+ if uri is None:
+ webpage = self._download_webpage(url, video_id)
+
+ # Some videos come from Vevo.com
+ m_vevo = re.search(r'isVevoVideo = true;.*?vevoVideoId = "(.*?)";',
+ webpage, re.DOTALL)
+ if m_vevo:
+ vevo_id = m_vevo.group(1);
+ self.to_screen(u'Vevo video detected: %s' % vevo_id)
+ return self.url_result('vevo:%s' % vevo_id, ie='Vevo')
+
+ uri = self._html_search_regex(r'/uri/(.*?)\?', webpage, u'uri')
return self._get_videos_info(uri)