From df6cb6ac37c092c94622607946d8a289f2a14af5 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 27 Jan 2014 10:51:45 +0100 Subject: [PATCH] [ard] Filter out unsupported f4m urls. --- youtube_dl/extractor/ard.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/ard.py b/youtube_dl/extractor/ard.py index dbf8eed99..31c557198 100644 --- a/youtube_dl/extractor/ard.py +++ b/youtube_dl/extractor/ard.py @@ -38,8 +38,15 @@ class ARDIE(InfoExtractor): raise ExtractorError(u'This video is only available after 8:00 pm') # choose default media type and highest quality for now - stream = max([s for s in streams if int(s["media_type"]) == 0], - key=lambda s: int(s["quality"])) + filtered_streams = [] + for stream in streams: + if int(stream["media_type"]) != 0: + continue + if stream["video_url"].endswith("f4m"): + continue + filtered_streams.append(stream) + + stream = max(filtered_streams, key=lambda s: int(s["quality"])) # there's two possibilities: RTMP stream or HTTP download info = {'id': video_id, 'title': title, 'ext': 'mp4'}