[RU]Remanga User-Agent refund - fix 403 (#15822)
* [RU]Remanga User-Agent refund * + headers
This commit is contained in:
parent
ebd5e5e071
commit
a5f48cb948
@ -6,7 +6,7 @@ ext {
|
||||
extName = 'Remanga'
|
||||
pkgNameSuffix = 'ru.remanga'
|
||||
extClass = '.Remanga'
|
||||
extVersionCode = 66
|
||||
extVersionCode = 67
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -105,7 +105,8 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||
private val userAgentRandomizer = "${Random.nextInt().absoluteValue}"
|
||||
|
||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.$userAgentRandomizer Safari/537.36")
|
||||
// Magic User-Agent, no change/update, does not cause 403
|
||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36 Edg/100.0.$userAgentRandomizer")
|
||||
.add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8")
|
||||
.add("Referer", baseUrl.replace("api.", ""))
|
||||
|
||||
@ -385,7 +386,7 @@ class Remanga : ConfigurableSource, HttpSource() {
|
||||
}
|
||||
|
||||
private fun mangaBranches(manga: SManga): List<BranchesDto> {
|
||||
val responseString = client.newCall(GET(baseUrl + manga.url)).execute().body.string()
|
||||
val responseString = client.newCall(GET(baseUrl + manga.url, headers)).execute().body.string()
|
||||
// manga requiring login return "content" as a JsonArray instead of the JsonObject we expect
|
||||
// callback request for update outside the library
|
||||
val content = json.decodeFromString<JsonObject>(responseString)["content"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user