From fe3e3cfaccb80aa8d168761cc75da44faafba671 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 8 Apr 2022 15:56:34 +0700 Subject: [PATCH] fix filenotfounderror for missing subtitles when deleting video --- tubearchivist/home/src/index/video.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/index/video.py b/tubearchivist/home/src/index/video.py index 811059e..a728caf 100644 --- a/tubearchivist/home/src/index/video.py +++ b/tubearchivist/home/src/index/video.py @@ -498,7 +498,10 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): for media_url in to_del: file_path = os.path.join(video_base, media_url) - os.remove(file_path) + try: + os.remove(file_path) + except FileNotFoundError: + print(f"{self.youtube_id}: failed {media_url}, continue.") self.del_in_es() self.delete_subtitles()