Happymh: fix referer for pageListRequest (#2984)
This commit is contained in:
parent
5a229cd8cf
commit
af4b442cc0
src/zh/happymh
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Happymh'
|
||||
extClass = '.Happymh'
|
||||
extVersionCode = 10
|
||||
extVersionCode = 11
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -142,10 +142,12 @@ class Happymh : HttpSource(), ConfigurableSource {
|
||||
|
||||
override fun pageListRequest(chapter: SChapter): Request {
|
||||
val url = baseUrl + chapter.url
|
||||
val comicId = chapter.url.substringAfter("code=").substringBefore("&")
|
||||
val chapterId = chapter.url.substringAfter("cid=").substringBefore("&")
|
||||
// Some chapters return 403 without this header
|
||||
val header = headersBuilder()
|
||||
.add("X-Requested-With", "XMLHttpRequest")
|
||||
.set("Referer", url)
|
||||
.set("Referer", "$baseUrl/reads/$comicId/$chapterId")
|
||||
.build()
|
||||
return GET(url, header)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user