1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 08:57:27 +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
parent 2c6da7df4a
commit 3cfc553a03
No known key found for this signature in database
GPG Key ID: 651695B05F29CF10

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)