]> git.bitcoin.ninja Git - youtube-dl/commitdiff
Add progress counter for playlists
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 5 Apr 2013 11:01:59 +0000 (13:01 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 9 Apr 2013 11:45:52 +0000 (13:45 +0200)
Closes #276

youtube_dl/FileDownloader.py

index 2237d355df893621a735f72f55cba38f9f7366ac..ba3277577071f1c4ffdf9797da889b8bd15bd353 100644 (file)
@@ -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