fix: Update subtitle download error handling to return unknown title

This commit is contained in:
2025-01-03 14:54:54 +01:00
parent 4761a590ad
commit 45c06d081c

View File

@@ -108,7 +108,7 @@ def download_subtitles(url: str, quiet: bool = False) -> tuple[bool, Path | None
if not vtt_files:
print("No VTT file found after download", file=sys.stderr)
return False, None, 0
return False, None, 0, "Unknown Title"
return True, vtt_files[0], duration_mins, title
@@ -119,7 +119,7 @@ def download_subtitles(url: str, quiet: bool = False) -> tuple[bool, Path | None
import traceback
traceback.print_exc()
return False, None, 0
return False, None, 0, "Unknown Title"
def clean_vtt_text(text: str) -> str: