mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-17 13:08:57 +03:00
Compare commits
4 Commits
v2.5.2
...
watchdog-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30cac71820 | ||
|
|
f2155abad3 | ||
|
|
edbea793ed | ||
|
|
df629805c2 |
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "iSponsorBlockTV"
|
||||
version = "2.5.2"
|
||||
version = "2.5.3"
|
||||
authors = [
|
||||
{"name" = "dmunozv04"}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import asyncio
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
from typing import Any, List
|
||||
|
||||
import pyytlounge
|
||||
@@ -50,12 +51,12 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
|
||||
it cancels the current subscription.
|
||||
"""
|
||||
self.watchdog_running = True
|
||||
self.last_event_time = asyncio.get_event_loop().time()
|
||||
self.last_event_time = time.time()
|
||||
|
||||
try:
|
||||
while self.watchdog_running:
|
||||
await asyncio.sleep(10)
|
||||
current_time = asyncio.get_event_loop().time()
|
||||
current_time = time.time()
|
||||
time_since_last_event = current_time - self.last_event_time
|
||||
|
||||
# YouTube sends a message at least every 30 seconds
|
||||
@@ -105,7 +106,7 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
|
||||
def _process_event(self, event_type: str, args: List[Any]):
|
||||
self.logger.debug(f"process_event({event_type}, {args})")
|
||||
# Update last event time for the watchdog
|
||||
self.last_event_time = asyncio.get_event_loop().time()
|
||||
self.last_event_time = time.time()
|
||||
|
||||
# A bunch of events useful to detect ads playing,
|
||||
# and the next video before it starts playing
|
||||
@@ -260,13 +261,12 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
|
||||
raise NotLinkedException("Not linked")
|
||||
|
||||
connect_body = {
|
||||
"id": str(uuid4()),
|
||||
"id": self.auth.screen_id,
|
||||
"mdx-version": "3",
|
||||
"TYPE": "xmlhttp",
|
||||
"theme": "cl",
|
||||
"sessionSource": "MDX_SESSION_SOURCE_UNKNOWN",
|
||||
"connectParams": '{"setStatesParams": "{"playbackSpeed":0}"}',
|
||||
"sessionNonce": str(uuid4()),
|
||||
"RID": "1",
|
||||
"CVER": "1",
|
||||
"capabilities": "que,dsdtr,atp,vsp",
|
||||
|
||||
Reference in New Issue
Block a user