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