funkwlmpv/src/mpv_control.py

12 lines
323 B
Python
Raw Normal View History

2022-11-01 12:15:28 +02:00
from loguru import logger
import mpv
2022-11-01 12:15:28 +02:00
def mpv_log(loglevel, component, message):
if loglevel == 'info':
logger.info(f'{component} {message}')
elif loglevel == 'error':
logger.error(f'{component} {message}')
player = mpv.MPV(log_handler=mpv_log, ytdl=False,
prefetch_playlist=True)