logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git
commit: c98052c5da1c984a2d1f0f426261e1147df5ae6e
parent ab62bc583896f0f8e56bbb7b8ac72e84f7102a87
Author: Sergey M․ <dstftw@gmail.com>
Date:   Mon, 14 Dec 2020 12:52:25 +0700

[yandexmusic:album] Simplify

Diffstat:

Myoutube_dl/extractor/yandexmusic.py6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/youtube_dl/extractor/yandexmusic.py b/youtube_dl/extractor/yandexmusic.py @@ -247,7 +247,7 @@ class YandexMusicPlaylistBaseIE(YandexMusicBaseIE): class YandexMusicAlbumIE(YandexMusicPlaylistBaseIE): IE_NAME = 'yandexmusic:album' IE_DESC = 'Яндекс.Музыка - Альбом' - _VALID_URL = r'%s/album/(?P<id>\d+)/?(\?|$)' % YandexMusicBaseIE._VALID_URL_BASE + _VALID_URL = r'%s/album/(?P<id>\d+)' % YandexMusicBaseIE._VALID_URL_BASE _TESTS = [{ 'url': 'http://music.yandex.ru/album/540508', @@ -275,6 +275,10 @@ class YandexMusicAlbumIE(YandexMusicPlaylistBaseIE): 'playlist_count': 187, }] + @classmethod + def suitable(cls, url): + return False if YandexMusicTrackIE.suitable(url) else super(YandexMusicAlbumIE, cls).suitable(url) + def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) tld = mobj.group('tld')