diff options
author | Gino Lisignoli <glisignoli@gmail.com> | 2013-02-13 14:02:31 +1300 |
---|---|---|
committer | Gino Lisignoli <glisignoli@gmail.com> | 2013-02-13 14:02:31 +1300 |
commit | 7311fef854632130af5edcae7f6762f0fedbaccb (patch) | |
tree | 8a925f224a4d08b028d890757757bc4609804499 /youtube_dl/FileDownloader.py | |
parent | 906417c7c586218c5a61f9966ce7d67528f97b69 (diff) |
Modified youtube-dl to write new lines with the --newline switch. This
enables easier process monitoring when being called with external
scripts.
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r-- | youtube_dl/FileDownloader.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index 4f51ed8b0..ca047ba4c 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -305,7 +305,10 @@ class FileDownloader(object): """Report download progress.""" if self.params.get('noprogress', False): return - self.to_screen(u'\r[download] %s of %s at %s ETA %s' % + if self.params.get('newline', True): + self.to_screen(u'\r[download] %s of %s at %s ETA %s' % + (percent_str, data_len_str, speed_str, eta_str)) + else: self.to_screen(u'\r[download] %s of %s at %s ETA %s' % (percent_str, data_len_str, speed_str, eta_str), skip_eol=True) self.to_cons_title(u'youtube-dl - %s of %s at %s ETA %s' % (percent_str.strip(), data_len_str.strip(), speed_str.strip(), eta_str.strip())) |