[\S\s]+?
(?P.+?)
', webpage)
+ uploader = clean_html(m.group('uploader'))
info = {
- 'id':video_id,
- 'url':video_url,
+ 'id': video_id,
+ 'url': video_url,
'ext': 'mp4',
'title': title,
'thumbnail': thumbnail,
@@ -3966,12 +3847,13 @@ class KeekIE(InfoExtractor):
return [info]
class TEDIE(InfoExtractor):
- _VALID_URL=r'''http://www.ted.com/
+ _VALID_URL=r'''http://www\.ted\.com/
(
((?P
playlists)/(?P\d+)) # We have a playlist
|
((?Ptalks)) # We have a simple talk
)
+ (/lang/(.*?))? # The url may contain the language
/(?P\w+) # Here goes the name and then ".html"
'''
@@ -3987,8 +3869,8 @@ class TEDIE(InfoExtractor):
else :
playlist_id=m.group('playlist_id')
name=m.group('name')
- self._downloader.to_screen(u'[%s] Getting info of playlist %s: "%s"' % (self.IE_NAME,playlist_id,name))
- return self._playlist_videos_info(url,name,playlist_id)
+ self.to_screen(u'Getting info of playlist %s: "%s"' % (playlist_id,name))
+ return [self._playlist_videos_info(url,name,playlist_id)]
def _talk_video_link(self,mediaSlug):
'''Returns the video link for that mediaSlug'''
@@ -4005,12 +3887,17 @@ class TEDIE(InfoExtractor):
webpage=self._download_webpage(url, playlist_id, 'Downloading playlist webpage')
m_videos=re.finditer(video_RE,webpage,re.VERBOSE)
m_names=re.finditer(video_name_RE,webpage)
- info=[]
+
+ playlist_RE = r'div class="headline">(\s*?)(\s*?)(?P.*?)'
+ m_playlist = re.search(playlist_RE, webpage)
+ playlist_title = m_playlist.group('playlist_title')
+
+ playlist_entries = []
for m_video, m_name in zip(m_videos,m_names):
video_id=m_video.group('video_id')
talk_url='http://www.ted.com%s' % m_name.group('talk_url')
- info.append(self._talk_info(talk_url,video_id))
- return info
+ playlist_entries.append(self.url_result(talk_url, 'TED'))
+ return self.playlist_result(playlist_entries, playlist_id = playlist_id, playlist_title = playlist_title)
def _talk_info(self, url, video_id=0):
"""Return the video for the talk in the url"""
@@ -4018,7 +3905,7 @@ class TEDIE(InfoExtractor):
videoName=m.group('name')
webpage=self._download_webpage(url, video_id, 'Downloading \"%s\" page' % videoName)
# If the url includes the language we get the title translated
- title_RE=r'(?P.*)
'
+ title_RE=r'(?P.*)'
title=re.search(title_RE, webpage).group('title')
info_RE=r'''