From b0d4d3976ee803520c303e542cc0e1bdb3d0a32b Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sun, 6 Nov 2022 03:56:09 +0300 Subject: [PATCH] download visible --- src/fw_radios.py | 5 +++-- src/utils.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fw_radios.py b/src/fw_radios.py index 9ca7a7c..4f7ca4e 100644 --- a/src/fw_radios.py +++ b/src/fw_radios.py @@ -62,7 +62,6 @@ def radio_load(id_radio=None, type_radio='custom'): radio_task.start() while True: try: - input() select = fzf.prompt(('Next', 'Prev', 'Pause', 'Download', 'Exit'), f'--header=\'Radio playing...\'')[0] if select == 'Next': radio_get_track(radio_session_id) @@ -75,7 +74,9 @@ def radio_load(id_radio=None, type_radio='custom'): else: player.pause = True elif select == 'Download': - download_track(player.filename) + print('Downloading...') + name_downloaded = download_track(player.filename) + print(f'Downloaded: {name_downloaded}') elif select == 'Exit': try: radio_event_gen.clear() diff --git a/src/utils.py b/src/utils.py index ccbbc30..3adcb6f 100644 --- a/src/utils.py +++ b/src/utils.py @@ -19,4 +19,4 @@ def download_track(url, name=None): with open(name, 'wb') as f: f.write(r.content) - + return name