def test_custom_with_deprecated_plugin(self, mock_log): mock_setup_args = self.subject( [self.configdir / "non-existent", DeprecatedPath(self.configdir / "secondary")], config=[str(self.configdir / "custom")] ) expected = [self.configdir / "custom", DeprecatedPath(self.configdir / "secondary.testplugin")] mock_setup_args.assert_called_once_with(self.parser, expected, ignore_unknown=False) self.assertEqual(mock_log.info.mock_calls, [ call(f"Loaded plugin config from deprecated path, see CLI docs for how to migrate: {expected[1]}") ])
def test_custom_multiple(self, mock_log): mock_setup_args = self.subject( [self.configdir / "primary", DeprecatedPath(self.configdir / "secondary")], config=[str(self.configdir / "non-existent"), str(self.configdir / "primary"), str(self.configdir / "secondary")] ) expected = [self.configdir / "secondary", self.configdir / "primary", self.configdir / "primary.testplugin"] mock_setup_args.assert_called_once_with(self.parser, expected, ignore_unknown=False) self.assertEqual(mock_log.info.mock_calls, [])
def test_default_primary(self, mock_log): mock_setup_args = self.subject( [self.configdir / "primary", DeprecatedPath(self.configdir / "secondary")], config=None ) expected = [self.configdir / "primary", self.configdir / "primary.testplugin"] mock_setup_args.assert_called_once_with(self.parser, expected, ignore_unknown=False) self.assertEqual(mock_log.info.mock_calls, [])
SUPPORTED_PLAYERS = { # name: possible binary names (linux/mac and windows) "vlc": ["vlc", "vlc.exe"], "mpv": ["mpv", "mpv.exe"], "potplayer": ["potplayer", "potplayermini64.exe", "potplayermini.exe"] } CONFIG_FILES: List[Path] PLUGIN_DIRS: List[Path] LOG_DIR: Path if is_win32: APPDATA = Path(os.environ.get("APPDATA") or Path.home() / "AppData") CONFIG_FILES = [ APPDATA / "streamlink" / "config", DeprecatedPath(APPDATA / "streamlink" / "streamlinkrc") ] PLUGIN_DIRS = [APPDATA / "streamlink" / "plugins"] LOG_DIR = Path(tempfile.gettempdir()) / "streamlink" / "logs" elif is_darwin: XDG_CONFIG_HOME = Path(os.environ.get("XDG_CONFIG_HOME", "~/.config")).expanduser() CONFIG_FILES = [ Path.home() / "Library" / "Application Support" / "streamlink" / "config", DeprecatedPath(XDG_CONFIG_HOME / "streamlink" / "config"), DeprecatedPath(Path.home() / ".streamlinkrc") ] PLUGIN_DIRS = [ Path.home() / "Library" / "Application Support" / "streamlink" / "plugins",