🗑️ Got rid of file path in download status

This commit is contained in:
2021-04-13 00:05:41 +03:00
parent 9db691ee26
commit b5d7894e78

View File

@@ -5,6 +5,7 @@ from pathlib import Path
import os import os
import sys import sys
import json import json
import re
import argparse import argparse
import logging import logging
import youtube_dl import youtube_dl
@@ -55,15 +56,17 @@ c = Console()
def prg_hook(d): def prg_hook(d):
_filename = d['filename'].replace(
os.path.join(output_dir, ch['title'])+'/', '')
if d['status'] == 'finished': if d['status'] == 'finished':
sys.stdout.write("\033[F") sys.stdout.write("\033[F")
sys.stdout.write("\033[K") sys.stdout.write("\033[K")
c.print( c.print(
':white_check_mark: {}\n'.format(d['filename'])) ':white_check_mark: {}\n'.format(_filename))
if d['status'] == 'downloading': if d['status'] == 'downloading':
sys.stdout.write("\033[F") sys.stdout.write("\033[F")
sys.stdout.write("\033[K") sys.stdout.write("\033[K")
c.print(':arrow_down_small: {} {} {}'.format(d['filename'], c.print(':arrow_down_small: {} {} {}'.format(_filename,
d['_percent_str'], d['_eta_str'])) d['_percent_str'], d['_eta_str']))