Scan-Manga: migrate to www, fix browse and reader#17584
Open
ultimeus wants to merge 1 commit into
Open
Conversation
|
|
||
| // Search | ||
| // Adult (18+) titles are hidden from the anonymous search API and browse listings, but | ||
| // their detail/chapter/reader pages load fine anonymously. Allow pasting a manga URL into |
Contributor
There was a problem hiding this comment.
add deeplink {} block in build.gradle.kts too
Contributor
mihon defaults to mobile useragent, have you tested it there? |
vetleledaal
reviewed
Jul 14, 2026
| } | ||
|
|
||
| thumbnail_url = document.select("div.full_img_serie img[itemprop=image]").attr("src") | ||
| thumbnail_url = document.selectFirst("meta[itemprop=image]")?.attr("content") |
Contributor
There was a problem hiding this comment.
Suggested change
| thumbnail_url = document.selectFirst("meta[itemprop=image]")?.attr("content") | |
| thumbnail_url = document.selectFirst("meta[itemprop=image]")?.absUrl("content") |
| name = if (!extraTitle.isNullOrEmpty()) "$chapterName - $extraTitle" else chapterName | ||
| setUrlWithoutDomain(linkEl.absUrl("href")) | ||
| name = linkEl.text() | ||
| setUrlWithoutDomain(linkEl.attr("href")) |
Contributor
There was a problem hiding this comment.
Don't remove .absUrl here.
Suggested change
| setUrlWithoutDomain(linkEl.attr("href")) | |
| setUrlWithoutDomain(linkEl.absUrl("href")) |
| description = document.selectFirst("div.titres_desc[itemprop=description]")?.text() | ||
| genre = document.selectFirst("div.titres_souspart span[itemprop=genre]")?.text() | ||
| title = document.selectFirst("[itemprop=name][content]")?.attr("content") | ||
| ?: document.selectFirst("h1")?.text().orEmpty() |
Contributor
There was a problem hiding this comment.
Title should never be empty.
Suggested change
| ?: document.selectFirst("h1")?.text().orEmpty() | |
| ?: document.selectFirst("h1")!!.text() |
| ?: img?.absUrl("src") | ||
| } | ||
| } | ||
| }.distinctBy { it.url } |
Contributor
There was a problem hiding this comment.
This code might hide faulty logic. Can it be avoided?
Suggested change
| }.distinctBy { it.url } | |
| } |
| setUrlWithoutDomain(link.attr("href")) | ||
| title = link.text() | ||
| val img = element.selectFirst("div.logo_manga img") | ||
| thumbnail_url = img?.attr("data-original")?.takeIf { it.isNotBlank() } |
Contributor
There was a problem hiding this comment.
.absUrl is preferred, and still empty if the attribute is not present, according to Jsoup docs.
Suggested change
| thumbnail_url = img?.attr("data-original")?.takeIf { it.isNotBlank() } | |
| thumbnail_url = img?.absUrl("data-original")?.takeIf { it.isNotEmpty() } |
| title = titleElement.text() | ||
| setUrlWithoutDomain(titleElement.attr("href")) | ||
| thumbnail_url = element.selectFirst("img")?.attr("data-original") | ||
| setUrlWithoutDomain(link.attr("href")) |
Contributor
There was a problem hiding this comment.
Suggested change
| setUrlWithoutDomain(link.attr("href")) | |
| setUrlWithoutDomain(link.absUrl("href")) |
| setUrlWithoutDomain(titleElement.attr("href")) | ||
| thumbnail_url = element.selectFirst("img")?.attr("data-original") | ||
| setUrlWithoutDomain(link.attr("href")) | ||
| title = img?.attr("title")?.takeIf { it.isNotBlank() } ?: link.text() |
Contributor
There was a problem hiding this comment.
Suggested change
| title = img?.attr("title")?.takeIf { it.isNotBlank() } ?: link.text() | |
| title = img?.attr("title")?.takeIf { it.isNotEmpty() } ?: link.text() |
| thumbnail_url = element.selectFirst("img")?.attr("data-original") | ||
| setUrlWithoutDomain(link.attr("href")) | ||
| title = img?.attr("title")?.takeIf { it.isNotBlank() } ?: link.text() | ||
| thumbnail_url = img?.attr("data-original") |
Contributor
There was a problem hiding this comment.
Suggested change
| thumbnail_url = img?.attr("data-original") | |
| thumbnail_url = img?.absUrl("data-original") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17374
The Scan-Manga source broke after the site's redesign, and the recent
@Sourcemigration also leftdomainpointing at an invalid subdomain.Problem
m.scan-manga.comnow 302-redirects desktop User-Agents towww.scan-manga.com(a different layout), so the old mobile selectors matched nothing. It also returns a Cloudflare 403 to mobile User-Agents, which FlareSolverr can't solve (it solves with a desktop UA, socf_clearanceis UA-mismatched) — so switching to a mobile UA isn't viable.private val domain = baseUrl.toHttpUrl().hostresolved tom.scan-manga.com, producing the invalidstatic.m.scan-manga.com/bqj.m.scan-manga.comsubdomains ([FR] Scan-Manga: Broken extension due to hardcoded invalid subdomain #17374).Changes
baseUrltohttps://www.scan-manga.comand derivedomainwithtopPrivateDomain(), so thestatic.(images) andbqj.(search) subdomains resolve correctly./TOP-Manga-Webtoon-45.html):div.image_manga.image_listing/?po):div.listing:has(a.nom_manga)itempropselectors; status fromdiv.titre_volume_manga spanli.chapitre > div.chapitre_nom aeval(/*EB*/function (...))(the/*EB*/comment defeated the old literal selector/regex) andconst idcmoved to a separate inline<script>. Locate the packed script via the (comment-tolerant) Hunter regex and readidcfrom the whole document. The decryption itself (Hunter unpack →sml/sme→lelAPI → pako inflate) is unchanged.versionCode23 → 24.Testing
Compiled with Gradle and run through Tachidesk/Suwayomi (with FlareSolverr): Popular, Latest, Search, details, chapter list, and the reader all work.
Checklist:
versionCodevalue inbuild.gradle.ktsbaseVersionCodeinbuild.gradle.kts(if updated multisrc theme code) — N/A (not multisrc)contentWarningconfiguration inbuild.gradle.ktsappropriatelyidis unchangedweb_hi_res_512.pngwhen adding a new extension — N/A (not a new extension)