From 839d05db5d08379f57b1b620849da9178734c56c Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Wed, 26 Mar 2014 10:48:49 -0700 Subject: [PATCH] [mtv] join playlists into one video when requested --- youtube_dl/extractor/mtv.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index d75241d3f..ca42491c6 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -156,7 +156,22 @@ class MTVServicesInfoExtractor(InfoExtractor): mgid = self._search_regex( [r'data-mgid="(.*?)"', r'swfobject.embedSWF\(".*?(mgid:.*?)"'], webpage, u'mgid') - return self._get_videos_info(mgid) + videos_info = self._get_videos_info(mgid) + if self._downloader.params.get('joinparts'): + show_name = self._html_search_regex( + r'(.*?)', + webpage, 'show name') + video_name = self._og_search_title(webpage) + description = self._og_search_description(webpage) + thumbnail = self._og_search_thumbnail(webpage) + return { + 'id': title, + 'title': '{0} - {1}'.format(show_name, video_name), + 'description': description, + 'thumbnail': thumbnail, + 'formats': self._entry_formats_to_parts(videos_info), + } + return videos_info class MTVIE(MTVServicesInfoExtractor):