From b1ff87224cc25a77aac99dee3c8a96a62a887b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Wed, 12 Mar 2014 14:20:51 +0100 Subject: [PATCH] [vimeo] Now VimeoIE doesn't match urls of channels with a numeric id (fixes #2552) --- test/test_all_urls.py | 2 ++ youtube_dl/extractor/vimeo.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/test/test_all_urls.py b/test/test_all_urls.py index 5c17a39fb..047e84f19 100644 --- a/test/test_all_urls.py +++ b/test/test_all_urls.py @@ -124,6 +124,8 @@ class TestAllURLsMatching(unittest.TestCase): def test_vimeo_matching(self): self.assertMatch('http://vimeo.com/channels/tributes', ['vimeo:channel']) + self.assertMatch('http://vimeo.com/channels/31259', ['vimeo:channel']) + self.assertMatch('http://vimeo.com/channels/31259/53576664', ['vimeo']) self.assertMatch('http://vimeo.com/user7108434', ['vimeo:user']) self.assertMatch('http://vimeo.com/user7108434/videos', ['vimeo:user']) self.assertMatch('https://vimeo.com/user21297594/review/75524534/3c257a1b5d', ['vimeo:review']) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 4b4b472a5..bb08c6150 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -102,6 +102,15 @@ class VimeoIE(SubtitlesInfoExtractor): }, ] + @classmethod + def suitable(cls, url): + if VimeoChannelIE.suitable(url): + # Otherwise channel urls like http://vimeo.com/channels/31259 would + # match + return False + else: + return super(VimeoIE, cls).suitable(url) + def _login(self): (username, password) = self._get_login_info() if username is None: @@ -332,7 +341,7 @@ class VimeoIE(SubtitlesInfoExtractor): class VimeoChannelIE(InfoExtractor): IE_NAME = 'vimeo:channel' - _VALID_URL = r'(?:https?://)?vimeo\.com/channels/(?P[^/]+)' + _VALID_URL = r'(?:https?://)?vimeo\.com/channels/(?P[^/]+)/?(\?.*)?$' _MORE_PAGES_INDICATOR = r']+?title="(.*?)"'