diff --git a/test/test_ted_subtitles.py b/test/test_ted_subtitles.py
index 3283253ab..a0dd7eeed 100644
--- a/test/test_ted_subtitles.py
+++ b/test/test_ted_subtitles.py
@@ -51,6 +51,12 @@ def test_automatic_captions(self):
self.DL.params['subtitleslang'] = ['en']
subtitles = self.getSubtitles()
self.assertTrue(len(subtitles.keys()) == 0)
+ # def test_nosubtitles(self):
+ # self.DL.expect_warning(u'video doesn\'t have subtitles')
+ # self.url = 'http://www.ted.com/talks/rodrigo_canales_the_deadly_genius_of_drug_cartels.html'
+ # self.DL.params['writesubtitles'] = True
+ # self.DL.params['allsubtitles'] = True
+ # subtitles = self.getSubtitles()
def test_multiple_langs(self):
self.DL.params['writesubtitles'] = True
langs = ['es', 'fr', 'de']
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 @@
from .subtitles import SubtitlesInfoExtractor
+from ..utils import (
+ compat_str,
+ RegexNotFoundError,
+)
+
class TEDIE(SubtitlesInfoExtractor):
_VALID_URL=r'''http://www\.ted\.com/
(
@@ -105,12 +110,15 @@ def _talk_info(self, url, video_id=0):
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'(?: