From 3eed4041cb0d9e166cd480ccdcedbc02052856cc Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Sun, 14 Feb 2021 21:21:53 +0700 Subject: [PATCH] earlyManga add header & fix pages (#5846) --- src/en/earlymanga/build.gradle | 2 +- .../kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/en/earlymanga/build.gradle b/src/en/earlymanga/build.gradle index c3b81c9ae..faca97d79 100644 --- a/src/en/earlymanga/build.gradle +++ b/src/en/earlymanga/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'EarlyManga' pkgNameSuffix = 'en.earlymanga' extClass = '.EarlyManga' - extVersionCode = 3 + extVersionCode = 4 libVersion = '1.2' } diff --git a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt index 03e88af99..4bdc2c90d 100644 --- a/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt +++ b/src/en/earlymanga/src/eu/kanade/tachiyomi/extension/en/earlymanga/EarlyManga.kt @@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.Headers import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response @@ -27,6 +28,10 @@ class EarlyManga : ParsedHttpSource() { 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 override fun popularMangaRequest(page: Int) = GET("$baseUrl/hot-manga?page=$page", headers) @@ -124,7 +129,7 @@ class EarlyManga : ParsedHttpSource() { // pages override fun pageListParse(document: Document): List { - 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")) } }