diff options
author | Jaime Marquínez Ferrándiz <jaimemf93@gmail.com> | 2013-03-29 12:32:42 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaimemf93@gmail.com> | 2013-03-29 12:32:42 +0100 |
commit | 7eab8dc7504cf1f5f1dd03eb62e266ce24948b93 (patch) | |
tree | 65f3bd7ac4e261c99dbb4fe7edfc543f7b01f6ba /youtube_dl/FileDownloader.py | |
parent | d2c690828a8297c014d8053fbdee4e26fe11586a (diff) |
Pass the playlist info_dict to process_info
the playlist value can be used in the output template
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r-- | youtube_dl/FileDownloader.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index 6af2acbee..d2b9be9ef 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -460,12 +460,21 @@ class FileDownloader(object): elif result_type == 'playlist': #We process each entry in the playlist entries_result = self.process_ie_results(result['entries'], ie) - results.extend(entries_result) + result['entries'] = entries_result + results.extend([result]) return results def process_info(self, info_dict): """Process a single dictionary returned by an InfoExtractor.""" + if info_dict.get('_type','video') == 'playlist': + playlist = info_dict.get('title', None) or info_dict.get('id', None) + self.to_screen(u'[download] Downloading playlist: %s' % playlist) + for video in info_dict['entries']: + video['playlist'] = playlist + self.process_info(video) + return + # Keep for backwards compatibility info_dict['stitle'] = info_dict['title'] |