From 100a66524cab277ad47bd9a2513b441c5c4ba510 Mon Sep 17 00:00:00 2001 From: Roman Nikolaev Date: Tue, 6 Feb 2024 23:29:05 +0300 Subject: [PATCH] XbmcProxySettings: init in Plugin --- src/resources/lib/client.py | 11 +++++------ src/resources/lib/plugin.py | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/resources/lib/client.py b/src/resources/lib/client.py index e8531f0..89501e8 100644 --- a/src/resources/lib/client.py +++ b/src/resources/lib/client.py @@ -43,14 +43,13 @@ def https_request(self, request: urllib.request.Request) -> urllib.request.Reque "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36", ) - proxy_settings = XbmcProxySettings(self.plugin) self.plugin.logger.debug( - f"Get system proxy settings: type={proxy_settings.type}, " - f"host={proxy_settings.host}, port={proxy_settings.port}" + f"Get system proxy settings: type={self.plugin.proxy_settings.type}, " + f"host={self.plugin.proxy_settings.host}, port={self.plugin.proxy_settings.port}" ) - if proxy_settings.enabled: - self.set_http_proxy(request=request, proxy_settings=proxy_settings) - self.set_socks_proxy(proxy_settings=proxy_settings) + if self.plugin.proxy_settings.enabled: + self.set_http_proxy(request=request, proxy_settings=self.plugin.proxy_settings) + self.set_socks_proxy(proxy_settings=self.plugin.proxy_settings) return request # HTTP / HTTPS proxy diff --git a/src/resources/lib/plugin.py b/src/resources/lib/plugin.py index 0d69f78..5fb6839 100644 --- a/src/resources/lib/plugin.py +++ b/src/resources/lib/plugin.py @@ -26,6 +26,7 @@ from resources.lib.search_history import SearchHistory from resources.lib.settings import Settings from resources.lib.utils import localize +from resources.lib.xbmc_settings import XbmcProxySettings try: @@ -53,6 +54,7 @@ def __init__(self) -> None: self.main_menu_items = self._main_menu_items() self.items = ItemsCollection(self) self.client = KinoPubClient(self) + self.proxy_settings = XbmcProxySettings(self) def list_item( self,