From ab36800b1fc7c17ab587bfe8015a0260db635efb Mon Sep 17 00:00:00 2001 From: nixxo Date: Wed, 4 Nov 2020 18:14:02 +0100 Subject: [PATCH 1/3] [la7] fix missing protocol --- youtube_dlc/extractor/la7.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dlc/extractor/la7.py b/youtube_dlc/extractor/la7.py index f5d4564fa..74b006fb5 100644 --- a/youtube_dlc/extractor/la7.py +++ b/youtube_dlc/extractor/la7.py @@ -36,6 +36,9 @@ class LA7IE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) + if not url.startswith('http'): + url = '%s//%s' % (self.http_scheme(), url) + webpage = self._download_webpage(url, video_id) player_data = self._search_regex( From 659ddd7f7055baa8742433c2b73f01b3a1e2505f Mon Sep 17 00:00:00 2001 From: insaneracist Date: Wed, 4 Nov 2020 10:06:53 -0800 Subject: [PATCH 2/3] [youtube] fix: Youtube Music playlists --- youtube_dlc/extractor/youtube.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index 2e70ad6fa..d6550a776 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -2965,9 +2965,12 @@ def _real_extract(self, url): if video: return video + youtube_music_playlist_prefix = 'RDCLAK5uy_' if playlist_id.startswith(('RD', 'UL', 'PU')): - # Mixes require a custom extraction process - return self._extract_mix(playlist_id) + if not playlist_id.startswith(youtube_music_playlist_prefix): + # Mixes require a custom extraction process, + # Youtube Music playlists act like normal playlists (with randomized order) + return self._extract_mix(playlist_id) has_videos, playlist = self._extract_playlist(playlist_id) if has_videos or not video_id: From 7f4f0b21c26b59a1d621e6407ea2f4ed6c1a98be Mon Sep 17 00:00:00 2001 From: insaneracist Date: Wed, 4 Nov 2020 12:00:51 -0800 Subject: [PATCH 3/3] [youtube] added Youtube Music channel info --- youtube_dlc/extractor/youtube.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index d6550a776..cd4e844a0 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -2631,6 +2631,12 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): _VIDEO_RE_TPL = r'href="\s*/watch\?v=%s(?:&(?:[^"]*?index=(?P\d+))?(?:[^>]+>(?P[^<]+))?)?' _VIDEO_RE = _VIDEO_RE_TPL % r'(?P<id>[0-9A-Za-z_-]{11})' IE_NAME = 'youtube:playlist' + _YTM_PLAYLIST_PREFIX = 'RDCLAK5uy_' + _YTM_CHANNEL_INFO = { + 'uploader': 'Youtube Music', + 'uploader_id': 'music', # or "UC-9-kyTW8ZkZNDHQJ6FgpwQ" + 'uploader_url': 'https://www.youtube.com/music' + } _TESTS = [{ 'url': 'https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc', 'info_dict': { @@ -2936,6 +2942,8 @@ def _extract_playlist(self, playlist_id): 'uploader_id': uploader_id, 'uploader_url': uploader_url, }) + if playlist_id.startswith(self._YTM_PLAYLIST_PREFIX): + playlist.update(self._YTM_CHANNEL_INFO) return has_videos, playlist @@ -2965,9 +2973,8 @@ def _real_extract(self, url): if video: return video - youtube_music_playlist_prefix = 'RDCLAK5uy_' if playlist_id.startswith(('RD', 'UL', 'PU')): - if not playlist_id.startswith(youtube_music_playlist_prefix): + if not playlist_id.startswith(self._YTM_PLAYLIST_PREFIX): # Mixes require a custom extraction process, # Youtube Music playlists act like normal playlists (with randomized order) return self._extract_mix(playlist_id)