parent
1699cece9f
commit
8e610e1ea9
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'InfinityScans'
|
extName = 'InfinityScans'
|
||||||
extClass = '.InfinityScans'
|
extClass = '.InfinityScans'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,17 @@ class InfinityScans : HttpSource() {
|
||||||
.rateLimit(1)
|
.rateLimit(1)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override fun headersBuilder() = super.headersBuilder()
|
override fun headersBuilder() = super.headersBuilder().apply {
|
||||||
.add("Referer", "$baseUrl/")
|
add("Referer", "$baseUrl/")
|
||||||
|
}
|
||||||
|
|
||||||
|
private val apiHeaders = headersBuilder().apply {
|
||||||
|
add("Accept", "*/*")
|
||||||
|
add("Sec-Fetch-Dest", "empty")
|
||||||
|
add("Sec-Fetch-Mode", "cors")
|
||||||
|
add("Sec-Fetch-Site", "same-origin")
|
||||||
|
add("X-Requested-With", "XMLHttpRequest")
|
||||||
|
}.build()
|
||||||
|
|
||||||
private val json: Json by injectLazy()
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
|
@ -64,10 +73,6 @@ class InfinityScans : HttpSource() {
|
||||||
// Search
|
// Search
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val searchHeaders = headersBuilder().apply {
|
|
||||||
add("X-Requested-With", "XMLHttpRequest")
|
|
||||||
}.build()
|
|
||||||
|
|
||||||
val url = baseUrl.toHttpUrl().newBuilder()
|
val url = baseUrl.toHttpUrl().newBuilder()
|
||||||
.addPathSegments("ajax/comics")
|
.addPathSegments("ajax/comics")
|
||||||
.addQueryParameter("page", page.toString())
|
.addQueryParameter("page", page.toString())
|
||||||
|
@ -98,6 +103,10 @@ class InfinityScans : HttpSource() {
|
||||||
|
|
||||||
if (query.isNotBlank()) url.addQueryParameter("title", query)
|
if (query.isNotBlank()) url.addQueryParameter("title", query)
|
||||||
|
|
||||||
|
val searchHeaders = apiHeaders.newBuilder().apply {
|
||||||
|
set("Referer", url.build().newBuilder().removePathSegment(0).build().toString())
|
||||||
|
}.build()
|
||||||
|
|
||||||
return GET(url.build(), searchHeaders)
|
return GET(url.build(), searchHeaders)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,13 +215,11 @@ class InfinityScans : HttpSource() {
|
||||||
add("comic_id", id)
|
add("comic_id", id)
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
val chapterHeaders = headersBuilder().apply {
|
val chapterHeaders = apiHeaders.newBuilder().apply {
|
||||||
add("Accept", "*/*")
|
|
||||||
add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
|
add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
|
||||||
add("Host", baseUrl.toHttpUrl().host)
|
add("Host", baseUrl.toHttpUrl().host)
|
||||||
add("Origin", baseUrl)
|
add("Origin", baseUrl)
|
||||||
set("Referer", url.toString())
|
set("Referer", url.toString())
|
||||||
add("X-Requested-With", "XMLHttpRequest")
|
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
val chapterListData = client.newCall(
|
val chapterListData = client.newCall(
|
||||||
|
@ -249,12 +256,10 @@ class InfinityScans : HttpSource() {
|
||||||
)
|
)
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
val pageListHeaders = headersBuilder().apply {
|
val pageListHeaders = apiHeaders.newBuilder().apply {
|
||||||
add("Accept", "*/*")
|
|
||||||
add("Host", url.host)
|
add("Host", url.host)
|
||||||
add("Origin", baseUrl)
|
add("Origin", baseUrl)
|
||||||
set("Referer", url.toString())
|
set("Referer", url.toString())
|
||||||
add("X-Requested-With", "XMLHttpRequest")
|
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
val pageListData = client.newCall(
|
val pageListData = client.newCall(
|
||||||
|
|
Loading…
Reference in New Issue