From: anovicecodemonkey Date: Wed, 19 Mar 2014 14:34:21 +0000 (+1030) Subject: [TEDIE] Add support for embeded TED video URLs X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=fc26023120375c1a5ecad248241770f20c60b01e;p=youtube-dl.git [TEDIE] Add support for embeded TED video URLs --- diff --git a/youtube_dl/extractor/ted.py b/youtube_dl/extractor/ted.py index 3968b718e..aab026936 100644 --- a/youtube_dl/extractor/ted.py +++ b/youtube_dl/extractor/ted.py @@ -11,7 +11,7 @@ from ..utils import ( class TEDIE(SubtitlesInfoExtractor): - _VALID_URL = r'''(?x)http://www\.ted\.com/ + _VALID_URL = r'''(?x)http://(?Pwww|embed)\.ted\.com/ ( (?Pplaylists(?:/\d+)?) # We have a playlist | @@ -48,6 +48,9 @@ class TEDIE(SubtitlesInfoExtractor): def _real_extract(self, url): m = re.match(self._VALID_URL, url, re.VERBOSE) + if m.group('type') == 'embed': # if the _VALID_URL is an embed + desktop_url = re.sub("embed", "www", url) + return self.url_result(desktop_url, 'TED') # pass the desktop version to the extractor name = m.group('name') if m.group('type_talk'): return self._talk_info(url, name)