WPComics add headers (#5355)
some source like mangasum need it to load chapter images
This commit is contained in:
parent
c5ca78c461
commit
314cb965e3
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'WP-Comics'
|
||||
pkgNameSuffix = 'all.wpcomics'
|
||||
extClass = '.WPComicsFactory'
|
||||
extVersionCode = 16
|
||||
extVersionCode = 17
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.source.model.Page
|
|||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
|
@ -28,6 +29,10 @@ abstract class WPComics(
|
|||
|
||||
override val client: OkHttpClient = network.cloudflareClient
|
||||
|
||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0")
|
||||
.add("Referer", baseUrl)
|
||||
|
||||
private fun List<String>.doesInclude(thisWord: String): Boolean = this.any { it.contains(thisWord, ignoreCase = true) }
|
||||
|
||||
// Popular
|
||||
|
|
Loading…
Reference in New Issue