add tachiyomi to UA (#8103)

This commit is contained in:
OncePunchedMan 2021-07-14 01:10:33 +02:00 committed by GitHub
parent 94b20396ab
commit 695cdcb57e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -3,9 +3,12 @@ package eu.kanade.tachiyomi.extension.en.asurascans
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream
import okhttp3.OkHttpClient
import okhttp3.Headers
import okhttp3.Request
import java.util.concurrent.TimeUnit
import org.jsoup.nodes.Document
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.network.GET
class AsuraScans : WPMangaStream("AsuraScans", "https://www.asurascans.com", "en") {
@ -17,6 +20,10 @@ class AsuraScans : WPMangaStream("AsuraScans", "https://www.asurascans.com", "en
.addNetworkInterceptor(rateLimitInterceptor)
.build()
override fun imageRequest(page: Page): Request {
return GET(page.imageUrl!!, headers.newBuilder().set("User-Agent", USER_AGENT).build())
}
override val pageSelector = "div.rdminimal img[loading*=lazy]"
// Skip scriptPages
@ -25,4 +32,9 @@ class AsuraScans : WPMangaStream("AsuraScans", "https://www.asurascans.com", "en
.filterNot { it.attr("abs:src").isNullOrEmpty() }
.mapIndexed { i, img -> Page(i, "", img.attr("abs:src")) }
}
companion object {
private const val USER_AGENT = "Tachiyomi Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; " +
"LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.100 Mobile Safari/537.36"
}
}

View File

@ -12,7 +12,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 7
override val sources = listOf(
SingleLang("Asura Scans", "https://www.asurascans.com", "en", overrideVersionCode = 3),
SingleLang("Asura Scans", "https://www.asurascans.com", "en", overrideVersionCode = 4),
SingleLang("KlanKomik", "https://klankomik.com", "id", overrideVersionCode = 1),
SingleLang("MasterKomik", "https://masterkomik.com", "id", overrideVersionCode = 1),
SingleLang("Kaisar Komik", "https://kaisarkomik.com", "id", overrideVersionCode = 1),