Merge pull request #241 from dmunozv04/aiohttp-3.11-support

Aiohttp-3.11-support
This commit is contained in:
David
2025-02-12 12:00:42 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ def main(config, debug):
if debug:
loop.set_debug(True)
asyncio.set_event_loop(loop)
tcp_connector = aiohttp.TCPConnector(ttl_dns_cache=300)
tcp_connector = aiohttp.TCPConnector(loop=loop, ttl_dns_cache=300)
web_session = aiohttp.ClientSession(loop=loop, connector=tcp_connector)
api_helper = api_helpers.ApiHelper(config, web_session)
for i in config.devices:

View File

@@ -20,6 +20,9 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
):
super().__init__("iSponsorBlockTV", logger=logger)
if web_session is not None:
loop = asyncio.get_event_loop()
loop.run_until_complete(self.session.close())
loop.run_until_complete(self.conn.close())
self.session = web_session # And use the one we passed
self.auth.screen_id = screen_id
self.auth.lounge_id_token = None