diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index 9f5bcba65..c9fcc7c6f 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 = 46 + extVersionCode = 47 libVersion = '1.2' } 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 2f75a2a31..d1ff14591 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 @@ -9,15 +9,10 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.util.asJsoup -import okhttp3.Request -import okhttp3.Response -import okhttp3.HttpUrl -import okhttp3.Headers -import okhttp3.OkHttpClient +import okhttp3.* import org.jsoup.nodes.Element import java.text.SimpleDateFormat -import java.util.Locale -import java.util.Random +import java.util.* class MadaraFactory : SourceFactory { override fun createSources(): List = listOf( @@ -215,8 +210,11 @@ class AdonisFansub : Madara("Adonis Fansub", "https://manga.adonisfansub.com", " class GetManhwa : Madara("GetManhwa", "https://getmanhwa.co", "en") class AllPornComic : Madara("AllPornComic", "https://allporncomic.com", "en") { + override val client: OkHttpClient = network.client + private val userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" override fun headersBuilder(): Headers.Builder = Headers.Builder() - .add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.${Random().nextInt(99)} (KHTML, like Gecko) Chrome/79.0.${Random().nextInt(9999)}.${Random().nextInt(999)} Safari/537.${Random().nextInt(99)}") + .add("User-Agent", userAgent) + .add("Referer", "$baseUrl/manga/?m_orderby=views") override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=views", headers) override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=latest", headers) override fun searchMangaNextPageSelector() = "a[rel=next]"