from loguru import logger import mpv 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)