1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-05 02:35:04 +08:00

Work around broken fragment URLs for svtplay as described in issue 10909

This commit is contained in:
Bart Coppens
2016-10-30 20:48:55 +01:00
Unverified
parent 2c6da7df4a
commit 3cfc553a03
+8
View File
@@ -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)