Adding support for IsekaiScan.top (#16939)

* Adding support for IsekaiScan.top

* addressing review comment to remove chapterListParse logic from main theme

* addressing review comment to remove adding current year to date logic

* remove space
This commit is contained in:
Livin D'cruz 2023-07-01 20:07:51 +05:30 committed by GitHub
parent a70b186815
commit dbb4f6a0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 73 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@ -0,0 +1,72 @@
package eu.kanade.tachiyomi.extension.en.isekaiscantop
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.CacheControl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
class IsekaiScanTop : Madara(
"IsekaiScan.top (unoriginal)",
"https://isekaiscan.top",
"en",
) {
override fun popularMangaRequest(page: Int): Request {
return GET(
url = "$baseUrl/popular-manga?page=$page",
headers = headers,
cache = CacheControl.FORCE_NETWORK,
)
}
override fun latestUpdatesRequest(page: Int): Request {
return GET(
url = "$baseUrl/latest-manga?page=$page",
headers = headers,
cache = CacheControl.FORCE_NETWORK,
)
}
override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup()
val chaptersWrapper = document.select("div[id^=manga-chapters-holder]")
var chapterElements = document.select(chapterListSelector())
if (chapterElements.isEmpty() && !chaptersWrapper.isNullOrEmpty()) {
val mangaId = chaptersWrapper.attr("data-id")
val xhrHeaders = headersBuilder()
.add("Referer", "$baseUrl/")
.add("X-Requested-With", "XMLHttpRequest")
.build()
val xhrRequest = GET("$baseUrl/ajax-list-chapter?mangaID=$mangaId", xhrHeaders)
val xhrResponse = client.newCall(xhrRequest).execute()
chapterElements = xhrResponse.asJsoup().select(chapterListSelector())
xhrResponse.close()
}
countViews(document)
return chapterElements.map(::chapterFromElement)
}
override fun pageListParse(document: Document): List<Page> {
val stringArray = document.select("p#arraydata").text().split(",").toTypedArray()
return stringArray.mapIndexed { index, url ->
Page(
index,
document.location(),
url,
)
}
}
override fun searchPage(page: Int): String = "search?page=$page"
override fun searchMangaNextPageSelector(): String? = "ul.pagination li:last-child a"
}

View File

@ -154,6 +154,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("InstaManhwa", "https://www.instamanhwa.com", "en", isNsfw = true, overrideVersionCode = 1),
SingleLang("IsekaiScan.com", "https://isekaiscan.com", "en", className = "IsekaiScanCom", overrideVersionCode = 4),
SingleLang("IsekaiScan.to (unoriginal)", "https://isekaiscan.to", "en", pkgName = "isekaiscaneu", className = "IsekaiScanTo", overrideVersionCode = 2),
SingleLang("IsekaiScan.top (unoriginal)", "https://isekaiscan.top", "en", pkgName = "isekaiscantop", className = "IsekaiScanTop"),
SingleLang("IsekaiScanManga (unoriginal)", "https://isekaiscanmanga.com", "en", className = "IsekaiScanManga", overrideVersionCode = 1),
SingleLang("Its Your Right Manhua", "https://itsyourightmanhua.com", "en", className = "ItsYourRightManhua", overrideVersionCode = 2),
SingleLang("Izakaya", "https://leitorizakaya.net", "pt-BR", isNsfw = true, overrideVersionCode = 1),