diff --git a/jellyfin_mpv_shim/clients.py b/jellyfin_mpv_shim/clients.py index f3a1b8cda..2094d4292 100644 --- a/jellyfin_mpv_shim/clients.py +++ b/jellyfin_mpv_shim/clients.py @@ -94,6 +94,10 @@ def client_factory(): ) client.config.data["http.user_agent"] = USER_AGENT client.config.data["auth.ssl"] = not settings.ignore_ssl_cert + client.config.data["auth.tls_client_cert"] = settings.tls_client_cert + client.config.data["auth.tls_client_key"] = settings.tls_client_key + client.config.data["auth.tls_server_ca"] = settings.tls_server_ca + client.auth.create_session_with_client_auth() return client def _connect_all(self): diff --git a/jellyfin_mpv_shim/conf.py b/jellyfin_mpv_shim/conf.py index d83af6638..e48393673 100644 --- a/jellyfin_mpv_shim/conf.py +++ b/jellyfin_mpv_shim/conf.py @@ -134,6 +134,9 @@ class Settings(SettingsBase): thumbnail_enable: bool = True thumbnail_osc_builtin: bool = True thumbnail_preferred_size: int = 320 + tls_client_cert: Optional[str] = None + tls_client_key: Optional[str] = None + tls_server_ca: Optional[str] = None def __get_file(self, path: str, mode: str = "r", create: bool = True): created = False diff --git a/jellyfin_mpv_shim/player.py b/jellyfin_mpv_shim/player.py index 69b20bd91..6d6c75335 100644 --- a/jellyfin_mpv_shim/player.py +++ b/jellyfin_mpv_shim/player.py @@ -202,6 +202,13 @@ def __init__(self): mpv_options["config"] = True mpv_options["config_dir"] = conffile.confdir(APP_NAME) + if settings.tls_client_cert and settings.tls_client_key: + mpv_options['tls_cert_file'] = settings.tls_client_cert + mpv_options['tls_key_file'] = settings.tls_client_key + + if settings.tls_server_ca: + mpv_options['tls_ca_file'] = settings.tls_server_ca + self._player = mpv.MPV( input_default_bindings=True, input_vo_keyboard=True, @@ -210,6 +217,7 @@ def __init__(self): loglevel=settings.mpv_log_level, **mpv_options, ) + self.menu = OSDMenu(self, self._player) self.syncplay = SyncPlayManager(self)