Skip to content

Add source: OtakusTV [ES]#553

Open
RikCost wants to merge 6 commits into
yuzono:masterfrom
RikCost:otakustv
Open

Add source: OtakusTV [ES]#553
RikCost wants to merge 6 commits into
yuzono:masterfrom
RikCost:otakustv

Conversation

@RikCost

@RikCost RikCost commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Close #545

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

Add a new Spanish OtakusTV streaming source extension with support for popular, latest, search, details, episodes, and video extraction.

New Features:

  • Introduce the OtakusTV Spanish anime streaming source implementation, including popular, latest updates, search, details, episode listing, and video playback support.

Enhancements:

  • Implement a WebView‑based server extractor to decode and collect encrypted embed URLs from OtakusTV episode pages.
  • Wire the new OtakusTV extension into the build with its required host extractor library dependencies.

@sourcery-ai

sourcery-ai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a new Spanish anime extension for OtakusTV, including a custom ParsedAnimeHttpSource implementation, a WebView-based server extractor to decode encrypted embed URLs, and the corresponding Gradle module configuration with necessary extractor library dependencies.

Sequence diagram for OtakusTV video resolution flow

sequenceDiagram
    participant AnimeApp
    participant OtakusTV
    participant OtakusTvServerExtractor
    participant StreamWishExtractor

    AnimeApp->>OtakusTV: getVideoList(episode)
    OtakusTV->>OtakusTvServerExtractor: getEmbedUrls(episode.absoluteUrl, headers)
    OtakusTvServerExtractor-->>OtakusTV: List<String> embedUrls

    OtakusTV->>OtakusTV: parallelCatchingFlatMap(serverVideoResolver)
    loop for each embedUrl
        OtakusTV->>OtakusTV: serverVideoResolver(url)
        alt url contains streamwish host
            OtakusTV->>StreamWishExtractor: videosFromUrl(url, StreamWish)
            StreamWishExtractor-->>OtakusTV: List<Video>
        else other host
            OtakusTV->>OtakusTV: universalExtractor.videosFromUrl(url, headers)
        end
    end

    OtakusTV-->>AnimeApp: List<Video>
Loading

File-Level Changes

Change Details Files
Introduce OtakusTV ParsedAnimeHttpSource implementation for listing, searching, and fetching anime, episodes, and videos.
  • Implement popular, latest, and search requests/selectors reusing shared card parsing logic.
  • Parse detailed anime metadata including title cleanup, thumbnail, description, genres, and status mapping from site-specific markup.
  • Build episode list by filtering /ver/ links to match the current anime slug and converting episode suffixes (including decimals) into episode numbers.
  • Resolve video streams using multiple host-specific extractor libraries and a universal fallback, dispatching based on embed URL patterns.
  • Override unused ParsedAnimeHttpSource selectors/parsers with UnsupportedOperationException and add helper regex-based title/label cleaning.
src/es/otakustv/src/eu/kanade/tachiyomi/animeextension/es/otakustv/OtakusTV.kt
Add WebView-based server extractor to decode encrypted server embed URLs from OtakusTV watch pages.
  • Instantiate an Android WebView on the main thread with JavaScript and storage enabled, loading the watch page with forwarded headers.
  • Periodically evaluate injected JavaScript that hex-decodes encrypt attributes from DOM elements into embed URLs, with retry and timeout logic.
  • Synchronize the async WebView extraction using CountDownLatch and clean up the WebView after completion.
  • Return a de-duplicated list of absolute embed URLs split from the JS result string.
src/es/otakustv/src/eu/kanade/tachiyomi/animeextension/es/otakustv/OtakusTvServerExtractor.kt
Configure Gradle module for the new OtakusTV extension and declare extractor dependencies.
  • Declare extension metadata (name, main class, version code) and apply the legacy extension plugin.
  • Add implementation dependencies for all required host extractor libraries (StreamWish, Dood, Voe, Uqload, Mp4upload, MixDrop, Lulu, Universal).
src/es/otakustv/build.gradle

Assessment against linked issues

Issue Objective Addressed Explanation
#545 Add a new anime source extension for OtakusTV with Spanish language support, including browsing, search, details, episodes, and video extraction.
#545 Mark the OtakusTV source as NSFW/18+ in the extension configuration (e.g., via isNsfw = true in build.gradle). The new src/es/otakustv/build.gradle file does not include an isNsfw = true flag, and the PR checklist item for adding this flag is left unchecked.

Possibly linked issues


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 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/es/otakustv/src/eu/kanade/tachiyomi/animeextension/es/otakustv/OtakusTV.kt" line_range="111-112" />
<code_context>
+    override fun searchAnimeNextPageSelector(): String = popularAnimeNextPageSelector()
+
+    private fun animeFromElement(element: Element): SAnime = SAnime.create().apply {
+        val link = element.selectFirst("a[href*=/anime/]") ?: element.selectFirst("a")!!
+        setUrlWithoutDomain(link.attr("abs:href"))
+        val img = element.selectFirst("img")
+        title = img?.attr("alt").orEmpty()
</code_context>
<issue_to_address>
**issue (bug_risk):** Using `abs:href` with `setUrlWithoutDomain` can create malformed requests.

`setUrlWithoutDomain` is intended to store a relative path that later gets prefixed with `baseUrl`. Passing a fully qualified `abs:href` risks producing URLs like `https://www.otakustv.nethttps://www.otakustv.net/...`. Normalize to a path-only value (e.g. use `link.attr("href")` or strip scheme/host from `abs:href`) before calling `setUrlWithoutDomain`.
</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.

Comment on lines +111 to +112
val link = element.selectFirst("a[href*=/anime/]") ?: element.selectFirst("a")!!
setUrlWithoutDomain(link.attr("abs:href"))

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.

issue (bug_risk): Using abs:href with setUrlWithoutDomain can create malformed requests.

setUrlWithoutDomain is intended to store a relative path that later gets prefixed with baseUrl. Passing a fully qualified abs:href risks producing URLs like https://www.otakustv.nethttps://www.otakustv.net/.... Normalize to a path-only value (e.g. use link.attr("href") or strip scheme/host from abs:href) before calling setUrlWithoutDomain.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new extension for OtakusTV, implementing anime and episode parsing along with a custom WebView-based server extractor to handle obfuscated video hoster URLs. The review feedback highlights a few key improvements: using encodedPath to robustly extract slugs without query parameters, simplifying the description selector using Jsoup's :not() pseudo-class, and adding a guard flag in the WebView client to prevent multiple concurrent polling loops when onPageFinished is triggered multiple times.

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.

Comment thread src/es/otakustv/src/eu/kanade/tachiyomi/animeextension/es/otakustv/OtakusTV.kt Outdated
Comment thread src/es/otakustv/src/eu/kanade/tachiyomi/animeextension/es/otakustv/OtakusTV.kt Outdated
RikCost and others added 4 commits June 27, 2026 16:21
isNsfw = true
…ustv/OtakusTV.kt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ustv/OtakusTV.kt

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Adding a polling flag
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.

OtakusTV [ES]: Source Request

1 participant