earlyManga add header & fix pages (#5846)

This commit is contained in:
Riztard Lanthorn 2021-02-14 21:21:53 +07:00 committed by GitHub
parent 3fa9e9eb81
commit 3eed4041cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'EarlyManga' extName = 'EarlyManga'
pkgNameSuffix = 'en.earlymanga' pkgNameSuffix = 'en.earlymanga'
extClass = '.EarlyManga' extClass = '.EarlyManga'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
@ -27,6 +28,10 @@ class EarlyManga : ParsedHttpSource() {
override val client: OkHttpClient = network.cloudflareClient 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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.151 Safari/537.36")
.add("Referer", baseUrl)
// popular // popular
override fun popularMangaRequest(page: Int) = GET("$baseUrl/hot-manga?page=$page", headers) override fun popularMangaRequest(page: Int) = GET("$baseUrl/hot-manga?page=$page", headers)
@ -124,7 +129,7 @@ class EarlyManga : ParsedHttpSource() {
// pages // pages
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
return document.select(".chapter_images-container > img").mapIndexed { i, element -> return document.select(".chapter-images-container-inside > img").mapIndexed { i, element ->
Page(i, "", element.attr("abs:src")) Page(i, "", element.attr("abs:src"))
} }
} }