mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 18:34:32 +01:00
Add hardcoded swedish subs to tv4 extractor
If anyone know how to extract it dynamically then feel free to give me a tip or improve it before merging it in. # The subtitles are defined in the manifest_url like this: # # SUBTITLES groups # #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",NAME="Swedish",LANGUAGE="sv",AUTOSELECT=YES,DEFAULT=YES,URI="bmetgl4z0mr(12579349_ISMUSP)-textstream_swe=3000.m3u8" # but I don't know yet how to extract it dynamically from there so they are hardcoded as a start.
This commit is contained in:
parent
00eb865b3c
commit
08d06c8f07
@ -107,11 +107,21 @@ class TV4IE(InfoExtractor):
|
||||
|
||||
self._sort_formats(formats)
|
||||
|
||||
# The subtitles are defined in the manifest_url like this:
|
||||
# # SUBTITLES groups
|
||||
# #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",NAME="Swedish",LANGUAGE="sv",AUTOSELECT=YES,DEFAULT=YES,URI="bmetgl4z0mr(12579349_ISMUSP)-textstream_swe=3000.m3u8"
|
||||
# but I don't know yet how to extract it dynamically from there so they are hardcoded as a start.
|
||||
hardcoded_swedish_subs_url = manifest_url[:-5] + "-textstream_swe=3000.webvtt"
|
||||
subtitles = {}
|
||||
subtitles.setdefault('sv', []).append({
|
||||
'url': hardcoded_swedish_subs_url,
|
||||
'ext': 'vtt'})
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'formats': formats,
|
||||
# 'subtitles': subtitles,
|
||||
'subtitles': subtitles,
|
||||
'description': info.get('description'),
|
||||
'timestamp': parse_iso8601(info.get('broadcast_date_time')),
|
||||
'duration': int_or_none(info.get('duration')),
|
||||
|
Loading…
Reference in New Issue
Block a user