fix: Update subtitle download error handling to return unknown title
This commit is contained in:
@@ -108,7 +108,7 @@ def download_subtitles(url: str, quiet: bool = False) -> tuple[bool, Path | None
|
|||||||
|
|
||||||
if not vtt_files:
|
if not vtt_files:
|
||||||
print("No VTT file found after download", file=sys.stderr)
|
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
|
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
|
import traceback
|
||||||
|
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return False, None, 0
|
return False, None, 0, "Unknown Title"
|
||||||
|
|
||||||
|
|
||||||
def clean_vtt_text(text: str) -> str:
|
def clean_vtt_text(text: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user