From 4ed3e51080dea651b3db8889b0c8f2e40d261075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Mej=C3=ADa?= Date: Tue, 5 Nov 2013 12:00:13 +0100 Subject: [ted] fixed error in case of no subtitles present I created a test, but I leave it commented since TED videos get new subtitles frequently. --- youtube_dl/extractor/ted.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'youtube_dl/extractor/ted.py') diff --git a/youtube_dl/extractor/ted.py b/youtube_dl/extractor/ted.py index 239e2a448..1b006bc9b 100644 --- a/youtube_dl/extractor/ted.py +++ b/youtube_dl/extractor/ted.py @@ -3,6 +3,11 @@ import re from .subtitles import SubtitlesInfoExtractor +from ..utils import ( + compat_str, + RegexNotFoundError, +) + class TEDIE(SubtitlesInfoExtractor): _VALID_URL=r'''http://www\.ted\.com/ ( @@ -105,12 +110,15 @@ class TEDIE(SubtitlesInfoExtractor): return info def _get_available_subtitles(self, video_id, webpage): - options = self._search_regex(r'(?:)', webpage, 'subtitles_language_select', flags=re.DOTALL) - languages = re.findall(r'(?: