From 3741302a109f28081a9db805a371c744f7bd2a2b Mon Sep 17 00:00:00 2001 From: Ole Ernst Date: Fri, 10 Oct 2014 20:35:34 +0200 Subject: [PATCH 1/2] [ard] Add rss support --- youtube_dl/extractor/ard.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/youtube_dl/extractor/ard.py b/youtube_dl/extractor/ard.py index 8de9c11ea..cd9c1d9be 100644 --- a/youtube_dl/extractor/ard.py +++ b/youtube_dl/extractor/ard.py @@ -4,6 +4,7 @@ import re from .common import InfoExtractor +from .generic import GenericIE from ..utils import ( determine_ext, ExtractorError, @@ -12,6 +13,7 @@ parse_duration, unified_strdate, xpath_text, + parse_xml, ) @@ -54,6 +56,11 @@ def _real_extract(self, url): if '>Der gewünschte Beitrag ist nicht mehr verfügbar.<' in webpage: raise ExtractorError('Video %s is no longer available' % video_id, expected=True) + if re.search(r'rss=true', url): + doc = parse_xml(webpage) + if doc.tag == 'rss': + return GenericIE()._extract_rss(url, video_id, doc) + title = self._html_search_regex( [r'(.*?)', r'', From bfd91588f3fab0d5a14726810c186e5ec2fdd0f4 Mon Sep 17 00:00:00 2001 From: Ole Ernst Date: Wed, 22 Oct 2014 14:24:53 +0200 Subject: [PATCH 2/2] [ard] make rss match more universal --- youtube_dl/extractor/ard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/ard.py b/youtube_dl/extractor/ard.py index cd9c1d9be..630b1faa9 100644 --- a/youtube_dl/extractor/ard.py +++ b/youtube_dl/extractor/ard.py @@ -56,7 +56,7 @@ def _real_extract(self, url): if '>Der gewünschte Beitrag ist nicht mehr verfügbar.<' in webpage: raise ExtractorError('Video %s is no longer available' % video_id, expected=True) - if re.search(r'rss=true', url): + if re.search(r'[\?&]rss($|[=&])', url): doc = parse_xml(webpage) if doc.tag == 'rss': return GenericIE()._extract_rss(url, video_id, doc)