mirror of
https://github.com/doms9/iptv.git
synced 2026-03-08 11:28:34 +01:00
e
- edit livetvsx.py scraping
This commit is contained in:
parent
b896a22a29
commit
00000d9ab1
5 changed files with 55 additions and 26 deletions
|
|
@ -19,12 +19,17 @@ BASE_URL = "https://pixelsport.tv"
|
|||
|
||||
async def get_api_data(page: Page) -> dict[str, list[dict, str, str]]:
|
||||
try:
|
||||
await page.goto(
|
||||
resp = await page.goto(
|
||||
url := urljoin(BASE_URL, "backend/livetv/events"),
|
||||
wait_until="domcontentloaded",
|
||||
timeout=6_000,
|
||||
)
|
||||
|
||||
if resp.status != 200:
|
||||
log.warning(f"{url} status code: {resp.status}")
|
||||
|
||||
return {}
|
||||
|
||||
raw_json = await page.locator("pre").inner_text(timeout=5_000)
|
||||
except Exception as e:
|
||||
log.error(f'Failed to fetch "{url}": {e}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue