-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnimePahe started providing fake kwik links in the api response #10
Comments
I'm not sure how to handle this one but it might be that some header is required or something. I've checked but I honestly don't know, I believe the extractor is still fine but as you've stated, it's being given a fake link. |
@ngomile Maybe doing something to bypass adfly or shst links would work.. |
I got this error on
is this issue on my system or with code? |
@ngomile looks like you can refer here: |
@newaccforhc |
Oh no.. I'm not talking about m3u8. |
So I was doing a little experimenting trying to get this working again like it was, I haven't looked deeply into the link @newaccforhc provided. I'll do that soon though seeing as how what I came up with is inefficient and uses way too much data and CPU. Essentially, I tried to use puppeteer-core to get the link from adfly. Starts too many Chrome processes and is too slow. For the curious souls the code looked like this: async function getRealKwikLink(url) {
const BLOCKED_RESOURCES_REG = /ads|inpagepush|css|facebook|analytics|cloud|png|hcaptcha|gif/;
let kwikURL = '';
let browser;
try {
browser = await puppeteer.launch({
executablePath: browserExecutablePath,
});
const page = await browser.newPage();
page.setRequestInterception(true);
page.on('request', request => {
if (BLOCKED_RESOURCES_REG.test(request.url())) {
request.abort();
} else {
request.continue();
}
});
await page.goto(url, { waitUntil: 'networkidle2' });
await page.waitForSelector('#skip_bu2tton', { visible: true });
kwikURL = await page.evaluate(
'(() => document.querySelector("#skip_bu2tton").getAttribute("href"))()'
);
} catch (error) {
console.error(error);
} finally {
await browser.close();
}
return kwikURL;
} But it actually worked as shown below after entering this command Just way too slow, this will be sorted out eventually... maybe. |
@IshigamiYuu animepahe isn't working at the moment. |
The "kwik" links aren't fake. Kwik has a "DRM" system (really not a DRM but since you're having issues with it, we're going to act like it is one). I'm not familiar with Node so I'll just drop you the method to get valid stream url(s) from AnimePahe. First, make an API call to get the "kwik" URL. Then, make a GET request to that URL with "https://animepahe.com/" as the referer (referer in headers). This now allows you to access the site for further extraction. Now, you need to extract the m3u8 URL. There should be some tools in Node that allows JS evaluation but for a faster approach, use regex, here's the algorithm to extract "kwik" m3u8. To stream/download the m3u8 is also quite troublesome due to the above mentioned "DRM" system, hence, you need to use the "kwik" url (not https://kwik.cx but the url from which you extracted the m3u8) as the referer in the download header. Then, you should be able to stream/download from AnimePahe. This is also the reason why web browsers are failing to stream even from the official AnimePahe site. Good luck! |
name: "🐞 Bug report"
about: Report a bug
title: "[Bug] AnimePahe started providing fake kwik links in the api response"
labels: "bug"
Describe the bug
AnimePahe started providing fake kwik links in the api response (those links go to 404). So, downloads from Animepahe aren't working. Now you need to go through adfly link before getting the real kwik link.Command You Entered
Expected behavior
Should give direct download links.
Actual behavior
Threw an error.
Other details
Maybe some adfly bypassing method can help to resolve this.
On a positive note, they removed captcha to open kwik links now. So, cheers!
The text was updated successfully, but these errors were encountered: