🐛 Fixed a download status display bug on Windows

Fixed a bug on Windows where the full path was displayed instead of only the filename
This commit is contained in:
2021-04-16 19:06:02 +03:00
parent 39d12e9778
commit a05015caca

View File

@@ -65,8 +65,12 @@ c = Console()
def prg_hook(d):
_filename = d['filename'].replace(
os.path.join(output_dir, ch['title'])+'/', '')
_filedir = os.path.join(output_dir, ch['title'])+'/'
if platform.system() == 'Windows':
_filedir = _filedir.replace('/', '\\')
_filename = d['filename'].replace(_filedir, '')
if d['status'] == 'finished':
sys.stdout.write("\033[F")
sys.stdout.write("\033[K")