aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/mtv.py8
-rw-r--r--youtube_dl/extractor/vevo.py6
2 files changed, 13 insertions, 1 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py
index a801c8123..969db7113 100644
--- a/youtube_dl/extractor/mtv.py
+++ b/youtube_dl/extractor/mtv.py
@@ -27,6 +27,14 @@ class MTVIE(InfoExtractor):
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')
+
#song_name = self._html_search_regex(r'<meta name="mtv_vt" content="([^"]+)"/>',
# webpage, u'song name', fatal=False)
diff --git a/youtube_dl/extractor/vevo.py b/youtube_dl/extractor/vevo.py
index 7aa04ef68..aa88e1a92 100644
--- a/youtube_dl/extractor/vevo.py
+++ b/youtube_dl/extractor/vevo.py
@@ -8,7 +8,11 @@ from ..utils import (
)
class VevoIE(InfoExtractor):
- _VALID_URL = r'http://www.vevo.com/watch/.*?/.*?/(?P<id>.*)$'
+ """
+ Accecps urls from vevo.com or in the format 'vevo:{id}'
+ (currently used by MTVIE)
+ """
+ _VALID_URL = r'((http://www.vevo.com/watch/.*?/.*?/)|(vevo:))(?P<id>.*)$'
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)