diff --git a/get_youtube_videos/get_youtube_videos.py b/get_youtube_videos/get_youtube_videos.py index 9651b7e..d368434 100644 --- a/get_youtube_videos/get_youtube_videos.py +++ b/get_youtube_videos/get_youtube_videos.py @@ -409,13 +409,14 @@ class GetYoutubeVideos: ydl_opts['format'] = 'bestvideo+bestaudio[ext=m4a]/best' result = 'retrying (format error)' elif 'Unable to download video subtitles for' in f"{error}": + regex = r"Unable to download video subtitles for '([a-z]*)'" subtitle_match = re.match( - r"Unable to download video subtitles for '([a-z]*)'", + regex, f"{error}" ) if not subtitle_match: self._log.error( - f"Error finding subtitle that failed in error string" + f"Error finding subtitle that failed in error string. Regex: r\"{regex}\". Error string: \"{error}\"" ) else: ydl_opts['subtitleslangs'].pop(subtitle_match.group(1))