[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2025-05-28 21:48:24 +00:00
parent fd6f0d7283
commit 98c1211b09

View File

@@ -265,7 +265,7 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
"TYPE": "xmlhttp",
"theme": "cl",
"sessionSource": "MDX_SESSION_SOURCE_UNKNOWN",
"connectParams": "{\"setStatesParams\": \"{\"playbackSpeed\":0}\"}",
"connectParams": '{"setStatesParams": "{"playbackSpeed":0}"}',
"sessionNonce": str(uuid4()),
"RID": "1",
"CVER": "1",
@@ -278,9 +278,7 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
"device": "REMOTE_CONTROL",
"name": self.device_name,
}
connect_url = (
f"{api_base}/bc/bind"
)
connect_url = f"{api_base}/bc/bind"
async with self.session.post(url=connect_url, data=connect_body) as resp:
try:
text = await resp.text()
@@ -290,13 +288,11 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
"Connection denied, attempting to circumvent the issue"
)
await self.connect_as_screen()
#self._lounge_token_expired()
# self._lounge_token_expired()
return False
if resp.status != 200:
self._logger.warning(
"Unknown reply to connect %i %s", resp.status, resp.reason
)
self._logger.warning("Unknown reply to connect %i %s", resp.status, resp.reason)
return False
lines = text.splitlines()
async for events in self._parse_event_chunks(as_aiter(lines)):
@@ -322,7 +318,7 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
"TYPE": "xmlhttp",
"theme": "cl",
"sessionSource": "MDX_SESSION_SOURCE_UNKNOWN",
"connectParams": "{\"setStatesParams\": \"{\"playbackSpeed\":0}\"}",
"connectParams": '{"setStatesParams": "{"playbackSpeed":0}"}',
"sessionNonce": str(uuid4()),
"RID": "1",
"CVER": "1",
@@ -335,13 +331,13 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
"device": "LOUNGE_SCREEN",
"name": self.device_name,
}
connect_url = (
f"{api_base}/bc/bind"
)
connect_url = f"{api_base}/bc/bind"
async with self.session.post(url=connect_url, data=connect_body) as resp:
try:
await resp.text()
self.logger.error("Connected as screen: please force close the app on the device for iSponsorBlockTV to work properly")
self.logger.error(
"Connected as screen: please force close the app on the device for iSponsorBlockTV to work properly"
)
self.logger.warn("Exiting in 5 seconds")
await asyncio.sleep(5)
sys.exit(0)