From efde4b1142f9a5796cb027e873b19b2554fdccb5 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 24 Jul 2023 12:11:21 +0700 Subject: [PATCH] skip subtitle if not processed yet, #496 --- tubearchivist/home/src/index/subtitle.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/index/subtitle.py b/tubearchivist/home/src/index/subtitle.py index e289fbe8..18af56ac 100644 --- a/tubearchivist/home/src/index/subtitle.py +++ b/tubearchivist/home/src/index/subtitle.py @@ -62,7 +62,12 @@ class YoutubeSubtitle: if not all_formats: return False - subtitle = [i for i in all_formats if i["ext"] == "json3"][0] + subtitle_json3 = [i for i in all_formats if i["ext"] == "json3"] + if not subtitle_json3: + print(f"{self.video.youtube_id}-{lang}: json3 not processed") + return False + + subtitle = subtitle_json3[0] subtitle.update( {"lang": lang, "source": "auto", "media_url": media_url} )