Skip to content

Update MonosChinos extension for redesign website#654

Open
FFSA47 wants to merge 8 commits into
yuzono:masterfrom
FFSA47:monoschinos
Open

Update MonosChinos extension for redesign website#654
FFSA47 wants to merge 8 commits into
yuzono:masterfrom
FFSA47:monoschinos

Conversation

@FFSA47

@FFSA47 FFSA47 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the MonosChinos anime extension to work with the site's redesigned HTML structure. All selectors have been updated, image loading improved, and video extraction remains unchanged and fully functional.


What Changed

1. Selectors updated for new site design

Popular Anime

  • Container: li.ficha_efecto aarticle a.card-wrap
  • Title: h3h3.card-title
  • Thumbnail: imgimg.lazy

Latest Episodes

  • Container: ul.row.row-cols-* > li.col.mb-4section:has(h2:contains(Últimos capítulos)) article a.card-wrap
  • Episode number: extracted from div.absolute.top-2.5 (text like "EP 2")
  • Genre: extracted from div.mt-1 span
  • Pagination: restored using a[rel='next'] selector

Anime Details

  • Title: h1.fs-2.text-capitalize.text-lighth1.font-extrabold
  • Thumbnail: .d-none.d-sm-flex img.lazydiv.shrink-0 img.lazy
  • Synopsis: #profile-tab-pane .mb-3 pp[class*="max-w-"] with fallback #tab-info p
  • Genres: #profile-tab-pane .badge.bg-secondarydiv.flex.gap-2.flex-wrap a
  • Status: badge in div.absolute.top-3.left-3 (checks for "Estreno", "En emisión", "Finalizado")

2. Image loading improvements

  • Rewrote getImageUrl() to check multiple attributes in order: data-srcdata-lazy-srcsrcsetsrc
  • Automatically filters out placeholder anime.png

3. Synopsis extraction fix

  • Replaced problematic selector .max-w-\[640px\] p (caused SelectorParseException) with p[class*="max-w-"]
  • Added fallback #tab-info p for cases where the primary selector fails
  • No longer throws parsing exceptions due to escaped brackets or slashes in class names

4. Thumbnail extraction fix

  • Replaced div.relative[aspect-ratio='2/3'] (failed because aspect-ratio is CSS, not HTML) with div.shrink-0
  • Now reliably loads cover images for all anime in the details page

5. Video extraction unchanged

  • All server resolvers and extractors (Voe, StreamWish, Filemoon, DoodStream, LuluStream, etc.) remain untouched
  • Sorting and preferences work as before

Testing

  • ✅ Popular anime list loads with correct titles and thumbnails
  • ✅ Latest episodes section shows episode numbers and genres correctly
  • ✅ Search and filtering work
  • ✅ Anime details page displays all info correctly (title, synopsis, genres, status, cover)
  • ✅ Synopsis now extracts correctly without parsing exceptions
  • ✅ Cover images load correctly for all anime in details page
  • ✅ Episode list (via AJAX) loads and sorts properly
  • ✅ Video players are detected and playback works
  • ✅ Server/quality preferences are respected
  • ✅ Pagination in latest episodes works correctly

Checklist

  • Selectors updated to match current HTML structure
  • Images load reliably (no placeholders)
  • Synopsis extraction works without exceptions
  • Cover images load correctly in details page
  • Video extraction remains functional
  • Filters and preferences unchanged
  • Code formatted consistently with existing codebase
  • Removed unused helper functions (isValidUrl)

Notes

This PR only restores compatibility with the redesigned website. No new features are added, and the video extraction logic (which was working correctly) has not been modified. The most critical fixes were the synopsis selector (which was throwing SelectorParseException) and the thumbnail selector (which failed due to CSS attribute selection).


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 the MonosChinos Spanish anime extension to match the redesigned website structure and maintain compatibility.

Bug Fixes:

  • Restore popular, latest, and detail views by updating selectors for the new MonosChinos site layout.
  • Ensure anime status, episode metadata, and thumbnails are correctly parsed from the updated HTML.

Enhancements:

  • Improve image URL resolution to handle multiple lazy-loading attributes and skip placeholder images.
  • Refine latest updates titles to include episode numbers and clean extracted text for titles and server names.

Build:

  • Bump the MonosChinos extension version code to trigger client updates.

@sourcery-ai

sourcery-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates the MonosChinos Tachiyomi anime extension to match the redesigned site HTML, primarily by adjusting selectors for popular/latest lists and anime details, improving image URL resolution, and bumping the extension version code.

Sequence diagram for updated image URL resolution in getImageUrl

sequenceDiagram
    participant MonosChinos
    participant Element_img

    MonosChinos->>Element_img: getImageUrl()
    loop [for each candidate in data-src, data-lazy-src, srcset, src]
        alt [candidate is srcset]
            MonosChinos->>Element_img: attr("abs:srcset")
            MonosChinos->>MonosChinos: substringBefore(" ")
        else [candidate is not srcset]
            MonosChinos->>Element_img: attr("abs:candidate")
        end
        alt [url is not blank and does not contain anime.png]
            MonosChinos-->>MonosChinos: select first valid url
            MonosChinos-->>Element_img: return url
            note over MonosChinos: break
        end
    end
    MonosChinos-->>Element_img: return null if no valid url
