diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2015-02-20 23:20:14 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2015-02-20 23:20:14 +0100 |
commit | e14ced791813cdd55f9d344febb3f95035754401 (patch) | |
tree | 504a4eb281bb6bccd5e5389524e85e8deda85cfa /youtube_dl/extractor/ted.py | |
parent | 5e9a033e6e8054605bb87c8448f95a5bb86a71bb (diff) | |
parent | ab9d02f53b167cb20ce243b20d861bdd9173ae44 (diff) |
Merge branch 'master' of github.com:rg3/youtube-dl
Diffstat (limited to 'youtube_dl/extractor/ted.py')
-rw-r--r-- | youtube_dl/extractor/ted.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/youtube_dl/extractor/ted.py b/youtube_dl/extractor/ted.py index 10b3b706a..59678399d 100644 --- a/youtube_dl/extractor/ted.py +++ b/youtube_dl/extractor/ted.py @@ -83,6 +83,22 @@ class TEDIE(SubtitlesInfoExtractor): 'params': { 'skip_download': True, }, + }, { + # YouTube video + 'url': 'http://www.ted.com/talks/jeffrey_kluger_the_sibling_bond', + 'add_ie': ['Youtube'], + 'info_dict': { + 'id': 'aFBIPO-P7LM', + 'ext': 'mp4', + 'title': 'The hidden power of siblings: Jeff Kluger at TEDxAsheville', + 'description': 'md5:3d7a4f50d95ca5dd67104e2a20f43fe1', + 'uploader': 'TEDx Talks', + 'uploader_id': 'TEDxTalks', + 'upload_date': '20111216', + }, + 'params': { + 'skip_download': True, + }, }] _NATIVE_FORMATS = { @@ -132,11 +148,16 @@ class TEDIE(SubtitlesInfoExtractor): talk_info = self._extract_info(webpage)['talks'][0] - if talk_info.get('external') is not None: - self.to_screen('Found video from %s' % talk_info['external']['service']) + external = talk_info.get('external') + if external: + service = external['service'] + self.to_screen('Found video from %s' % service) + ext_url = None + if service.lower() == 'youtube': + ext_url = external.get('code') return { '_type': 'url', - 'url': talk_info['external']['uri'], + 'url': ext_url or external['uri'], } formats = [{ |