From 1721d4a8467c7216e90398700270aaccbdf439a2 Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Mon, 18 Sep 2017 01:15:36 +0200 Subject: [PATCH] [Heise] Improve RSS download for PR #14108 --- youtube_dl/extractor/heise.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/heise.py b/youtube_dl/extractor/heise.py index 7124019df..5aefc8f8f 100644 --- a/youtube_dl/extractor/heise.py +++ b/youtube_dl/extractor/heise.py @@ -112,16 +112,19 @@ class HeiseIE(InfoExtractor): # e.g. "18.5" from "c't uplink 18.5:" episode_str = re.findall(r'[0-9]{1,2}.[0-9]{1,2}', title) - feeds = [ - self._download_xml( + feeds = [] + for i, feed in enumerate([ 'https://www.heise.de/ct/uplink/ctuplink.rss', - video_id, "Downloading alternative XML (audio)"), - self._download_xml( 'https://www.heise.de/ct/uplink/ctuplinkvideo.rss', - video_id, "Downloading alternative XML (SD)"), - self._download_xml( - 'https://www.heise.de/ct/uplink/ctuplinkvideohd.rss', - video_id, "Downloading alternative XML (HD)")] + 'https://www.heise.de/ct/uplink/ctuplinkvideohd.rss']): + xml = self._download_xml(feed, video_id, + "Downloading alternative XML (%s)" % (['audio', 'SD video', 'HD video'][i]), + fatal=False) + if xml is not False: + feeds.append(xml) + + if len(feeds) == 0: + return titles = feeds[0].findall('./channel/item/title') descriptions = feeds[0].findall('./channel/item/description')