This commit is contained in:
Cyberes 2019-12-16 23:39:46 -07:00
parent 5689ad9c5a
commit e226e43f39
1 changed files with 6 additions and 5 deletions

View File

@ -160,7 +160,7 @@ class ytdlLogger(object):
def my_hook(d):
global done, videoInc
global done, videoInc, mediaAmount
if d['status'] == 'finished':
if not done:
done = True
@ -169,10 +169,9 @@ def my_hook(d):
elif d['status'] == 'downloading':
if not done:
if isURL:
length = videoInc
length = '{}/{}'.format(videoInc, mediaAmount)
else:
length = videoInc + '/' + len(lines)
length = '{}/{}'.format(videoInc, len(lines))
sys.stdout.write('\x1b[2K')
try:
sys.stdout.write('\r[{}] {} -> "{}" | {} {} {} {}'.format(d['status'], length, d['filename'].strip('downloads/'),
@ -183,7 +182,7 @@ def my_hook(d):
else:
sys.stdout.write('\x1b[2K')
try:
sys.stdout.write('\r[{}] {}'.format(d['status'], d['filename'].strip('downloads/')))
sys.stdout.write('\r[{}] {}'.format(d['status']))
except KeyError as error:
pass
sys.stdout.flush()
@ -224,6 +223,7 @@ if not isURL:
else:
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([x])
print()
if args.playlists:
compress('{}-{}'.format(args.output, i))
else:
@ -233,6 +233,7 @@ if not isURL:
logger.info('skipping ' + x + ' because too big')
videoInc = videoInc + 1
else:
mediaAmount = str(len(getUrls(args.file)))
for x in getUrls(args.file):
if checkSize(x):
if args.check_size: