From af588b2f9f63cc6be1bc41c12a677b80dede9e69 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 23 Jan 2016 13:07:18 +0800 Subject: [PATCH] [bar] update bar display at the beginning or it may not show up itself promptly, leaving the user wondering why it doesn't start. I met this problem with http://www.letv.com/ptv/vplay/1709438.html, which downloads really fast, but I have to wait a few seconds before the bar shows up. --- src/you_get/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/you_get/common.py b/src/you_get/common.py index ab51bb6c..ebdc6f42 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -691,11 +691,13 @@ def download_urls(urls, title, ext, total_size, output_dir='.', refer=None, merg if len(urls) == 1: url = urls[0] print('Downloading %s ...' % tr(output_filename)) + bar.update() url_save(url, output_filepath, bar, refer = refer, faker = faker, headers = headers) bar.done() else: parts = [] print('Downloading %s.%s ...' % (tr(title), ext)) + bar.update() for i, url in enumerate(urls): filename = '%s[%02d].%s' % (title, i, ext) filepath = os.path.join(output_dir, filename)