Loading

File-Level Changes

Change Details Files
Update popular anime parsing to use new card-based layout and next-page detection.
  • Change popular list container selector from the old list layout to article a.card-wrap.
  • Update title extraction to use h3.card-title with trimming.
  • Update thumbnail extraction to use img.lazy and the shared image helper.
  • Switch pagination detection from a pagination span selector to a[rel='next'].
src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt
Rework latest-updates parsing to target the new "Últimos capítulos" section and expose episode info in titles/descriptions.
  • Select latest episodes from the specific section containing the "Últimos capítulos" header and article a.card-wrap cards.
  • Derive the episode slug from the /ver/ URL and reconstruct the anime URL based on the slug with the existing regex.
  • Build the anime title as <title> - Episodio <n> using a dedicated badge element for episode number.
  • Populate the description with the genre text from div.mt-1 span and thumbnails from img.lazy.
  • Disable paging on latest updates by always returning hasNextPage = false.
src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt
Align anime-details parsing with the new layout and status badge, including safer trimming and fallbacks.
  • Update title selector to h1.font-extrabold and trim whitespace.
  • Update thumbnail selector to div.relative[aspect-ratio='2/3'] img.lazy and reuse the image helper.
  • Update synopsis selector to .max-w-\[640px\] p.text-white\/75 and trim text.
  • Update genres selector to div.flex.gap-2.flex-wrap a and join link texts.
  • Change status detection to read from the top-left badge div.absolute.top-3.left-3 and map text contents containing "Estreno"/"En emisión"/"Finalizado` to Tachiyomi status enums, defaulting to UNKNOWN when missing.
src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt
Improve image URL resolution to handle multiple attributes and filter placeholders.
  • Replace the previous attribute-by-attribute isValidUrl-based image resolver with a single helper that checks data-src, data-lazy-src, srcset, and src in order.
  • For srcset, take only the first URL before any descriptor.
  • Filter out blank URLs and any URL containing anime.png to avoid placeholders.
src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt
Tighten server name extraction and bump extension version code.
  • Trim the text fallback when deriving the server name from the button content before using it.
  • Increment extVersionCode from 53 to 54 for the MonosChinos extension build config.
src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt
src/es/monoschinos/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:

  • In latestUpdatesParse, nextPage is now hardcoded to false; if the redesigned site still exposes pagination, consider updating the selector instead of disabling pagination to preserve navigation behavior.
  • The isValidUrl helper appears to be unused after the getImageUrl rewrite; consider removing it or reusing its logic in getImageUrl to avoid dead code and keep URL validation consistent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In latestUpdatesParse, nextPage is now hardcoded to false; if the redesigned site still exposes pagination, consider updating the selector instead of disabling pagination to preserve navigation behavior.
- The isValidUrl helper appears to be unused after the getImageUrl rewrite; consider removing it or reusing its logic in getImageUrl to avoid dead code and keep URL validation consistent.

## Individual Comments

### Comment 1
<location path="src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt" line_range="349-351" />
<code_context>
-        else -> null
+    private fun Element.getImageUrl(): String? {
+        val candidates = listOf("data-src", "data-lazy-src", "srcset", "src")
+        return candidates.mapNotNull { attr ->
+            when (attr) {
+                "srcset" -> attr("abs:srcset").substringBefore(" ")
+                else -> attr("abs:$attr")
+            }
</code_context>
<issue_to_address>
**issue (bug_risk):** The lambda parameter name `attr` shadows the `Element.attr` function, which will cause this code not to compile.

Within `mapNotNull { attr -> ... }`, calls like `attr("abs:srcset")` resolve to the `String` lambda parameter rather than `Element.attr`, causing a compilation error. Rename the lambda parameter (e.g. to `name`) and call `attr("abs:srcset")` on the `Element` instead (e.g. `this.attr("abs:srcset")`).
</issue_to_address>

### Comment 2
<location path="src/es/monoschinos/src/eu/kanade/tachiyomi/animeextension/es/monoschinos/MonosChinos.kt" line_range="110-115" />
<code_context>

             SAnime.create().apply {
-                title = animeTitle
+                this.title = "$title - Episodio $episodeNumber"
                 setUrlWithoutDomain(animeUrl)
-                description = genre
</code_context>
<issue_to_address>
**suggestion:** Avoid appending the episode label when `episodeNumber` is empty to prevent awkward titles.

When `episodeNumber` is empty, this produces titles like `Foo Bar - Episodio ` with a trailing space. Only append `" - Episodio $episodeNumber"` when `episodeNumber` is non-blank, otherwise use just `title`.

```suggestion
            SAnime.create().apply {
                val displayTitle = if (episodeNumber.isNotBlank()) {
                    "$title - Episodio $episodeNumber"
                } else {
                    title
                }
                this.title = displayTitle
                setUrlWithoutDomain(animeUrl)
                description = a.selectFirst("div.mt-1 span")?.text()?.trim()
                thumbnail_url = a.selectFirst("img.lazy")?.getImageUrl()
            }
```
</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.

FFSA47 added 2 commits July 14, 2026 14:42
Refactor episode title assignment and restore pagination logic.
Updated selectors for thumbnail and description in anime details parsing.
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