mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-22 21:49:19 +02:00
download visible
This commit is contained in:
parent
a4694a4dbe
commit
b0d4d3976e
|
@ -62,7 +62,6 @@ def radio_load(id_radio=None, type_radio='custom'):
|
||||||
radio_task.start()
|
radio_task.start()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
input()
|
|
||||||
select = fzf.prompt(('Next', 'Prev', 'Pause', 'Download', 'Exit'), f'--header=\'Radio playing...\'')[0]
|
select = fzf.prompt(('Next', 'Prev', 'Pause', 'Download', 'Exit'), f'--header=\'Radio playing...\'')[0]
|
||||||
if select == 'Next':
|
if select == 'Next':
|
||||||
radio_get_track(radio_session_id)
|
radio_get_track(radio_session_id)
|
||||||
|
@ -75,7 +74,9 @@ def radio_load(id_radio=None, type_radio='custom'):
|
||||||
else:
|
else:
|
||||||
player.pause = True
|
player.pause = True
|
||||||
elif select == 'Download':
|
elif select == 'Download':
|
||||||
download_track(player.filename)
|
print('Downloading...')
|
||||||
|
name_downloaded = download_track(player.filename)
|
||||||
|
print(f'Downloaded: {name_downloaded}')
|
||||||
elif select == 'Exit':
|
elif select == 'Exit':
|
||||||
try:
|
try:
|
||||||
radio_event_gen.clear()
|
radio_event_gen.clear()
|
||||||
|
|
|
@ -19,4 +19,4 @@ def download_track(url, name=None):
|
||||||
|
|
||||||
with open(name, 'wb') as f:
|
with open(name, 'wb') as f:
|
||||||
f.write(r.content)
|
f.write(r.content)
|
||||||
|
return name
|
||||||
|
|
Loading…
Reference in New Issue