Fix wrong images in SS (#18499)
* Fix wrong images in SS. * Undo visibility modifier change.
This commit is contained in:
parent
f56ae7f01e
commit
1196434448
|
@ -1,8 +1,11 @@
|
|||
package eu.kanade.tachiyomi.extension.pt.ssshentais
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -17,4 +20,17 @@ class SssHentais : MangaThemesia(
|
|||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
override fun imageRequest(page: Page): Request {
|
||||
val newHeaders = headersBuilder()
|
||||
.set("Referer", page.url)
|
||||
.set("Accept", "image/avif,image/webp,*/*")
|
||||
.set("Accept-Language", "pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3")
|
||||
.set("Sec-Fetch-Dest", "image")
|
||||
.set("Sec-Fetch-Mode", "no-cors")
|
||||
.set("Sec-Fetch-Site", "same-origin")
|
||||
.build()
|
||||
|
||||
return GET(page.imageUrl!!, newHeaders)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package eu.kanade.tachiyomi.extension.pt.sssscanlator
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -17,4 +20,17 @@ class SSSScanlator : MangaThemesia(
|
|||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
override fun imageRequest(page: Page): Request {
|
||||
val newHeaders = headersBuilder()
|
||||
.set("Referer", page.url)
|
||||
.set("Accept", "image/avif,image/webp,*/*")
|
||||
.set("Accept-Language", "pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3")
|
||||
.set("Sec-Fetch-Dest", "image")
|
||||
.set("Sec-Fetch-Mode", "no-cors")
|
||||
.set("Sec-Fetch-Site", "same-origin")
|
||||
.build()
|
||||
|
||||
return GET(page.imageUrl!!, newHeaders)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ import rx.Observable
|
|||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.lang.IllegalArgumentException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -214,7 +215,6 @@ abstract class MangaThemesia(
|
|||
listOf("ongoing", "publishing").any { this.contains(it, ignoreCase = true) } -> SManga.ONGOING
|
||||
this.contains("hiatus", ignoreCase = true) -> SManga.ON_HIATUS
|
||||
this.contains("completed", ignoreCase = true) -> SManga.COMPLETED
|
||||
listOf("dropped", "cancelled").any { this.contains(it, ignoreCase = true) } -> SManga.CANCELLED
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
||||
|
@ -263,9 +263,10 @@ abstract class MangaThemesia(
|
|||
open val pageSelector = "div#readerarea img"
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val chapterUrl = document.location()
|
||||
val htmlPages = document.select(pageSelector)
|
||||
.filterNot { it.imgAttr().isEmpty() }
|
||||
.mapIndexed { i, img -> Page(i, "", img.imgAttr()) }
|
||||
.mapIndexed { i, img -> Page(i, chapterUrl, img.imgAttr()) }
|
||||
|
||||
countViews(document)
|
||||
|
||||
|
@ -280,12 +281,20 @@ abstract class MangaThemesia(
|
|||
emptyList()
|
||||
}
|
||||
val scriptPages = imageList.mapIndexed { i, jsonEl ->
|
||||
Page(i, "", jsonEl.jsonPrimitive.content)
|
||||
Page(i, chapterUrl, jsonEl.jsonPrimitive.content)
|
||||
}
|
||||
|
||||
return scriptPages
|
||||
}
|
||||
|
||||
override fun imageRequest(page: Page): Request {
|
||||
val newHeaders = headersBuilder()
|
||||
.set("Referer", page.url)
|
||||
.build()
|
||||
|
||||
return GET(page.imageUrl!!, newHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set it to false if you want to disable the extension reporting the view count
|
||||
* back to the source website through admin-ajax.php.
|
||||
|
|
|
@ -126,8 +126,8 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
|
|||
SingleLang("SkyMangas", "https://skymangas.com", "es"),
|
||||
SingleLang("Snudae Scans", "https://snudaescans.com", "en", isNsfw = true, className = "BatotoScans", overrideVersionCode = 1),
|
||||
SingleLang("Soul Scans", "https://soulscans.my.id", "id", overrideVersionCode = 1),
|
||||
SingleLang("SSSScanlator", "https://sssscanlator.com", "pt-BR"),
|
||||
SingleLang("SSS Hentais", "https://hentais.sssscanlator.com", "pt-BR", isNsfw = true, className = "SssHentais"),
|
||||
SingleLang("SSSScanlator", "https://sssscanlator.com", "pt-BR", overrideVersionCode = 1),
|
||||
SingleLang("SSS Hentais", "https://hentais.sssscanlator.com", "pt-BR", isNsfw = true, className = "SssHentais", overrideVersionCode = 1),
|
||||
SingleLang("Starlight Scan", "https://starligthscan.com", "pt-BR", isNsfw = true),
|
||||
SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true),
|
||||
SingleLang("SummerToon", "https://summertoon.com", "tr"),
|
||||
|
|
Loading…
Reference in New Issue