Manga Online: add headers to requests (#1619)

This commit is contained in:
AwkwardPeak7 2024-02-29 19:55:21 +05:00 committed by Draff
parent c81adc7829
commit 48ca6558ed
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Manga Online' extName = 'Manga Online'
extClass = '.MangaOnline' extClass = '.MangaOnline'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }

View File

@ -87,7 +87,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
override fun latestUpdatesNextPageSelector() = null override fun latestUpdatesNextPageSelector() = null
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/capitulo/page/$page") override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/capitulo/page/$page", headers)
override fun latestUpdatesParse(response: Response): MangasPage { override fun latestUpdatesParse(response: Response): MangasPage {
val mangesPage = super.latestUpdatesParse(response) val mangesPage = super.latestUpdatesParse(response)
@ -125,7 +125,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
override fun popularMangaNextPageSelector() = null override fun popularMangaNextPageSelector() = null
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/mais-vistos/") override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/mais-vistos/", headers)
override fun popularMangaSelector() = "div.content .item" override fun popularMangaSelector() = "div.content .item"
@ -138,7 +138,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
val url = "$baseUrl/search".toHttpUrl().newBuilder() val url = "$baseUrl/search".toHttpUrl().newBuilder()
.addPathSegment(query) .addPathSegment(query)
.build() .build()
return GET(url) return GET(url, headers)
} }
val path = when (val genre = (filters.first() as GenreList).selected) { val path = when (val genre = (filters.first() as GenreList).selected) {
@ -146,7 +146,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
else -> "$baseUrl/genero/${genre.id}" else -> "$baseUrl/genero/${genre.id}"
} }
return GET("$path/page/$page") return GET("$path/page/$page", headers)
} }
override fun searchMangaSelector() = popularMangaSelector() override fun searchMangaSelector() = popularMangaSelector()
@ -169,7 +169,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
private fun fetchMangaGenre() { private fun fetchMangaGenre() {
try { try {
val request = client val request = client
.newCall(GET("$baseUrl/generos/")) .newCall(GET("$baseUrl/generos/", headers))
.execute() .execute()
val document = request.asJsoup() val document = request.asJsoup()