ani-cli icon indicating copy to clipboard operation
ani-cli copied to clipboard

Error: Episode not found, reason: CF_Captcha implementation

Open JoshBot-Debug opened this issue 7 months ago • 17 comments

Make sure you are on the latest version by running ani-cli -U

Metadata (please complete the following information) Version: 4.13.0 OS: Ubuntu 22.04 Shell: bash Anime: All

Describe the bug A POST request to https://api.allanime.day/api returns the error saying "NEED_CAPTCHA". A GET request is blocked by cf A request from the browser is blocked by access control allow origin header

Is this the end of ani-cli? 😢

JoshBot-Debug avatar Apr 27 '26 01:04 JoshBot-Debug

Can confirm the same on Windows 11 too:

Image

sahil-k-george avatar Apr 27 '26 01:04 sahil-k-george

can confirm error on mac (homebrew) too :

Image

Hzryz avatar Apr 27 '26 01:04 Hzryz

Okay, I think it's the end, can't find any way around this. If ani-cli ends, I'll stop watching anime till we get an actual official website with all anime sub & dub. I'm ready to pay if the source is at least as good as ani-cli.

The "tobeparsed" update was a ridicules way to block us, but it was a clear sign that they noticed the traffic from unknown sources.

The cf block on GET requests was much better. Now they blocked all requests with a CAPTURE.

allanime is no longer a source. We'll have to find new ones or archive. At this point, we're only helping them improve their API security. Perhaps, we should make a headless chromium scraper.

JoshBot-Debug avatar Apr 27 '26 02:04 JoshBot-Debug

I posted a detailed debug on the closed issue... one of my ideas was to use curl-impersonate (drops in for curl, mimics browser TLS fingerprint). i have not tested this

OhNoIBrokeIt avatar Apr 27 '26 02:04 OhNoIBrokeIt

I posted a detailed debug on the closed issue... one of my ideas was to use curl-impersonate (drops in for curl, mimics browser TLS fingerprint). i have not tested this

They are using cf, it requires javascript to execute. Spoofing the domain alone is not enough, if all their requests come from a set of trusted IP addresses, then we'd have to spoof that too because eventually they'll just switch to SSR. We're just playing cat and mouse with them

JoshBot-Debug avatar Apr 27 '26 02:04 JoshBot-Debug

I posted a detailed debug on the closed issue... one of my ideas was to use curl-impersonate (drops in for curl, mimics browser TLS fingerprint). i have not tested this

They are using cf, it requires javascript to execute. Spoofing the domain alone is not enough, if all their requests come from a set of trusted IP addresses, then we'd have to spoof that too because eventually they'll just switch to SSR. We're just playing cat and mouse with them

Agreed. Even if you keep finding workarounds, the downtime between each break and fix is the real problem. It's not sustainable to depend on a source that's actively trying to block scrapers.

OhNoIBrokeIt avatar Apr 27 '26 02:04 OhNoIBrokeIt

I posted a detailed debug on the closed issue... one of my ideas was to use curl-impersonate (drops in for curl, mimics browser TLS fingerprint). i have not tested this

I really like this idea btw, writing an application like that might be a fun adventure

JoshBot-Debug avatar Apr 27 '26 02:04 JoshBot-Debug

I posted a detailed debug on the closed issue... one of my ideas was to use curl-impersonate (drops in for curl, mimics browser TLS fingerprint). i have not tested this

I really like this idea btw, writing an application like that might be a fun adventure

I was actually going to test it — I ran into something similar building an app where the target was fingerprinting TLS clients and spoofing the handshake was sufficient to get through. Would have been a fun one to dig into.

OhNoIBrokeIt avatar Apr 27 '26 02:04 OhNoIBrokeIt

if they are so into getting us out of here, won't it be easy for them to just come here and look at the code and out plans ?

Hollaksz avatar Apr 27 '26 03:04 Hollaksz

if they are so into getting us out of here, won't it be easy for them to just come here and look at the code and out plans ?

Yeah obviously, they know this repository exists, it's public

JoshBot-Debug avatar Apr 27 '26 03:04 JoshBot-Debug

@JoshBot-Debug If possible, please rename the issue (something like: Error: Episode not found, reason: CF_Captcha implementation), as people are thinking this as a separate issue and creating duplicating ones

sahil-k-george avatar Apr 27 '26 04:04 sahil-k-george

i guess its time to switch sources then?

Quicksilver151 avatar Apr 27 '26 06:04 Quicksilver151

It might be, I was trying some workarounds like rather than the script sending request to https://api.allanime.day/api, crafting a fetch code to be executed in the F12 console, something like this

 fetch("https://api.allanime.day/api", {
  method: "POST",
  credentials: "include",

  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "variables": {
    "showId": "inBARBpQC24H7Z6bE",
    "translationType": "sub",
    "episodeString": "2"
  },
  "query": "query ($showId: String!, $translationType: VaildTranslationTypeEnumType!, $episodeString: String!) { episode( showId: $showId translationType: $translationType episodeString: $episodeString ) { episodeString sourceUrls }}"
})
})
.then(res => res.json())
.then(data => {
  const text = JSON.stringify(data);
  console.log(text);
  navigator.clipboard.writeText(text);
});

(the showID and other data are generated by the original script itself.) And I hoped I could pass the output to the script to play the file. But instead, I am met with this

{"errors":[{"message":"NEED_CAPTCHA","locations":[{"line":1,"column":102}],"path":["episode"],"extensions":{"code":"INTERNAL_SERVER_ERROR"}}],"data":{"episode":null}}

Which basically means either my idea will not work at all, or, there are stuff that I need to do more to make this work

sahil-k-george avatar Apr 27 '26 07:04 sahil-k-george

Changing the allanime_refr variable in the script to https://youtu-chan.com solved the issue for me on both Termux and NixOS. That info comes from a comment under a recently opened anipy-cli issue.

memreflect avatar Apr 27 '26 09:04 memreflect

youtu-chan.com

can vouch for it, it works

KitsuneKode avatar Apr 27 '26 10:04 KitsuneKode

We can close this issue. Please check https://github.com/sdaqo/anipy-cli/issues/315#issuecomment-4323792726 for the fix. The team will make a pull request when they have time.

JoshBot-Debug avatar Apr 27 '26 10:04 JoshBot-Debug

Refer #1692

sahil-k-george avatar Apr 27 '26 11:04 sahil-k-george