From f1858bf4fef12b1ed009b707720339fc43787957 Mon Sep 17 00:00:00 2001 From: luceatnobis Date: Sun, 23 Jul 2017 13:10:58 +0200 Subject: [PATCH] [RutubeIE] Allow for lone 'pl_id' parameter in URL --- youtube_dl/extractor/rutube.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/rutube.py b/youtube_dl/extractor/rutube.py index e8045987f..2daaf292a 100644 --- a/youtube_dl/extractor/rutube.py +++ b/youtube_dl/extractor/rutube.py @@ -46,12 +46,23 @@ class RutubeIE(InfoExtractor): }, { 'url': 'http://rutube.ru/embed/a10e53b86e8f349080f718582ce4c661', 'only_matching': True, + }, { + 'url': 'http://rutube.ru/video/3eac3b4561676c17df9132a9a1e62e3e/?pl_id=4252', + 'only_matching': True, }] @classmethod def suitable(cls, url): parts = compat_urllib_parse_urlparse(url) - return super(RutubeIE, cls).suitable(url) and not parts.query + params = compat_parse_qs(parts.query) + + # see if URL without parameters is OK + res = super(RutubeIE, cls).suitable(url) + + if params: # we only allow pl_id parameter in the url + res = res and 'pl_id' in params and len(params) == 1 + + return res @staticmethod def _extract_urls(webpage):