-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple player basics and IINA support (#690)
- Loading branch information
Showing
4 changed files
with
72 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from anime_downloader.players.mpv import mpv | ||
from anime_downloader.players.iina import iina | ||
|
||
Players = { | ||
'mpv': mpv, | ||
'iina': iina | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from anime_downloader.players.baseplayer import BasePlayer | ||
from anime_downloader.players.mpv import get_mpv_configfile | ||
from anime_downloader import config | ||
from anime_downloader.config import Config | ||
|
||
import os | ||
|
||
|
||
class iina(BasePlayer): | ||
name = 'iina' | ||
|
||
STOP = 50 | ||
NEXT = 51 | ||
CONNECT_ERR = 2 | ||
|
||
def _get_executable_windows(self): | ||
return 'iina.exe' | ||
|
||
def _get_executable_posix(self): | ||
return 'iina' | ||
|
||
@property | ||
def args(self): | ||
# Doesnt use the referer if it's none | ||
launchArgs = Config['watch']['iina_arguments'] | ||
if self.episode.source().referer: | ||
return ['--keep-running', | ||
'--input-conf=' + get_mpv_configfile(), | ||
'--http-header-fields=referer: ' + str(self.episode.source().referer), | ||
self.episode.source().stream_url, launchArgs] | ||
else: | ||
return ['--keep-running', | ||
'--input-conf=' + get_mpv_configfile(), | ||
self.episode.source().stream_url, launchArgs] | ||
|