AnimeVerse [EN]: Extension Overhaul#584
Conversation
Reviewer's GuideRefactors AnimeVerse’s auth, utilities, catalog/search logic, and streaming extractors into separate helpers, adds disk-based catalog/schedule caching and richer search filters, simplifies video host handling to AnimeVerse + MegaPlay only, and bumps the extension version. Sequence diagram for AnimeVerse auth interceptor flowsequenceDiagram
participant Client
participant OkHttpClient
participant AnimeVerseAuth
participant AnimeVerseAPI
Client->>OkHttpClient: newCall(request)
OkHttpClient->>AnimeVerseAuth: authInterceptor(chain, networkClient, fingerprint)
AnimeVerseAuth->>AnimeVerseAuth: sign(request, networkClient, fingerprint)
AnimeVerseAuth->>AnimeVerseAuth: getAuth(networkClient, fingerprint)
alt [no valid authKey]
AnimeVerseAuth->>AnimeVerseAPI: POST /api/v1/session
AnimeVerseAPI-->>AnimeVerseAuth: session response (clientAuthKey, av_session)
AnimeVerseAuth->>AnimeVerseAuth: update authKey, authExpires, sessionCookie
end
AnimeVerseAuth-->>OkHttpClient: signed Request
OkHttpClient->>AnimeVerseAPI: proceed(signed Request)
AnimeVerseAPI-->>OkHttpClient: Response
alt [Response.code == 401]
OkHttpClient->>AnimeVerseAuth: invalidateAuth()
OkHttpClient->>AnimeVerseAuth: sign(original Request, networkClient, fingerprint)
AnimeVerseAuth-->>OkHttpClient: re-signed Request
OkHttpClient->>AnimeVerseAPI: proceed(re-signed Request)
AnimeVerseAPI-->>OkHttpClient: Response
end
OkHttpClient-->>Client: Response
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- There are now multiple
Jsoninstances and JSON helper extensions declared acrossAnimeVerse.kt,AnimeVerseAuth.kt,AnimeVerseExtractors.kt, andAnimeVerseUtils.kt; consider centralizing these into a single shared utility to avoid configuration drift and duplication. - The new
getSearchAnimeimplementation mixes query parsing, filter evaluation, schedule handling, and catalog matching in a single method; splitting this into smaller helpers (e.g., for building predicates, applying filters, and mapping toSAnime) would make the logic easier to read and maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There are now multiple `Json` instances and JSON helper extensions declared across `AnimeVerse.kt`, `AnimeVerseAuth.kt`, `AnimeVerseExtractors.kt`, and `AnimeVerseUtils.kt`; consider centralizing these into a single shared utility to avoid configuration drift and duplication.
- The new `getSearchAnime` implementation mixes query parsing, filter evaluation, schedule handling, and catalog matching in a single method; splitting this into smaller helpers (e.g., for building predicates, applying filters, and mapping to `SAnime`) would make the logic easier to read and maintain.
## Individual Comments
### Comment 1
<location path="src/en/animeverse/src/eu/kanade/tachiyomi/animeextension/en/animeverse/AnimeVerseAuth.kt" line_range="36-38" />
<code_context>
-
- val body = """{"fp":$fingerprint}""".toJsonBody()
-
- val sessionReq = Request.Builder()
- .url("$baseUrl/api/v1/session")
- .post(body)
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Avoid hardcoding the base URL in auth to keep it consistent with the source baseUrl
Hardcoding `https://animeverse.to/api/v1/session` means auth won’t follow any future changes to `baseUrl` (mirrors, regional domains, config overrides), while other requests will. Please derive the auth URL from `baseUrl` (or a shared constant), e.g. `"$baseUrl/api/v1/session"`, so it stays consistent.
```suggestion
val sessionReq = Request.Builder()
.url("$baseUrl/api/v1/session")
.post(body)
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request refactors the AnimeVerse extension by extracting authentication, video extraction, and utility functions into separate files, implementing a disk-based caching mechanism for catalogs and schedules, and adding advanced search filters. The review feedback focuses on critical resource safety and performance optimizations, such as wrapping network responses in .use blocks to prevent connection leaks, caching file modification times in memory to avoid redundant disk I/O, and avoiding unnecessary file reads. Additionally, the reviewer recommends decoupling the codebase from hardcoded domains by passing baseUrl dynamically to utility and authentication functions, and correcting method calls to match updated signatures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Checklist:
extVersionCodevalue inbuild.gradlefor individual extensionsoverrideVersionCodeorbaseVersionCodeas needed for all multisrc extensionsisNsfw = trueflag inbuild.gradlewhen appropriateidif a source's name or language were changedweb_hi_res_512.pngwhen adding a new extensionAdd a 👍 reaction to pull requests you find important.
Summary by Sourcery
Refactor the AnimeVerse extension to use shared auth and utility helpers, add catalog-based caching and richer search/filter capabilities, and simplify supported streaming servers while bumping the extension version.
New Features:
Bug Fixes:
Enhancements:
Build: