Skip to content

Commit

Permalink
XbmcProxySettings: init in Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaev-rd committed Feb 6, 2024
1 parent e595bcc commit 100a665
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/resources/lib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 100a665

Please sign in to comment.