From 17bc795e0777344381b9323c31882d74af5610be Mon Sep 17 00:00:00 2001 From: Paul Hartmann Date: Tue, 25 Aug 2015 21:56:57 +0200 Subject: [PATCH 1/2] [MTV] add support for German site mtv.de --- youtube_dl/extractor/mtv.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index b48fac5e3..b188fc388 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -109,6 +109,7 @@ class MTVServicesInfoExtractor(InfoExtractor): def _get_video_info(self, itemdoc): uri = itemdoc.find('guid').text video_id = self._id_from_uri(uri) + video_id = re.sub(r'^music_video-', '', video_id) self.report_extraction(video_id) mediagen_url = itemdoc.find('%s/%s' % (_media_xml_tag('group'), _media_xml_tag('content'))).attrib['url'] # Remove the templates, like &device={device} @@ -149,6 +150,7 @@ class MTVServicesInfoExtractor(InfoExtractor): if title is None: raise ExtractorError('Could not find video title') title = title.strip() + title = re.sub(r'^MusicVideo_', '', title) # This a short id that's used in the webpage urls mtvn_id = None @@ -180,6 +182,25 @@ class MTVServicesInfoExtractor(InfoExtractor): return self.playlist_result( [self._get_video_info(item) for item in idoc.findall('.//item')]) + def _get_videos_info_de(self, url, video_path): + """Extract from German site mtv.de""" + webpage = self._download_webpage(url, video_path) + playlist_js = self._search_regex(r'