From d39919c03e45b3e8f804c23f78fae33cb4adc7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Fri, 5 Apr 2013 13:01:59 +0200 Subject: [PATCH] Add progress counter for playlists Closes #276 --- youtube_dl/FileDownloader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index 2237d355d..ba3277577 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -492,8 +492,10 @@ class FileDownloader(object): 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']: + n_videos = len(info_dict['entries']) + for i,video in enumerate(info_dict['entries'],1): video['playlist'] = playlist + self.to_screen(u'[download] Downloading video #%s of %s' %(i, n_videos)) self.process_info(video) return