mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 11:42:47 +01:00
Manga Online: add headers to requests (#1619)
This commit is contained in:
parent
2cf9976aec
commit
b3d2f2a01d
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Manga Online'
|
||||
extClass = '.MangaOnline'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
|
||||
|
||||
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 {
|
||||
val mangesPage = super.latestUpdatesParse(response)
|
||||
@ -125,7 +125,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
|
||||
|
||||
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"
|
||||
|
||||
@ -138,7 +138,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
|
||||
val url = "$baseUrl/search".toHttpUrl().newBuilder()
|
||||
.addPathSegment(query)
|
||||
.build()
|
||||
return GET(url)
|
||||
return GET(url, headers)
|
||||
}
|
||||
|
||||
val path = when (val genre = (filters.first() as GenreList).selected) {
|
||||
@ -146,7 +146,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
|
||||
else -> "$baseUrl/genero/${genre.id}"
|
||||
}
|
||||
|
||||
return GET("$path/page/$page")
|
||||
return GET("$path/page/$page", headers)
|
||||
}
|
||||
|
||||
override fun searchMangaSelector() = popularMangaSelector()
|
||||
@ -169,7 +169,7 @@ class MangaOnline : ParsedHttpSource(), ConfigurableSource {
|
||||
private fun fetchMangaGenre() {
|
||||
try {
|
||||
val request = client
|
||||
.newCall(GET("$baseUrl/generos/"))
|
||||
.newCall(GET("$baseUrl/generos/", headers))
|
||||
.execute()
|
||||
|
||||
val document = request.asJsoup()
|
||||
|
Loading…
Reference in New Issue
Block a user