This commit is contained in:
morrah 2020-10-24 01:14:16 +09:00 committed by GitHub
commit 56c93b653d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -1490,6 +1490,7 @@ from .youtube import (
YoutubeTruncatedURLIE,
YoutubeUserIE,
YoutubeWatchLaterIE,
YoutubeLikedMusicIE,
)
from .zapiks import ZapiksIE
from .zaq1 import Zaq1IE

View File

@ -434,7 +434,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
(?!.*?\blist=
(?:
%(playlist_id)s| # combined list/video URLs are handled by the playlist IE
WL # WL are handled by the watch later IE
WL| # WL are handled by the watch later IE
LM # LM are handled by the watch later IE
)
)
(?(1).+)? # if we found the ID, everything can follow
@ -3387,6 +3388,27 @@ class YoutubeWatchLaterIE(YoutubePlaylistIE):
return playlist
class YoutubeLikedMusicIE(YoutubePlaylistIE):
IE_NAME = 'youtube:likedmusic'
IE_DESC = 'Youtube liked music list, ":ytlikedmusic" for short (requires authentication)'
_VALID_URL = r'https?://(?:www\.)?youtube\.com/((?:playlist|watch)\?(?:.+&)?list=LM)|:ytlikedmusic'
_TESTS = [{
'url': 'https://www.youtube.com/playlist?list=LM',
'only_matching': True,
}, {
'url': 'https://www.youtube.com/watch?v=j2DgYtvDW3I&index=1&list=LM',
'only_matching': True,
}]
def _real_extract(self, url):
_, video = self._check_download_just_video(url, 'LM')
if video:
return video
_, playlist = self._extract_playlist('LM')
return playlist
class YoutubeFavouritesIE(YoutubeBaseInfoExtractor):
IE_NAME = 'youtube:favorites'
IE_DESC = 'YouTube.com favourite videos, ":ytfav" for short (requires authentication)'