Skip to content

Kuramanime [id]: Fix extractor & Add filters#657

Open
bubz727 wants to merge 2 commits into
yuzono:masterfrom
bubz727:fix-kuramanime
Open

Kuramanime [id]: Fix extractor & Add filters#657
bubz727 wants to merge 2 commits into
yuzono:masterfrom
bubz727:fix-kuramanime

Conversation

@bubz727

@bubz727 bubz727 commented Jul 15, 2026

Copy link
Copy Markdown
  • Updated video extraction Kuramadrive and Doodstream
  • Added Status & Type filters
  • Update Base URL to v19

Checklist:

  • Updated extVersionCode value in build.gradle for individual extensions
  • Updated overrideVersionCode or baseVersionCode as needed for all multisrc extensions
  • Referenced all related issues in the PR body (e.g. "Closes #xyz")
  • Added the isNsfw = true flag in build.gradle when appropriate
  • Have not changed source names
  • Have explicitly kept the id if a source's name or language were changed
  • Have tested the modifications by compiling and running the extension through Android Studio
  • Have removed web_hi_res_512.png when adding a new extension
  • This PR is AI-assisted, I have reviewed the changes manually and confirmed they are not slop
  • Have made sure all the icons are in png format

Add a 👍 reaction to pull requests you find important.

Summary by Sourcery

Update Kuramanime extension to work with the latest site changes and improve search and playback capabilities.

New Features:

  • Add status, type, genre, and sort filters to Kuramanime search.
  • Add support for Doodstream as a video host in Kuramanime.

Bug Fixes:

  • Restore Kuramadrive and other host video extraction to match the updated Kuramanime player and authentication flow.
  • Fix popular and latest listings, details parsing, and CSRF handling to match the updated Kuramanime site structure.

Enhancements:

  • Update Kuramanime base URL to the new v19 domain.
  • Improve handling of Kuramadrive sources and generic HTML5 video sources for more robust playback.
  • Refactor script data extraction to support the new environment variable loading mechanism.

Build:

  • Bump Kuramanime extension version code and add dependency on the dood extractor library.

@sourcery-ai

sourcery-ai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the Kuramanime extension to the new v19 site structure, fixes and hardens the multi-host video extraction flow (including Kuramadrive and new Doodstream support), and adds a richer search experience with order, status, type, and genre filters, while bumping the extension version and wiring in the new extractor dependency.

Sequence diagram for Kuramanime searchAnimeRequest with new filters

sequenceDiagram
  actor User
  participant Kuramanime
  participant AnimeFilterList
  participant StatusFilter
  participant TypeFilter
  participant GenreFilter
  participant TachiyomiNetwork

  User->>Kuramanime: searchAnimeRequest(page, query, filters)
  alt query not empty
    Kuramanime->>TachiyomiNetwork: GET("$baseUrl/anime", headers)
  else query empty
    Kuramanime->>AnimeFilterList: iterate filters
    Kuramanime->>StatusFilter: toUriPart()
    Kuramanime->>TypeFilter: toUriPart()
    Kuramanime->>TypeFilter: toNamePart()
    Kuramanime->>GenreFilter: toUriPart()
    Kuramanime->>TachiyomiNetwork: GET(filteredUrl, headers)
  end
Loading

Sequence diagram for updated Kuramanime videoListParse and doodstream extraction

sequenceDiagram
  participant Kuramanime
  participant OkHttpClient
  participant DoodExtractor
  participant StreamWishExtractor
  participant FilemoonExtractor
  participant VidGuardExtractor

  Kuramanime->>Kuramanime: videoListParse(response)
  Kuramanime->>Kuramanime: getScriptData(bodyStr, doc)
  Kuramanime->>OkHttpClient: newCall(POST(episodeUrl, playerHeaders, FormBody))
  OkHttpClient-->>Kuramanime: playerDoc
  Kuramanime->>Kuramanime: select("iframe") src
  alt server == "doodstream"
    Kuramanime->>DoodExtractor: videosFromUrl(url)
  else server == "filelions"
    Kuramanime->>StreamWishExtractor: videosFromUrl(url)
  else server == "filemoon"
    Kuramanime->>FilemoonExtractor: videosFromUrl(url)
  else server == "streamwish" or "streamtape" or "vidguard"
    Kuramanime->>StreamWishExtractor: videosFromUrl(url)
    Kuramanime->>StreamTapeExtractor: videosFromUrl(url)
    Kuramanime->>VidGuardExtractor: videosFromUrl(url)
  else server == "kuramadrive" and originalKuramadriveSources not empty
    Kuramanime->>Kuramanime: return originalKuramadriveSources
  end
Loading

File-Level Changes

Change Details Files
Update base URL and list/popular/latest selectors/requests to match Kuramanime v19 layout.
  • Change baseUrl to the new v19.kuramanime.ing domain.
  • Adjust popular anime request to use order_by=popular and update its CSS selectors and title/URL extraction to the new card markup.
  • Adjust latest updates request to use order_by=latest while reusing the updated popular selectors.
  • Ensure next-page selectors target the new pagination structure.
