From a15f994677c191338b151732bb2e267faeb26ff0 Mon Sep 17 00:00:00 2001 From: dirkf Date: Fri, 6 Aug 2021 17:28:59 +0100 Subject: [PATCH] Extraction tweaks for Comedy Central playlists Return a single item as a video result; retain the 6-char ID as display_id --- youtube_dl/extractor/mtv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index 5a5205c0e..965145b38 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -229,6 +229,8 @@ class MTVServicesInfoExtractor(InfoExtractor): if info: entries.append(info) + if len(entries) == 1: + return entries[0] return self.playlist_result( entries, playlist_title=title, playlist_description=description) @@ -299,6 +301,8 @@ class MTVServicesInfoExtractor(InfoExtractor): webpage = self._download_webpage(url, title) mgid = self._extract_mgid(webpage) videos_info = self._get_videos_info(mgid) + if videos_info and videos_info.get('_type') != 'playlist': + videos_info['display_id'] = title return videos_info