Skip to content

Commit

Permalink
Mpv launch arguments added. (#593)
Browse files Browse the repository at this point in the history
Co-authored-by: theCow61 <theCow61@github.com>
  • Loading branch information
theCow61 and theCow61 committed Dec 22, 2020
1 parent 74e3d37 commit 49a5498
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion anime_downloader/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions anime_downloader/players/mpv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from anime_downloader.players.baseplayer import BasePlayer
from anime_downloader import config
from anime_downloader.config import Config

import os

Expand All @@ -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():
Expand Down

0 comments on commit 49a5498

Please sign in to comment.