From ed4885143bd48a2277c850370aefc93c1d942d28 Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Sat, 23 May 2020 02:15:12 -0400 Subject: [PATCH] Madara - add Manga347, referer for chapters (#3281) --- src/all/madara/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt | 4 +++- .../kanade/tachiyomi/extension/all/madara/MadaraFactory.kt | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index 2d0ed41be..bb1a9c63e 100644 --- a/src/all/madara/build.gradle +++ b/src/all/madara/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Madara (multiple sources)' pkgNameSuffix = "all.madara" extClass = '.MadaraFactory' - extVersionCode = 96 + extVersionCode = 97 libVersion = '1.2' } diff --git a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt index 64649f943..9a5bf376f 100644 --- a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt +++ b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt @@ -363,7 +363,9 @@ abstract class Madara( } protected fun getXhrChapters(mangaId: String): Document { - val xhrHeaders = headersBuilder().add("Content-Type: application/x-www-form-urlencoded; charset=UTF-8").build() + val xhrHeaders = headersBuilder().add("Content-Type: application/x-www-form-urlencoded; charset=UTF-8") + .add("Referer", baseUrl) + .build() val body = RequestBody.create(null, "action=manga_get_chapters&manga=$mangaId") return client.newCall(POST("$baseUrl/wp-admin/admin-ajax.php", xhrHeaders, body)).execute().asJsoup() } diff --git a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt index 3777273c5..0fe63ef0e 100644 --- a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt +++ b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt @@ -122,7 +122,8 @@ class MadaraFactory : SourceFactory { TurkceManga(), EinherjarScan(), KnightNoScanlation(), - DoujinYosh() + DoujinYosh(), + Manga347() // Removed by request of site owner // EarlyManga(), // MangaGecesi(), @@ -905,3 +906,7 @@ class DoujinYosh : Madara("DoujinYosh", "https://doujinyosh.work", "id") { Genre("Yuri", "yuri") ) } + +class Manga347 : Madara("Manga347", "https://manga347.com", "en", SimpleDateFormat("d MMM, yyyy", Locale.US)) { + override val pageListParseSelector = "li.blocks-gallery-item" +}