-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ru-Acomics] Fix parsing popular and search page #6611
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
ext { | ||
extName = 'AComics' | ||
extClass = '.AComics' | ||
extVersionCode = 4 | ||
extVersionCode = 5 | ||
isNsfw = true | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.ru.acomics | |
import eu.kanade.tachiyomi.network.GET | ||
import eu.kanade.tachiyomi.source.model.Filter | ||
import eu.kanade.tachiyomi.source.model.FilterList | ||
import eu.kanade.tachiyomi.source.model.MangasPage | ||
import eu.kanade.tachiyomi.source.model.Page | ||
import eu.kanade.tachiyomi.source.model.SChapter | ||
import eu.kanade.tachiyomi.source.model.SManga | ||
|
@@ -39,17 +40,32 @@ class AComics : ParsedHttpSource() { | |
override fun popularMangaRequest(page: Int): Request = | ||
GET("$baseUrl/comics?$DEFAULT_COMIC_QUERIES&sort=subscr_count&skip=${10 * (page - 1)}", headers) | ||
|
||
override fun popularMangaSelector() = "table.list-loadable > tbody > tr" | ||
override fun popularMangaSelector() = "section.serial-card" | ||
|
||
override fun popularMangaFromElement(element: Element) = SManga.create().apply { | ||
thumbnail_url = element.selectFirst("a > img")?.absUrl("src") | ||
element.selectFirst("div.title > a")!!.run { | ||
thumbnail_url = element.selectFirst("a > img")?.absUrl("data-real-src") | ||
element.selectFirst("h2 > a")!!.run { | ||
setUrlWithoutDomain(attr("href") + "/about") | ||
title = text() | ||
} | ||
} | ||
|
||
override fun popularMangaNextPageSelector() = "span.button:not(:has(a)) + span.button > a" | ||
override fun popularMangaNextPageSelector(): String? { | ||
TODO("Not yet implemented") | ||
} | ||
Comment on lines
+53
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. either throw |
||
|
||
override fun popularMangaParse(response: Response): MangasPage { | ||
val document = response.asJsoup() | ||
|
||
val mangas = document.select(popularMangaSelector()).map { element -> | ||
popularMangaFromElement(element) | ||
} | ||
|
||
return MangasPage(mangas, true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there not some end page? maybe check number of entries on page and end page would have less. |
||
} | ||
|
||
override fun latestUpdatesParse(response: Response) = popularMangaParse(response) | ||
override fun searchMangaParse(response: Response) = popularMangaParse(response) | ||
|
||
// =============================== Latest =============================== | ||
override fun latestUpdatesRequest(page: Int): Request = | ||
|
@@ -58,7 +74,6 @@ class AComics : ParsedHttpSource() { | |
override fun latestUpdatesSelector() = popularMangaSelector() | ||
|
||
override fun latestUpdatesFromElement(element: Element) = popularMangaFromElement(element) | ||
|
||
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() | ||
|
||
// =============================== Search =============================== | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are looking for
a.infinite-scroll
after the lastdiv.infinite-scroll-content > section.serial-card
. That element only exists if there is more content to load. You can make it as advanced or basic as you want.