X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fted.py;h=8b31caa92c1e44473aa42953427b3cc2d71762f7;hb=26dca1661ebb43af53c785b69eddcdec9ac120d1;hp=2e497c86ee41cf3c7afa76da967bf2a542b38659;hpb=2b35c9ef742bf261078ea10c6c0bba848db1a0df;p=youtube-dl diff --git a/youtube_dl/extractor/ted.py b/youtube_dl/extractor/ted.py index 2e497c86e..8b31caa92 100644 --- a/youtube_dl/extractor/ted.py +++ b/youtube_dl/extractor/ted.py @@ -1,13 +1,15 @@ +from __future__ import unicode_literals + import json import re from .subtitles import SubtitlesInfoExtractor from ..utils import ( - compat_str, RegexNotFoundError, ) + class TEDIE(SubtitlesInfoExtractor): _VALID_URL=r'''http://www\.ted\.com/ ( @@ -19,12 +21,12 @@ class TEDIE(SubtitlesInfoExtractor): /(?P\w+) # Here goes the name and then ".html" ''' _TEST = { - u'url': u'http://www.ted.com/talks/dan_dennett_on_our_consciousness.html', - u'file': u'102.mp4', - u'md5': u'2d76ee1576672e0bd8f187513267adf6', - u'info_dict': { - u"description": u"md5:c6fa72e6eedbd938c9caf6b2702f5922", - u"title": u"Dan Dennett: The illusion of consciousness" + 'url': 'http://www.ted.com/talks/dan_dennett_on_our_consciousness.html', + 'file': '102.mp4', + 'md5': '4ea1dada91e4174b53dac2bb8ace429d', + 'info_dict': { + "description": "md5:c6fa72e6eedbd938c9caf6b2702f5922", + "title": "Dan Dennett: The illusion of consciousness" } } @@ -48,7 +50,7 @@ class TEDIE(SubtitlesInfoExtractor): '''Returns the videos of the playlist''' webpage = self._download_webpage( - url, playlist_id, u'Downloading playlist webpage') + url, playlist_id, 'Downloading playlist webpage') matches = re.finditer( r'/talks/[^"]+\.html)">[^<]*

', webpage) @@ -113,6 +115,6 @@ class TEDIE(SubtitlesInfoExtractor): url = 'http://www.ted.com/talks/subtitles/id/%s/lang/%s/format/srt' % (video_id, l) sub_lang_list[l] = url return sub_lang_list - except RegexNotFoundError as err: + except RegexNotFoundError: self._downloader.report_warning(u'video doesn\'t have subtitles') return {}