From b7e705c2cd5a561233ccd07ac6972af2f66c8c1e Mon Sep 17 00:00:00 2001 From: bato3 Date: Fri, 27 Jul 2018 13:54:35 +0200 Subject: [PATCH 1/3] Don't match `media-` as playlist, fixes #17065, fixes #17069 --- youtube_dl/extractor/crunchyroll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/crunchyroll.py b/youtube_dl/extractor/crunchyroll.py index 311da515d..d8051bf12 100644 --- a/youtube_dl/extractor/crunchyroll.py +++ b/youtube_dl/extractor/crunchyroll.py @@ -580,7 +580,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text class CrunchyrollShowPlaylistIE(CrunchyrollBaseIE): IE_NAME = 'crunchyroll:playlist' - _VALID_URL = r'https?://(?:(?Pwww|m)\.)?(?Pcrunchyroll\.com/(?!(?:news|anime-news|library|forum|launchcalendar|lineup|store|comics|freetrial|login))(?P[\w\-]+))/?(?:\?|$)' + _VALID_URL = r'https?://(?:(?Pwww|m)\.)?(?Pcrunchyroll\.com/(?!(?:news|anime-news|library|forum|launchcalendar|lineup|store|comics|freetrial|login|media-\d+))(?P[\w\-]+))/?(?:\?|$)' _TESTS = [{ 'url': 'http://www.crunchyroll.com/a-bridge-to-the-starry-skies-hoshizora-e-kakaru-hashi', From a5dee01343797828508d215910633efe47434dfa Mon Sep 17 00:00:00 2001 From: bato3 Date: Sat, 28 Jul 2018 01:26:40 +0200 Subject: [PATCH 2/3] I have no idea how to write a test that will succeed if extracotr does not match the url. --- youtube_dl/extractor/crunchyroll.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/youtube_dl/extractor/crunchyroll.py b/youtube_dl/extractor/crunchyroll.py index d8051bf12..9c64bb8b7 100644 --- a/youtube_dl/extractor/crunchyroll.py +++ b/youtube_dl/extractor/crunchyroll.py @@ -262,6 +262,9 @@ class CrunchyrollIE(CrunchyrollBaseIE): # Just test metadata extraction 'skip_download': True, }, + }, { + 'url': 'http://www.crunchyroll.com/media-723735', + 'only_matching': True, }] _FORMAT_IDS = { @@ -603,6 +606,13 @@ class CrunchyrollShowPlaylistIE(CrunchyrollBaseIE): 'url': 'http://www.crunchyroll.com/ladies-versus-butlers?skip_wall=1', 'only_matching': True, }] + # Is possible make test, that try URL, and return: This URL is invalid for this extractor + ''' + , { + 'url': 'http://www.crunchyroll.com/media-723735', + 'invalid_url': True, + } + ''' def _real_extract(self, url): show_id = self._match_id(url) From 94dc1a82ebbf6c4c1fc8d902bff4b8de51bbe12c Mon Sep 17 00:00:00 2001 From: Sergey M Date: Sun, 29 Jul 2018 06:55:07 +0700 Subject: [PATCH 3/3] Update crunchyroll.py --- youtube_dl/extractor/crunchyroll.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/youtube_dl/extractor/crunchyroll.py b/youtube_dl/extractor/crunchyroll.py index 9c64bb8b7..463f995c7 100644 --- a/youtube_dl/extractor/crunchyroll.py +++ b/youtube_dl/extractor/crunchyroll.py @@ -606,13 +606,6 @@ class CrunchyrollShowPlaylistIE(CrunchyrollBaseIE): 'url': 'http://www.crunchyroll.com/ladies-versus-butlers?skip_wall=1', 'only_matching': True, }] - # Is possible make test, that try URL, and return: This URL is invalid for this extractor - ''' - , { - 'url': 'http://www.crunchyroll.com/media-723735', - 'invalid_url': True, - } - ''' def _real_extract(self, url): show_id = self._match_id(url)