Skip to content

fix: update api_resp req including query_hash and origin, and add filemoon provider#1691

Merged
justchokingaround merged 10 commits into
pystardust:masterfrom
justchokingaround:allanime-fix
May 1, 2026
Merged

fix: update api_resp req including query_hash and origin, and add filemoon provider#1691
justchokingaround merged 10 commits into
pystardust:masterfrom
justchokingaround:allanime-fix

Conversation

@justchokingaround

@justchokingaround justchokingaround commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Template

Type of change

  • Bug fix
  • Feature
  • Documentation update

Description

ramble here

Checklist

  • any anime playing
  • bumped version

  • next, prev and replay work
  • -c history and continue work
  • -d downloads work
  • -s syncplay works
  • -q quality works
  • -v vlc works
  • -e (select episode) aka -r (range selection) works
  • -S select index works
  • --skip ani-skip works
  • --skip-title ani-skip title argument works
  • --no-detach no detach works
  • --exit-after-play auto exit after playing works
  • --nextep-countdown countdown to next ep works
  • --dub and regular (sub) mode both work
  • all providers return links (not necessarily on a single anime, use debug mode to confirm)

  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

Additional Testcases

  • The safe bet: One Piece
  • Episode 0: Saenai Heroine no Sodatekata ♭
  • Unicode: Saenai Heroine no Sodatekata ♭
  • Non-whole episodes: Tensei shitara slime datta ken (ep. 24.5, ep. 24.9)
  • All Providers: Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e (TV) (3 m3u8, 3 mp4, 1 fast4speed, 1 sharepoint)
  • The examples of the help text

The Allanime API changed encryption on 2026-04-22.
- Base key: SimtVuagFbGR2K7P -> Xot36i3lK3:v1
  (now includes ":v1" suffix, derived via SHA-256)
- Blob format: [version:1][IV:12][ciphertext][auth_tag:16]
  (was: [IV:12][plaintext] — version byte was skipped)
- Ciphertext length: explicit ct_len = file_size - 13 - 16
  (was: read entire rest, including GCM auth tag)
- Version bump: 4.12.0 -> 4.13.0
@justchokingaround

Copy link
Copy Markdown
Collaborator Author

ig #1690 was first with the referrer fix, so maybe we can just close that pr and add him as co-author here

@Derisis13

Copy link
Copy Markdown
Collaborator

More than 650 lines... (cries quietly)

@sahil-k-george

Copy link
Copy Markdown

Do check this pull request please #justchokingaround/pull/11

@Kaukov

Kaukov commented Apr 28, 2026

Copy link
Copy Markdown

I just tested the latest diff of this PR (+65 -5) against v4.13.0 on NixOS and it works perfectly. Thank you for the fix!

@truelockmc truelockmc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, this fixes #1699 (duplicate), #1695 and #1662

@Derisis13 Derisis13 closed this Apr 28, 2026
@Derisis13

Derisis13 commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Did not work on termux, not even old stuff.
(Closure was accidental)

@Derisis13 Derisis13 reopened this Apr 28, 2026

@Derisis13 Derisis13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the unnecessary shellcheck disable statements, then you're clear for a merge. Termux not working is a casualty we can take for now, as it works on linux (I suspect referrer-free links were purged for good).

Comment thread ani-cli Outdated
Comment thread ani-cli
Comment thread ani-cli Outdated
Comment thread ani-cli
Comment thread ani-cli
@Derisis13

Copy link
Copy Markdown
Collaborator

Actually, there's another unused ignore at line 486, please remove that as well if you're at it

@Derisis13

Copy link
Copy Markdown
Collaborator

Please remove the unnecessary shellcheck disable statements, then you're clear for a merge. Termux not working is a casualty we can take for now, as it works on linux (I suspect referrer-free links were purged for good).

Actually, now that I look into it, yt is the only type of link we get. I suppose that's a problem, but may be adressable by a minor version?

emilindqvist added a commit to emilindqvist/ani-cli-hejhej that referenced this pull request Apr 29, 2026
Apply PR pystardust#1691 hunk targeting get_episode_url. AllAnime API
started returning NEED_CAPTCHA on plain POST queries. Switch
primary request to GET with persistedQuery hash and Origin
header, fall back to original POST if response lacks tobeparsed.

@Derisis13 Derisis13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still seems to be only getting Yt links, but better than nothing

@71zenith

71zenith commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Now returns sharepoint links as well making it usable on termux.

@justchokingaround justchokingaround changed the title fix: update api_resp req including query_hash and origin, and add filemoon provider fix: update api_resp req including query_hash and origin, and add filemoon provider Co-authored-by: @PlexTDM May 1, 2026
@justchokingaround justchokingaround changed the title fix: update api_resp req including query_hash and origin, and add filemoon provider Co-authored-by: @PlexTDM fix: update api_resp req including query_hash and origin, and add filemoon provider May 1, 2026
@justchokingaround justchokingaround merged commit 6803b8a into pystardust:master May 1, 2026
11 checks passed
JoaoPucci added a commit to JoaoPucci/ani-gui that referenced this pull request May 7, 2026
The SSE loading overlay (M2g) needs to pull `<provider> Links
Fetched` events out of ani-cli's stderr in real time. Two pieces
in this commit:

  - parser::parse_progress_line() — pure classifier that maps a
    single ANSI-stripped stderr line to a ProgressLine variant
    (Banner / LinksFetched { provider } / Other). Six unit tests
    pin the contract.

  - tests/anicli_progress_format.rs — a Linux-only integration
    test that runs the real vendored ani-cli through the curl
    shim and asserts the captured stderr contains at least one
    `<provider> Links Fetched` line. If upstream renames the
    suffix or drops the message, this fires before the SSE
    overlay regresses to no-progress-text.

The format comes from ani-cli's `provider_init` (one printf with
"\033[1;32m%s\033[0m Links Fetched\n"). It hasn't changed in the
script's recent history; the recent fixes (pystardust#1650/pystardust#1667/pystardust#1691) all
touched the encrypted-embed path, not the progress messages. The
drift test means we hear about it the moment it does change.

Also bumps the coverage-ratchet baseline to absorb the new code's
slightly-lower coverage; this is what broke the master CI runs at
25468226457 + 25468226471. The integration test is excluded from
llvm-cov because it spawns external ani-cli, but the parser unit
tests cover parse_progress_line at 100%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants