FlixScans: fixes (#19259)
- change english domain & fix chapter list - change popular url for arabic (GalaxyManga)
This commit is contained in:
parent
f950ccce3c
commit
efab0b929c
@ -2,4 +2,4 @@ package eu.kanade.tachiyomi.extension.en.flixscans
|
|||||||
|
|
||||||
import eu.kanade.tachiyomi.multisrc.flixscans.FlixScans
|
import eu.kanade.tachiyomi.multisrc.flixscans.FlixScans
|
||||||
|
|
||||||
class FlixScansNet : FlixScans("Flix Scans", "https://flixscans.net", "en", cdnUrl = "https://media.flixscans.net/")
|
class FlixScansNet : FlixScans("Flix Scans", "https://flixscans.org", "en", cdnUrl = "https://media.flixscans.org/")
|
||||||
|
@ -1,25 +1,13 @@
|
|||||||
package eu.kanade.tachiyomi.extension.ar.galaxymanga
|
package eu.kanade.tachiyomi.extension.ar.galaxymanga
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.multisrc.flixscans.Chapter
|
|
||||||
import eu.kanade.tachiyomi.multisrc.flixscans.FlixScans
|
import eu.kanade.tachiyomi.multisrc.flixscans.FlixScans
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
|
||||||
|
|
||||||
class GalaxyManga : FlixScans("جالاكسي مانجا", "https://flixscans.com", "ar") {
|
class GalaxyManga : FlixScans("جالاكسي مانجا", "https://flixscans.com", "ar") {
|
||||||
override val versionId = 2
|
override val versionId = 2
|
||||||
|
|
||||||
override fun chapterListRequest(manga: SManga): Request {
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
val id = manga.url.split("-")[1]
|
return GET("$apiUrl/webtoon/pages/home/action", headers)
|
||||||
|
|
||||||
return GET("$apiUrl/webtoon/chapters/$id-desc", headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
|
||||||
val chapters = response.parseAs<List<Chapter>>()
|
|
||||||
|
|
||||||
return chapters.map(Chapter::toSChapter)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
Binary file not shown.
Before Width: | Height: | Size: 216 KiB |
@ -3,9 +3,7 @@ package eu.kanade.tachiyomi.multisrc.flixscans
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.POST
|
import eu.kanade.tachiyomi.network.POST
|
||||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
|
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||||
@ -42,11 +40,6 @@ abstract class FlixScans(
|
|||||||
.rateLimit(2)
|
.rateLimit(2)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
// only returns 15 chapters each request, so using higher rate limit
|
|
||||||
private val chapterClient = network.cloudflareClient.newBuilder()
|
|
||||||
.rateLimitHost(apiUrl.toHttpUrl(), 1, 2)
|
|
||||||
.build()
|
|
||||||
|
|
||||||
override fun headersBuilder() = super.headersBuilder()
|
override fun headersBuilder() = super.headersBuilder()
|
||||||
.add("Referer", baseUrl)
|
.add("Referer", baseUrl)
|
||||||
|
|
||||||
@ -240,49 +233,16 @@ abstract class FlixScans(
|
|||||||
return result.serie.toSManga(cdnUrl)
|
return result.serie.toSManga(cdnUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
|
||||||
return chapterClient.newCall(chapterListRequest(manga))
|
|
||||||
.asObservableSuccess()
|
|
||||||
.map(::chapterListParse)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun chapterListRequest(manga: SManga): Request {
|
override fun chapterListRequest(manga: SManga): Request {
|
||||||
val id = manga.url.split("-")[1]
|
val id = manga.url.split("-")[1]
|
||||||
|
|
||||||
return paginatedChapterListRequest(id)
|
return GET("$apiUrl/webtoon/chapters/$id-desc", headers)
|
||||||
}
|
|
||||||
|
|
||||||
private fun paginatedChapterListRequest(seriesID: String, page: Int = 1): Request {
|
|
||||||
return GET("$apiUrl/webtoon/chapters/$seriesID-asc?page=$page", headers)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
override fun chapterListParse(response: Response): List<SChapter> {
|
||||||
val result = response.parseAs<ApiResponse<Chapter>>()
|
val chapters = response.parseAs<List<Chapter>>()
|
||||||
|
|
||||||
val id = response.request.url.toString()
|
return chapters.map(Chapter::toSChapter)
|
||||||
.substringAfterLast("/")
|
|
||||||
.substringBefore("-")
|
|
||||||
|
|
||||||
val chapters = result.data.toMutableList()
|
|
||||||
|
|
||||||
var page = 1
|
|
||||||
|
|
||||||
while (page < result.meta.lastPage) {
|
|
||||||
page++
|
|
||||||
|
|
||||||
val newResponse = chapterClient.newCall(paginatedChapterListRequest(id, page)).execute()
|
|
||||||
|
|
||||||
if (!newResponse.isSuccessful) {
|
|
||||||
newResponse.close()
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
val newResult = newResponse.parseAs<ApiResponse<Chapter>>()
|
|
||||||
|
|
||||||
chapters.addAll(newResult.data)
|
|
||||||
}
|
|
||||||
|
|
||||||
return chapters.map(Chapter::toSChapter).reversed()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListRequest(chapter: SChapter): Request {
|
override fun pageListRequest(chapter: SChapter): Request {
|
||||||
|
@ -9,12 +9,11 @@ class FlixScansGenerator : ThemeSourceGenerator {
|
|||||||
|
|
||||||
override val themeClass = "FlixScans"
|
override val themeClass = "FlixScans"
|
||||||
|
|
||||||
override val baseVersionCode: Int = 2
|
override val baseVersionCode: Int = 3
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("Flix Scans", "https://flixscans.net", "en", className = "FlixScansNet", pkgName = "flixscans"),
|
SingleLang("Flix Scans", "https://flixscans.org", "en", className = "FlixScansNet", pkgName = "flixscans"),
|
||||||
SingleLang("جالاكسي مانجا", "https://flixscans.com", "ar", className = "GalaxyManga", overrideVersionCode = 26),
|
SingleLang("جالاكسي مانجا", "https://flixscans.com", "ar", className = "GalaxyManga", overrideVersionCode = 26),
|
||||||
SingleLang("مانجا نون", "https://manjanoon.com", "ar", className = "MangaNoon"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user