From 3cfc553a0310271e6d8b8400ebbb1cb1d24751ea Mon Sep 17 00:00:00 2001 From: Bart Coppens Date: Sun, 30 Oct 2016 20:48:55 +0100 Subject: [PATCH] Work around broken fragment URLs for svtplay as described in issue 10909 --- youtube_dl/extractor/svt.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/youtube_dl/extractor/svt.py b/youtube_dl/extractor/svt.py index fb0a4b24e..66c7119be 100644 --- a/youtube_dl/extractor/svt.py +++ b/youtube_dl/extractor/svt.py @@ -37,6 +37,14 @@ class SVTBaseIE(InfoExtractor): 'format_id': player_type, 'url': vurl, }) + + # Work around issue 10909 by manually rewriting fragment URLs to URLs that appear to work + for format in formats: + if 'fragments' in format: + for segment in format['fragments']: + segment_url = re.sub('dash-live/[^.].*/./', 'dash-live/./', segment['url']) + segment.update({'url': segment_url}) + if not formats and video_info.get('rights', {}).get('geoBlockedSweden'): self.raise_geo_restricted('This video is only available in Sweden') self._sort_formats(formats)