mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 01:02:13 +01:00
[extractor/BiliIntl] Fix subtitle extraction
Closes #3123 Authored by: HobbyistDev
This commit is contained in:
parent
5df1444255
commit
dfb855b42d
1 changed files with 2 additions and 1 deletions
|
@ -789,7 +789,8 @@ def _call_api(self, endpoint, *args, **kwargs):
|
|||
def json2srt(self, json):
|
||||
data = '\n\n'.join(
|
||||
f'{i + 1}\n{srt_subtitles_timecode(line["from"])} --> {srt_subtitles_timecode(line["to"])}\n{line["content"]}'
|
||||
for i, line in enumerate(json['body']) if line.get('content'))
|
||||
for i, line in enumerate(traverse_obj(json, (
|
||||
'body', lambda _, l: l['content'] and l['from'] and l['to']))))
|
||||
return data
|
||||
|
||||
def _get_subtitles(self, *, ep_id=None, aid=None):
|
||||
|
|
Loading…
Reference in a new issue