aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-04-20 13:31:21 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-04-20 13:31:21 +0200
commite905b6f80ef276900160af87c89644d95f669d9c (patch)
treea9aab88df41e48186e72e3cd9ae4d17087e58360 /youtube_dl
parent6de8f1afb72d35560396817cbc2ed96180daa019 (diff)
TEDIE can now return a playlist
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/InfoExtractors.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index e47d8b85d..b20e6b46d 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -4183,7 +4183,7 @@ class TEDIE(InfoExtractor):
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)
+ return [self._playlist_videos_info(url,name,playlist_id)]
def _talk_video_link(self,mediaSlug):
'''Returns the video link for that mediaSlug'''
@@ -4200,12 +4200,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*?)<h1>(\s*?)<span>(?P<playlist_title>.*?)</span>'
+ 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"""