wolfswolke / aniworld_scraper

Aniworld.to mp4 scraper for animes.
MIT License
49 stars 16 forks source link

Get VOE hls. #39

Closed 3vil3vo closed 3 months ago

3vil3vo commented 4 months ago

An example of getting the hls from VOE:

import asyncio
from pyppeteer import launch

redirectLink = "/redirect/2209559"

async def printCacheUrl(cacheLink):
    siteUrl = "https://aniworld.to"
    imageSelector = 'img[src="/s/images/logos/voe-logo-2.svg"]'

    browser = await launch()
    page = await browser.newPage()

    await page.goto(siteUrl + cacheLink)
    await page.waitForSelector(imageSelector)
    await page.click(imageSelector)

    htmlPage = await page.content()

    cacheUrlPattern = r"https:\/\/delivery-node[^'\"']+master\.m3u8"
    cacheUrl = re.search(cacheUrlPattern, htmlPage).group(0)

    print("Cache URL is:", cacheUrl)

    await browser.close()

asyncio.get_event_loop().run_until_complete(printCacheUrl(redirectLink))
wolfswolke commented 4 months ago

Thank you. I will take a look at how to implement this code today or tomorrow if I have time.

3vil3vo commented 4 months ago

Glad it helps (=

3vil3vo commented 4 months ago

Edit: Voe changed again. I think the old code should work again.

wolfswolke commented 4 months ago

i don't understand VOE... I will just make a logic that if VOE fails it uses a different provider. Because if they bring back the old logic (Generate Node URL on site load with java) it would fail again

wolfswolke commented 3 months ago

Noted if they bring back the old logic some day.