fix: replace anidb with hianime provider - #1897
Conversation
anidb.app is offline, so scrape hianime.at instead: the search page, the episode and server list endpoints, the HD-1 embed whose config is base64(json XOR "otaku-embed-v1"), and finally the master playlist. Builds on the scraping work in pystardust#1894. - hianime_m3u8 runs in the parent shell and sets links, sub_link, mal_id and refr, so ani-skip now runs after get_video_link with a real mal id - the stream host rejects playlists without a referer, pass it to mpv, iina, vlc, syncplay, yt-dlp and ffmpeg - subtitles come as a separate vtt, hand it to the players and save it next to downloads - hianime has no season list, so change_season searches the current title - scope the episode list to the selected slug, otherwise ids left over from the previous provider resolve to an unrelated show - cut the top 10 sidebar out of the search results - create the temp history file before backup_old_hist appends to it - bump to 5.1.0 and update readme, man page, disclaimer and hacking notes Co-authored-by: Dhairya3391 <dhairyaadroja3391@gmail.com>
|
gpt pr description |
Bro... just trust the process 😉 |
|
@U-L-M-S gpt code is nice, but I'll be real, I'm not reading the text wall that is the PR description, at that point its easier for me to read the code. To quote Jesus
|
I rewriten the PR myself I hope it's cleaerer / better to read now. I used Fable 5.1 btw fro the changes |
|
With "HD-1" set in line 213, it results in |
hianime reassigned the HD-1 label to a megaplay embed the deobfuscator cannot read, which made sub and dub both fail with no sources found.
The site lists several languages and marks the english one as default, so select by that flag instead of taking the first entry; the docs also lose the single-1080p claim now that episodes serve several resolutions.
Good catch ! Thanks ;) hianime moved "HD-1" to a different player. I siwtched it to ZokoAnime |
|
Thx @U-L-M-S, |
Swaps the dead anidb.app for hianime.at.
Credit
All the hard part — the hianime endpoints, the HD-1 embed, the XOR deobfuscation — is @Dhairya3391's from #1894. They're co-author on the commit. External
.vtthandling was @Tsagar3's idea in that thread.@port19x said #1894 was too big to review, so i redid it on master as a smaller diff (+82/−62 instead of +191/−58) and fixed what broke while testing.
Bugs I hit and fixed
No results found!never fired.--skipgot an empty MAL id — it was set in a subshell and never made it out.attack-on-titan-1offered AoT ep 6 and played One Piece ep 6, then saved that. Every one upgrading hits this on their first-c.:, VLC rewrites it tofile://). Fixed with escaped colons and:input-slave=.Cleanup
hianime_m3u8sets its variables directly instead of printing — no more temp files, no local.vtt, norm -fscattered arround.refrcomes from the embed URL instead of being hardcoded ten times. Droppedhianime_desc(hianime has no seasons block, it was returning genres), the HD-2 fallback and an unused header.Tested
shellcheck and shfmt clean. Sub, dub,
-r,-c,--skipon bash, busybox ash andbash --posix. mpv, yt-dlp and ffmpeg all play, and all 403 without the referer.Caveats
cattand iSH cant send a Referer, so they can't use this provider. Same in fix: temp-fix #1894, nothing the script can do.-qmostly falls back to best. Documented.${_response##* }is quadratic in zsh, so the episode list crawls there. Fine on a real/bin/sh.Closes #1894 if you prefer this shape, otherwise cherry-pick it there.