From 9181923e521a582b0c4fe095ef7f2865435d746e Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 9 Nov 2022 12:49:33 +0300 Subject: [PATCH] Check mpv options --- src/mpv_control.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mpv_control.py b/src/mpv_control.py index 54fcb90..32c3549 100644 --- a/src/mpv_control.py +++ b/src/mpv_control.py @@ -13,13 +13,19 @@ def mpv_log(loglevel, component, message): elif loglevel == 'error': logger.error(f'{component} {message}') -player = mpv.MPV(log_handler=mpv_log, ytdl=False, - prefetch_playlist=True) +player = mpv.MPV(log_handler=mpv_log) + +list_options = dir(player) +if 'ytdl' in list_options: + player.ytdl = False +if 'prefetch_playlist' in list_options: + player.prefetch_playlist = True def set_http_header(headers=[]): player.http_header_fields = headers + @logger.catch def player_menu(header=None, storage={}): while True: