diff --git a/src/all/ninemanga/build.gradle b/src/all/ninemanga/build.gradle index 80dd166b4..6719c0196 100644 --- a/src/all/ninemanga/build.gradle +++ b/src/all/ninemanga/build.gradle @@ -1,7 +1,11 @@ ext { extName = 'NineManga' extClass = '.NineMangaFactory' - extVersionCode = 19 + extVersionCode = 20 } apply from: "$rootDir/common.gradle" + +dependencies { + implementation(project(":lib:cookieinterceptor")) +} diff --git a/src/all/ninemanga/src/eu/kanade/tachiyomi/extension/all/ninemanga/NineManga.kt b/src/all/ninemanga/src/eu/kanade/tachiyomi/extension/all/ninemanga/NineManga.kt index f48d4231f..639786b62 100644 --- a/src/all/ninemanga/src/eu/kanade/tachiyomi/extension/all/ninemanga/NineManga.kt +++ b/src/all/ninemanga/src/eu/kanade/tachiyomi/extension/all/ninemanga/NineManga.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.extension.all.ninemanga +import eu.kanade.tachiyomi.lib.cookieinterceptor.CookieInterceptor import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList @@ -26,6 +27,8 @@ open class NineManga( override val supportsLatest: Boolean = true + private val cookieInterceptor = CookieInterceptor(baseUrl.substringAfter("://"), "ninemanga_list_num" to "1") + override val client: OkHttpClient = network.client.newBuilder() .addInterceptor { chain -> val request = chain.request() @@ -37,7 +40,9 @@ open class NineManga( return@addInterceptor chain.proceed(newRequest) } chain.proceed(request) - }.build() + } + .addNetworkInterceptor(cookieInterceptor) + .build() override fun headersBuilder(): Headers.Builder = Headers.Builder() .add("Accept-Language", "es-ES,es;q=0.9,en;q=0.8,gl;q=0.7") @@ -97,7 +102,6 @@ open class NineManga( element.select("a.chapter_list_a").let { name = it.text().replace(mangaTitleForCleaning, "", true) url = it.attr("href").substringAfter(baseUrl).replace("%20", " ") - .substringBeforeLast(".html") + "-1-1.html" } date_upload = parseChapterDate(element.select("span").text()) }