ani-cli suddenly stopped working.
Metadata (please complete the following information)
Version:
❯ ani-cli -V 4.11.0
OS: Linux 6.19.12-1-cachyos
Shell: bash
Anime: All
Describe the bug
❯ ani-cli -c
Specified quality not found, defaulting to best
Episode is released, but no valid sources!
❯ ani-cli kumo desu ka nani ka
Specified quality not found, defaulting to best
Episode is released, but no valid sources!
Steps To Reproduce
-
Run
ani-cli -c -
Choose any anime
-
Run 'ani-cli whatever-anime'
-
Choose any episode
Expected behavior Should get the episode into MPV player
Additional context
It stopped working today, as soon as I woke up.
Confirmed same issue on Bazzite and Termux
Checking website, the videos play fine.
I ran the steps and I still cant get it to work, I tried uninstalling and then reinstalling, but ive had it updated to v.11 for a while. Im on linux
experiencing the same problem on windows
Experiencing the exact same issue on MacOS with MPV as of today, I cannot get anything to play, I receive "Episode is released, but no valid sources!" on everything I tried.
allanime apis are currently down/not reachable, this is what the program uses to fetch the episode
https://cdn.allanime.day/all/manga/a10191a.js
specifically this part: ait y(e,{method:"POST",body:JSON.stringify(data)},t)}async function O(e,t){try{if(!e||!e.data)return;let n;const r=JSON.parse(e.data);return n="anbbpo".split("").reverse().join(""),r.data&&r.data.tobeparsed&&t.isClient&&(r.data=await Object(l.a)(r.data.tobeparsed)),r}catch(t){console.error("err parse api Result",t,e)}}function j(e,t){if(t){try{e=JSON.stringify(e)}catch(e){console.error("error json Encode",e)}return e}return encodeURIComponent(e)}async function C({query:e,variables:t,key:n,noCache:r,cacheTime:o,withAuth:l,noAuth:d},f=h,m,y,C){let k=function(e){return Object(c.a)(e)}(e);n=n+"-"+(t=j(t,!0));let _=!m,S=j({persistedQuery:{versio ofc this is just a snippet read shi yourself :sob:
The failure was happening because the episode GraphQL call is no longer always returning plain JSON
Im also having this issue
The same thing happened to me. Already tested it on my PC and Android.
https://cdn.allanime.day/all/manga/a10191a.js
specifically this part:
ait y(e,{method:"POST",body:JSON.stringify(data)},t)}async function O(e,t){try{if(!e||!e.data)return;let n;const r=JSON.parse(e.data);return n="anbbpo".split("").reverse().join(""),r.data&&r.data.tobeparsed&&t.isClient&&(r.data=await Object(l.a)(r.data.tobeparsed)),r}catch(t){console.error("err parse api Result",t,e)}}function j(e,t){if(t){try{e=JSON.stringify(e)}catch(e){console.error("error json Encode",e)}return e}return encodeURIComponent(e)}async function C({query:e,variables:t,key:n,noCache:r,cacheTime:o,withAuth:l,noAuth:d},f=h,m,y,C){let k=function(e){return Object(c.a)(e)}(e);n=n+"-"+(t=j(t,!0));let _=!m,S=j({persistedQuery:{versioofc this is just a snippet read shi yourself 😭The failure was happening because the episode GraphQL call is no longer always returning plain JSON
Thanks for sharing the JS bundle. After looking at it (and doing some unminification), I managed to get the AllAnime provider working again in my project that also uses this API.
What changed:
AllAnime now encrypts GraphQL responses for episode data). Instead of plain JSON, they return a tobeparsed field with base64 encrypted data.Fix: Add decryption for the tobeparsed field using AES-256-GCM.
Secret key: "anbbpo" reversed, then SHA-256 hashed.
Base64 format: first 12 bytes = IV, last 16 bytes = auth tag, middle = ciphertext.
After every axios.post to the AllAnime API, check if tobeparsed exists, decrypt it, and overwrite the data with the decrypted result.
This matches the exact client-side decryption logic found in their JS bundle: https://cdn.allanime.day/all/manga/a10191a.js
Episode fetching is now working again. For now....
so is the issue has bee fixed or not
should be fixed in https://github.com/pystardust/ani-cli/pull/1650
Thanks! It's working!
how to fix it please do tell
@razrab1337 can you help me fix this?
@Blackgamingz
If you're on a Unix base OS you can clone the specific branch with the fix. I personally use Mac, so I know the Mac commands here work 100%. Not fully sure on linux commands, but they should function.
First remove the old version. Mac: rm "$(brew --prefix)/bin/ani-cli" Linux: sudo rm "/usr/local/bin/ani-cli"
Then to clone the branch with JustChokingAround's fix. Mac: git clone "https://github.com/justchokingaround/ani-cli.git" -b "allanime-fix" && cd ./ani-cli cp ./ani-cli "$(brew --prefix)"/bin cd .. && rm -rf ./ani-cli
Linux: git clone "https://github.com/justchokingaround/ani-cli.git" -b "allanime-fix" sudo cp ani-cli/ani-cli /usr/local/bin rm -rf ani-cli
How to fix in iphone ISH app?
Run this in terminal to fix it. It will say: version 4.12.0 if it worked
git clone -b allanime-fix https://github.com/justchokingaround/ani-cli.git ani-cli-fix
sudo install -m 755 ./ani-cli-fix/ani-cli "$(which ani-cli)"
hash -r
ani-cli --version
This is what it said after pasting the script into iSH, it apparently went to version 4.11.0:
localhost:~# git clone -b allanime-fix https://git hub.com/justchokingaround/ani-cli.git ani-cli-fix fatal: destination path 'ani-cli-fix' already exists and is not an empty directory. localhost:~# sudo install -m 755 ./ani-cli-fix/ani -cli "$(which ani-cli)" -ash: sudo: not found localhost:~# hash -r localhost:~# ani-cli --version 4.11.0
I tested to see if it worked again by inputing ani-cli konosuba but it still says episode released but no valid sources
@Chesetr
You should be able to run these commands on iOS ISH to have the branch fix installed: git clone "https://github.com/justchokingaround/ani-cli.git" -b "allanime-fix" ~/.ani-cli cp ~/.ani-cli/ani-cli /usr/local/bin/ani-cli chmod +x /usr/local/bin/ani-cli rm -rf ~/.ani-cli
Finally, an "ani-cli -V" should return "4.12.0"
edit: Tested on my iPhone 16, this installed and returned the correct version number.
Android with Termux:
Make sure you've installed git and openssl-tools
pkg install git openssl-tools
git clone "https://github.com/justchokingaround/ani-cli.git" -b "allanime-fix"
cp ani-cli/ani-cli /data/data/com.termux/files/usr/bin/ani-cli
rm -rf ani-cli