From b5d7894e7862c16fffa9b95049e674d6e7fc30e0 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Tue, 13 Apr 2021 00:05:41 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20Got=20rid=20of=20file?= =?UTF-8?q?=20path=20in=20download=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index f5413ad..02746d8 100644 --- a/main.py +++ b/main.py @@ -5,6 +5,7 @@ from pathlib import Path import os import sys import json +import re import argparse import logging import youtube_dl @@ -55,15 +56,17 @@ c = Console() def prg_hook(d): + _filename = d['filename'].replace( + os.path.join(output_dir, ch['title'])+'/', '') if d['status'] == 'finished': sys.stdout.write("\033[F") sys.stdout.write("\033[K") c.print( - ':white_check_mark: {}\n'.format(d['filename'])) + ':white_check_mark: {}\n'.format(_filename)) if d['status'] == 'downloading': sys.stdout.write("\033[F") 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']))