mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 19:36:45 +00:00
[ted] Use unicode_literals
This commit is contained in:
parent
8307aa73fb
commit
f853f8594d
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -7,6 +9,7 @@
|
||||||
RegexNotFoundError,
|
RegexNotFoundError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class TEDIE(SubtitlesInfoExtractor):
|
class TEDIE(SubtitlesInfoExtractor):
|
||||||
_VALID_URL=r'''http://www\.ted\.com/
|
_VALID_URL=r'''http://www\.ted\.com/
|
||||||
(
|
(
|
||||||
|
@ -18,12 +21,12 @@ class TEDIE(SubtitlesInfoExtractor):
|
||||||
/(?P<name>\w+) # Here goes the name and then ".html"
|
/(?P<name>\w+) # Here goes the name and then ".html"
|
||||||
'''
|
'''
|
||||||
_TEST = {
|
_TEST = {
|
||||||
u'url': u'http://www.ted.com/talks/dan_dennett_on_our_consciousness.html',
|
'url': 'http://www.ted.com/talks/dan_dennett_on_our_consciousness.html',
|
||||||
u'file': u'102.mp4',
|
'file': '102.mp4',
|
||||||
u'md5': u'2d76ee1576672e0bd8f187513267adf6',
|
'md5': '2d76ee1576672e0bd8f187513267adf6',
|
||||||
u'info_dict': {
|
'info_dict': {
|
||||||
u"description": u"md5:c6fa72e6eedbd938c9caf6b2702f5922",
|
"description": "md5:c6fa72e6eedbd938c9caf6b2702f5922",
|
||||||
u"title": u"Dan Dennett: The illusion of consciousness"
|
"title": "Dan Dennett: The illusion of consciousness"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +50,7 @@ def _playlist_videos_info(self, url, name, playlist_id):
|
||||||
'''Returns the videos of the playlist'''
|
'''Returns the videos of the playlist'''
|
||||||
|
|
||||||
webpage = self._download_webpage(
|
webpage = self._download_webpage(
|
||||||
url, playlist_id, u'Downloading playlist webpage')
|
url, playlist_id, 'Downloading playlist webpage')
|
||||||
matches = re.finditer(
|
matches = re.finditer(
|
||||||
r'<p\s+class="talk-title[^"]*"><a\s+href="(?P<talk_url>/talks/[^"]+\.html)">[^<]*</a></p>',
|
r'<p\s+class="talk-title[^"]*"><a\s+href="(?P<talk_url>/talks/[^"]+\.html)">[^<]*</a></p>',
|
||||||
webpage)
|
webpage)
|
||||||
|
|
Loading…
Reference in a new issue