From 9a607bbcd52920d2ac9074680a5d69e7911a7e71 Mon Sep 17 00:00:00 2001 From: enoch85 Date: Wed, 3 Sep 2025 01:49:05 +0200 Subject: [PATCH] Improved Plex server connection by adding a requests session and disabled SSL validation --- bazarr/plex/operations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bazarr/plex/operations.py b/bazarr/plex/operations.py index 264f51244..b84b54634 100644 --- a/bazarr/plex/operations.py +++ b/bazarr/plex/operations.py @@ -1,6 +1,7 @@ # coding=utf-8 import logging from datetime import datetime +import requests from app.config import settings, write_config from plexapi.server import PlexServer @@ -11,6 +12,9 @@ def get_plex_server() -> PlexServer: """Connect to the Plex server and return the server instance.""" from api.plex.security import TokenManager, get_or_create_encryption_key, encrypt_api_key + session = requests.Session() + session.verify = False + try: auth_method = settings.plex.get('auth_method', 'apikey') @@ -36,7 +40,7 @@ def get_plex_server() -> PlexServer: if not server_url: raise ValueError("Server URL not configured. Please select a Plex server.") - plex_server = PlexServer(server_url, decrypted_token) + plex_server = PlexServer(server_url, decrypted_token, session=session) else: # Manual/API key authentication - always use encryption now @@ -63,7 +67,7 @@ def get_plex_server() -> PlexServer: logger.error(f"Failed to decrypt API key: {type(e).__name__}") raise ValueError("Invalid encrypted API key. Please reconfigure Plex authentication.") - plex_server = PlexServer(baseurl, decrypted_apikey) + plex_server = PlexServer(baseurl, decrypted_apikey, session=session) return plex_server