mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-22 13:49:48 +00:00
Add direct url link to track and simulate osd message
This commit is contained in:
parent
348c80973b
commit
0c1a5d0887
@ -147,6 +147,7 @@ def radio_load(id_radio=None, type_radio='custom', name=None, related_object=Non
|
|||||||
key = track.get(i)
|
key = track.get(i)
|
||||||
if key and isinstance(key, str):
|
if key and isinstance(key, str):
|
||||||
print(i + ': ' + key)
|
print(i + ': ' + key)
|
||||||
|
print('Direct link: ' + player.stream_open_filename)
|
||||||
input()
|
input()
|
||||||
elif select == 'Like':
|
elif select == 'Like':
|
||||||
favorite_track(player_fw_storage.storage.get(
|
favorite_track(player_fw_storage.storage.get(
|
||||||
|
@ -5,6 +5,7 @@ from loguru import logger
|
|||||||
from pyfzf.pyfzf import FzfPrompt
|
from pyfzf.pyfzf import FzfPrompt
|
||||||
import mpv
|
import mpv
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
fzf = FzfPrompt()
|
fzf = FzfPrompt()
|
||||||
|
|
||||||
@ -48,6 +49,20 @@ if track_activity_history:
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
|
@player.property_observer('filtered-metadata')
|
||||||
|
@logger.catch
|
||||||
|
def osd_observer(_name, value):
|
||||||
|
'''Sumulate osd playing message in console'''
|
||||||
|
if value:
|
||||||
|
osd_message = []
|
||||||
|
for i in value.items():
|
||||||
|
if i[0] in ('Artist', 'Album', 'Title'):
|
||||||
|
osd_message.append(i[1])
|
||||||
|
sys.stdout.write('\r ')
|
||||||
|
sys.stdout.write('\r'+' — '.join(osd_message))
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
def set_http_header(headers=[]):
|
def set_http_header(headers=[]):
|
||||||
player.http_header_fields = headers
|
player.http_header_fields = headers
|
||||||
|
|
||||||
@ -91,6 +106,7 @@ def player_menu(header='', storage={}):
|
|||||||
key = track.get(i)
|
key = track.get(i)
|
||||||
if key and isinstance(key, str):
|
if key and isinstance(key, str):
|
||||||
print(i + ': ' + key)
|
print(i + ': ' + key)
|
||||||
|
print('Direct link: ' + player.stream_open_filename)
|
||||||
input()
|
input()
|
||||||
elif select == 'Like':
|
elif select == 'Like':
|
||||||
src.fw_api.favorite_track(
|
src.fw_api.favorite_track(
|
||||||
|
Loading…
Reference in New Issue
Block a user