Skip to content

Commit

Permalink
Add percentage on downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
lvqier committed Nov 5, 2014
1 parent adf82ca commit a5364fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xlkk/kkdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ def download_movie(surl, video_size, target):
trunk_start_time = time.time()
real_size = download_video(browser, download_url, of)
trunk_time = time.time() - trunk_start_time
print '%d/%d in %dK/s\r' % (download_size, video_size, int((real_size/trunk_time)/1024)),
print '[%%%02d] %d/%d in %dKB/s\r' % (download_size*100/video_size, download_size, video_size, int((real_size/trunk_time)/1024)),
sys.stdout.flush()
download_size = download_size + real_size
of.close()
end_time = time.time()
print '\nTime:%d Speed:%d' % (int(end_time - start_time), (video_size/1024.0)/(end_time - start_time))
print '\nTime:%d Speed:%dKB/s' % (int(end_time - start_time), (video_size/1024.0)/(end_time - start_time))

def get_suburl(browser, page_url, target_dir):
print 'GET', page_url
Expand Down

0 comments on commit a5364fd

Please sign in to comment.