mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
clean exit when auto subtitle extract fails
This commit is contained in:
parent
ce4fa8ee61
commit
78720b33b7
@ -62,6 +62,9 @@ class YoutubeSubtitle:
|
|||||||
video_media_url = self.video.json_data["media_url"]
|
video_media_url = self.video.json_data["media_url"]
|
||||||
media_url = video_media_url.replace(".mp4", f"-{lang}.vtt")
|
media_url = video_media_url.replace(".mp4", f"-{lang}.vtt")
|
||||||
all_formats = all_subtitles.get(lang)
|
all_formats = all_subtitles.get(lang)
|
||||||
|
if not all_formats:
|
||||||
|
return False
|
||||||
|
|
||||||
subtitle = [i for i in all_formats if i["ext"] == "vtt"][0]
|
subtitle = [i for i in all_formats if i["ext"] == "vtt"][0]
|
||||||
subtitle.update(
|
subtitle.update(
|
||||||
{"lang": lang, "source": "auto", "media_url": media_url}
|
{"lang": lang, "source": "auto", "media_url": media_url}
|
||||||
|
Loading…
Reference in New Issue
Block a user