e
This commit is contained in:
parent
5a61e2a8d5
commit
00000d9db0
11 changed files with 809 additions and 162 deletions
|
|
@ -66,11 +66,11 @@ async def get_m3u8_links(client: httpx.AsyncClient, url: str) -> list[str]:
|
|||
|
||||
html = re.sub(r"<!--.*?-->", "", r.text, flags=re.DOTALL)
|
||||
|
||||
tree = HTMLParser(html)
|
||||
soup = HTMLParser(html)
|
||||
|
||||
m3u8_links = []
|
||||
|
||||
for btn in tree.css("button[onclick]"):
|
||||
for btn in soup.css("button[onclick]"):
|
||||
onclick = btn.attributes.get("onclick", "")
|
||||
|
||||
if match := re.search(r"src\s*=\s*['\"](.*?)['\"]", onclick):
|
||||
|
|
@ -79,7 +79,7 @@ async def get_m3u8_links(client: httpx.AsyncClient, url: str) -> list[str]:
|
|||
if ".m3u8" in link:
|
||||
m3u8_links.append(link)
|
||||
|
||||
if iframe := tree.css_first("iframe#iframe"):
|
||||
if iframe := soup.css_first("iframe#iframe"):
|
||||
src = iframe.attributes.get("src", "")
|
||||
|
||||
if ".m3u8" in src and src not in m3u8_links:
|
||||
|
|
@ -91,7 +91,7 @@ async def get_m3u8_links(client: httpx.AsyncClient, url: str) -> list[str]:
|
|||
return m3u8_links
|
||||
|
||||
|
||||
async def main(client: httpx.AsyncClient) -> None:
|
||||
async def scrape(client: httpx.AsyncClient) -> None:
|
||||
if not (base_url := await get_base(client, MIRRORS)):
|
||||
log.warning("No working ace mirrors")
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue