Merge remote-tracking branch 'olebowle/ard'
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 27 Oct 2014 00:36:50 +0000 (01:36 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 27 Oct 2014 00:36:50 +0000 (01:36 +0100)
youtube_dl/extractor/ard.py

index 8de9c11eaedcd078b70d2c5bb74f9b40fdb9c46c..630b1faa999617c79d160a636052e2acd6d5debd 100644 (file)
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
 import re
 
 from .common import InfoExtractor
+from .generic import GenericIE
 from ..utils import (
     determine_ext,
     ExtractorError,
@@ -12,6 +13,7 @@ from ..utils import (
     parse_duration,
     unified_strdate,
     xpath_text,
+    parse_xml,
 )
 
 
@@ -54,6 +56,11 @@ class ARDMediathekIE(InfoExtractor):
         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($|[=&])', url):
+            doc = parse_xml(webpage)
+            if doc.tag == 'rss':
+                return GenericIE()._extract_rss(url, video_id, doc)
+
         title = self._html_search_regex(
             [r'<h1(?:\s+class="boxTopHeadline")?>(.*?)</h1>',
              r'<meta name="dcterms.title" content="(.*?)"/>',