From 49a5498d13b1f01eb929e0da726198660c7b904e Mon Sep 17 00:00:00 2001 From: theCow61 <68983984+theCow61@users.noreply.github.com> Date: Tue, 22 Dec 2020 11:55:26 -0600 Subject: [PATCH] Mpv launch arguments added. (#593) Co-authored-by: theCow61 --- anime_downloader/config.py | 3 ++- anime_downloader/players/mpv.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/anime_downloader/config.py b/anime_downloader/config.py index 73e71771..5bfef480 100644 --- a/anime_downloader/config.py +++ b/anime_downloader/config.py @@ -38,7 +38,8 @@ 'fallback_qualities': ['720p', '480p', '360p'], 'log_level': 'INFO', 'provider': 'twist.moe', - 'autoplay_next': True + 'autoplay_next': True, + 'mpv_arguments': '' }, 'gui': { 'player': 'mpv' diff --git a/anime_downloader/players/mpv.py b/anime_downloader/players/mpv.py index c53ec223..1b8fa800 100644 --- a/anime_downloader/players/mpv.py +++ b/anime_downloader/players/mpv.py @@ -1,5 +1,6 @@ from anime_downloader.players.baseplayer import BasePlayer from anime_downloader import config +from anime_downloader.config import Config import os @@ -20,13 +21,14 @@ def _get_executable_posix(self): @property def args(self): # Doesnt use the referer if it's none + launchArgs = Config['watch']['mpv_arguments'] if self.episode.source().referer: return ['--input-conf=' + get_mpv_configfile(), '--http-header-fields=referer: ' + str(self.episode.source().referer), - self.episode.source().stream_url] + self.episode.source().stream_url, launchArgs] else: return ['--input-conf=' + get_mpv_configfile(), - self.episode.source().stream_url] + self.episode.source().stream_url, launchArgs] def get_mpv_home():