mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 22:05:19 +00:00
Update youtube.py
This commit is contained in:
parent
1a30b3746e
commit
b0d74a59f1
1 changed files with 2 additions and 3 deletions
|
|
@ -118,8 +118,7 @@ class YoutubeLoader:
|
||||||
log.debug(f"No transcript found for language '{lang}'")
|
log.debug(f"No transcript found for language '{lang}'")
|
||||||
continue
|
continue
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# If we hit any other type of exception, log it and re-raise
|
log.warning(f"Error finding transcript for language '{lang}'")
|
||||||
log.exception(f"Error finding transcript for language '{lang}'")
|
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
# If all specified languages fail, fall back to English (unless English was already tried)
|
# If all specified languages fail, fall back to English (unless English was already tried)
|
||||||
|
|
@ -141,7 +140,7 @@ class YoutubeLoader:
|
||||||
log.exception("Error finding English transcript fallback")
|
log.exception("Error finding English transcript fallback")
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
# If we get here, all languages failed including the English fallback
|
# All languages failed
|
||||||
languages_tried = ", ".join(self.language)
|
languages_tried = ", ".join(self.language)
|
||||||
if "en" not in self.language:
|
if "en" not in self.language:
|
||||||
languages_tried += ", en (fallback)"
|
languages_tried += ", en (fallback)"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue