mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-06 03:46:44 +03:00
added use_proxy setting in configuration file
This commit is contained in:
@@ -45,8 +45,8 @@ def get_yn_input(prompt):
|
||||
return None
|
||||
|
||||
|
||||
async def create_web_session():
|
||||
return aiohttp.ClientSession(trust_env=True)
|
||||
async def create_web_session(use_proxy):
|
||||
return aiohttp.ClientSession(trust_env = use_proxy)
|
||||
|
||||
|
||||
async def pair_device(web_session: aiohttp.ClientSession):
|
||||
@@ -76,7 +76,7 @@ async def pair_device(web_session: aiohttp.ClientSession):
|
||||
def main(config, debug: bool) -> None:
|
||||
print("Welcome to the iSponsorBlockTV cli setup wizard")
|
||||
loop = asyncio.get_event_loop_policy().get_event_loop()
|
||||
web_session = loop.run_until_complete(create_web_session())
|
||||
web_session = loop.run_until_complete(create_web_session(config.use_proxy))
|
||||
if debug:
|
||||
loop.set_debug(True)
|
||||
asyncio.set_event_loop(loop)
|
||||
|
||||
@@ -172,9 +172,9 @@ async def main_async(config, debug, http_tracing):
|
||||
trace_config.on_response_chunk_received.append(tracer.on_response_chunk_received)
|
||||
trace_config.on_request_end.append(tracer.on_request_end)
|
||||
trace_config.on_request_exception.append(tracer.on_request_exception)
|
||||
web_session = aiohttp.ClientSession(trust_env=True, connector=tcp_connector, trace_configs=[trace_config])
|
||||
web_session = aiohttp.ClientSession(trust_env=config.use_proxy, connector=tcp_connector, trace_configs=[trace_config])
|
||||
else:
|
||||
web_session = aiohttp.ClientSession(trust_env=True, connector=tcp_connector)
|
||||
web_session = aiohttp.ClientSession(trust_env=config.use_proxy, connector=tcp_connector)
|
||||
|
||||
api_helper = api_helpers.ApiHelper(config, web_session)
|
||||
for i in config.devices:
|
||||
|
||||
@@ -233,7 +233,7 @@ class AddDevice(ModalWithClickExit):
|
||||
def __init__(self, config, **kwargs) -> None:
|
||||
super().__init__(**kwargs)
|
||||
self.config = config
|
||||
self.web_session = aiohttp.ClientSession(trust_env=True)
|
||||
self.web_session = aiohttp.ClientSession(trust_env=config.use_proxy)
|
||||
self.api_helper = api_helpers.ApiHelper(config, self.web_session)
|
||||
self.devices_discovered_dial = []
|
||||
|
||||
@@ -382,7 +382,7 @@ class AddChannel(ModalWithClickExit):
|
||||
def __init__(self, config, **kwargs) -> None:
|
||||
super().__init__(**kwargs)
|
||||
self.config = config
|
||||
web_session = aiohttp.ClientSession(trust_env=True)
|
||||
web_session = aiohttp.ClientSession(trust_env=config.use_proxy)
|
||||
self.api_helper = api_helpers.ApiHelper(config, web_session)
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
|
||||
Reference in New Issue
Block a user