mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 19:52:56 +01:00
Happymh: Add referer header for image requests (#2135)
This commit is contained in:
parent
e053753d28
commit
4337db6ad0
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Happymh'
|
||||
extClass = '.Happymh'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -154,6 +154,13 @@ class Happymh : HttpSource(), ConfigurableSource {
|
||||
|
||||
override fun imageUrlParse(response: Response): String = throw UnsupportedOperationException()
|
||||
|
||||
override fun imageRequest(page: Page): Request {
|
||||
val header = headersBuilder()
|
||||
.set("Referer", "$baseUrl/")
|
||||
.build()
|
||||
return GET(page.imageUrl!!, header)
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
val context = screen.context
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user