src/id/kuramanime/src/eu/kanade/tachiyomi/animeextension/id/kuramanime/Kuramanime.kt
Add structured search filters (order, status, type, genre) and update search behavior to support both query and filter-based browsing.
  • Replace simple query-based search URL construction with a Request builder that inspects AnimeFilterList.
  • Introduce path and query routing for status (/quick/{status}), type (/properties/type/{type}?name=...), and genre (/properties/genre/{genre}) when no text query is provided.
  • Add order_by handling as an optional query parameter and always append page to the built URL.
  • Wire getFilterList() in the source to expose the new filters.
  • Create KuramanimeFilters.kt defining OrderBy, Status, Type, and Genre filters via a shared UriPartFilter helper.
src/id/kuramanime/src/eu/kanade/tachiyomi/animeextension/id/kuramanime/Kuramanime.kt
src/id/kuramanime/src/eu/kanade/tachiyomi/animeextension/id/kuramanime/KuramanimeFilters.kt
Harden episode video extraction, add Doodstream support, and adapt to new Kuramadrive/auth mechanisms.
  • Extend supported hosters list to include doodstream and import/use DoodExtractor.
  • Change videoListParse to read the raw response body string, parse with Jsoup, and use a new getScriptData(html, doc) that can derive env vars either from inline window.process or via assets JS (sizzlyb.js plus a per-page JS file).
  • Fix CSRF token extraction to read the meta content attribute instead of csrf-token and ensure request URLs include page=1 and new auth parameters.
  • Introduce originalKuramadriveSources fallback that directly uses existing
  • Switch the player fetch from GET to POST with a required authorization form body and simplified headers, then normalize iframe URLs (handling relative paths and optional /stream hop).
  • Update hoster dispatch to use the appropriate extractor for filelions, filemoon, doodstream, streamwish, streamtape, and vidguard, and add robust fallbacks for direct
  • Refactor ScriptDataDto building to parse generic key/value pairs from the env block and slightly simplify authPath concatenation.
src/id/kuramanime/src/eu/kanade/tachiyomi/animeextension/id/kuramanime/Kuramanime.kt
Bump extension version and include dood extractor dependency.
  • Increment extVersionCode from 21 to 22 for the Kuramanime extension.
  • Add implementation dependency on :lib:doodextractor in build.gradle.
src/id/kuramanime/build.gradle

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • Consider caching the ScriptDataDto result (e.g., in a lazy property) so getScriptData doesn’t re-fetch sizzlyb.js/varJs for every videoListParse call, which will reduce repeated network overhead per episode.
  • The filter-handling logic in searchAnimeRequest relies on multiple mutable variables and a when chain; you might simplify this by extracting the path-resolution and query-building into small helper functions to make the control flow easier to follow and maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider caching the `ScriptDataDto` result (e.g., in a lazy property) so `getScriptData` doesn’t re-fetch `sizzlyb.js`/`varJs` for every `videoListParse` call, which will reduce repeated network overhead per episode.
- The filter-handling logic in `searchAnimeRequest` relies on multiple mutable variables and a `when` chain; you might simplify this by extracting the path-resolution and query-building into small helper functions to make the control flow easier to follow and maintain.

## Individual Comments

### Comment 1
<location path="src/id/kuramanime/src/eu/kanade/tachiyomi/animeextension/id/kuramanime/Kuramanime.kt" line_range="248-250" />
<code_context>
+                return@parallelCatchingFlatMapBlocking originalKuramadriveSources
+            }
+
             val newHeaders = headers.newBuilder()
                 .set("X-CSRF-TOKEN", csrfToken)
                 .set("X-Fuck-ID", scriptData.tokenId)
</code_context>
<issue_to_address>
**issue (bug_risk):** The newly built headers (including X-Fuck-ID) are never used when performing the request.

`newHeaders` is built with `X-CSRF-TOKEN`, `X-Fuck-ID`, and `X-Requested-With`, but the request still uses `playerHeaders`, which only includes `X-CSRF-TOKEN`. If the backend relies on `X-Fuck-ID`/`X-Requested-With`, relevant streams may fail. Please either use `newHeaders` for the POST or consolidate the header construction so all required headers are sent.
</issue_to_address>

### Comment 2
<location path="src/id/kuramanime/src/eu/kanade/tachiyomi/animeextension/id/kuramanime/Kuramanime.kt" line_range="321-330" />
<code_context>
+    private fun getScriptData(html: String, doc: Document): ScriptDataDto? {
</code_context>
<issue_to_address>
**issue (bug_risk):** getScriptData now performs multiple network calls without failure handling, which can break video parsing on transient errors.

The previous implementation used `runCatching` and returned `null` on failures so `videoListParse` could fall back to an empty list. The new version performs multiple HTTP requests (e.g., `sizzlyb.js`, attribute-based script) without handling exceptions, so any IO error may now propagate and break playback. Please reintroduce failure handling around the network calls (e.g., `runCatching` returning `null` or similar) to preserve the earlier, more resilient behavior.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant