Update youtube.py

This commit is contained in:
Classic298 2025-05-06 16:30:18 +02:00 committed by GitHub
parent c69278c13c
commit f65dc715f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,7 +105,7 @@ class YoutubeLoader:
# Make a copy of the language list to avoid modifying the original # Make a copy of the language list to avoid modifying the original
languages_to_try = list(self.language) languages_to_try = list(self.language)
# Add English as fallback, if not already in the list # Add English as fallback if not already in the list
if "en" not in languages_to_try: if "en" not in languages_to_try:
log.debug("Adding English as fallback language") log.debug("Adding English as fallback language")
languages_to_try.append("en") languages_to_try.append("en")
@ -132,5 +132,5 @@ class YoutubeLoader:
# If we get here, all languages failed # If we get here, all languages failed
languages_tried = ", ".join(languages_to_try) languages_tried = ", ".join(languages_to_try)
log.warning(f"No transcript found for any of the specified languages: {languages_tried}") log.warning(f"No transcript found for any of the specified languages: {languages_tried}. Verify if the video has transcripts, add more languages if needed.")
raise NoTranscriptFound(f"No transcript found for any supported language. Add additional supported languages and verify whether the video has any transcripts.") raise NoTranscriptFound(f"No transcript found for any supported language. Verify if the video has transcripts, add more languages if needed.")