fix filenotfounderror for missing subtitles when deleting video

pull/208/head
simon 3 years ago
parent efa240440b
commit fe3e3cfacc
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

@ -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()

Loading…
Cancel
Save