SVT sv-forced subtitles for forced subtitles

Pierre Mesure 10 hours ago
parent 404bd889d0
commit 0ed3542369

@ -60,6 +60,8 @@ class SVTBaseIE(InfoExtractor):
subtitle_url = sr.get('url')
subtitle_lang = sr.get('language', 'sv')
if subtitle_url:
if 'open' in subtitle_url:
subtitle_lang += '-forced'
sub = {
'url': subtitle_url,
}
@ -115,6 +117,26 @@ class SVTPlayIE(SVTBaseIE):
)
'''
_TESTS = [{
'url': 'https://www.svtplay.se/video/eXYgwZb/sverige-och-kriget/1-utbrottet',
'md5': '2382036fd6f8c994856c323fe51c426e',
'info_dict': {
'id': 'ePBvGRq',
'ext': 'mp4',
'title': '1. Utbrottet',
'description': 'md5:02291cc3159dbc9aa95d564e77a8a92b',
'series': 'Sverige och kriget',
'episode': '1. Utbrottet',
'timestamp': 1746921600,
'upload_date': '20250511',
'duration': 3585,
'thumbnail': r're:^https?://(?:.*[\.-]jpg|www.svtstatic.se/image/.*)$',
'age_limit': 0,
'subtitles': {'sv': 'count:5', 'sv-forced': 'count:1'},
},
'params': {
'skip_download': 'm3u8',
},
}, {
'url': 'https://www.svtplay.se/video/30479064',
'md5': '2382036fd6f8c994856c323fe51c426e',
'info_dict': {

Loading…
Cancel
Save