This commit is contained in:
doms9 2025-10-30 15:38:34 -04:00
parent 566f5c2c80
commit 00000d980a
12 changed files with 337 additions and 547 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import asyncio
import re
from pathlib import Path
from scrapers import (
@ -30,7 +31,9 @@ def load_base() -> tuple[list[str], int]:
data = BASE_FILE.read_text(encoding="utf-8")
last_chnl_num = int(data.split("tvg-chno=")[-1].split('"')[1])
pattern = re.compile(r'tvg-chno="(\d+)"')
last_chnl_num = max(map(int, pattern.findall(data)), default=0)
return data.splitlines(), last_chnl_num
@ -113,3 +116,8 @@ async def main() -> None:
if __name__ == "__main__":
asyncio.run(main())
try:
asyncio.run(network.client.aclose())
except Exception:
pass