Update ManaMoa extension (#1894)

Update ManaMoa extension to v1.2.14
This commit is contained in:
DitFranXX 2019-12-23 01:10:39 +09:00 committed by arkon
parent 42a5f6585f
commit a8bb686d2d
5 changed files with 14 additions and 54 deletions

View File

@ -2,10 +2,10 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
appName = 'Tachiyomi: ManaMoa (MangaShow.Me)'
appName = 'Tachiyomi: ManaMoa'
pkgNameSuffix = 'ko.mangashowme'
extClass = '.MSMFactory'
extVersionCode = 13
extClass = '.ManaMoa'
extVersionCode = 14
libVersion = '1.2'
}

View File

@ -1,44 +0,0 @@
package eu.kanade.tachiyomi.extension.ko.mangashowme
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.online.HttpSource
import okhttp3.Response
/*
* Source Factory for before-Migration
*
* I will remove this and only use ManaMoa class after 1.2.15.
* This is just helper who uses =<1.2.11 before.
*
*/
class MSMFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
ManaMoa(),
MSMDeprecated()
)
}
class MSMDeprecated : HttpSource() {
override val name = "MangaShow.Me"
override val baseUrl: String = "https://Depricated._Need.Source.Migration.to.ManaMoa.net"
override val lang: String = "ko"
override val supportsLatest = false
override fun chapterListParse(response: Response) = throw Exception(NEED_MIGRATION)
override fun popularMangaRequest(page: Int) = throw Exception(NEED_MIGRATION)
override fun popularMangaParse(response: Response) = throw Exception(NEED_MIGRATION)
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = throw Exception(NEED_MIGRATION)
override fun searchMangaParse(response: Response) = throw Exception(NEED_MIGRATION)
override fun latestUpdatesRequest(page: Int) = throw Exception(NEED_MIGRATION)
override fun latestUpdatesParse(response: Response) = throw Exception(NEED_MIGRATION)
override fun mangaDetailsParse(response: Response) = throw Exception(NEED_MIGRATION)
override fun imageUrlParse(response: Response) = throw Exception(NEED_MIGRATION)
override fun pageListParse(response: Response) = throw Exception(NEED_MIGRATION)
companion object {
const val NEED_MIGRATION = "Deprecated: Use 'ManaMoa' instead.\nSource migration is on 'My Library' -> three dots -> 'Source migration'"
}
}

View File

@ -132,7 +132,7 @@ fun searchComplexFilterMangaRequestBuilder(baseUrl: String, page: Int, query: St
is SearchStatusList -> {
if (filter.state > 0) {
statusFilter = filter.state - 1
statusFilter = filter.state
}
}
@ -161,4 +161,4 @@ fun searchComplexFilterMangaRequestBuilder(baseUrl: String, page: Int, query: St
}
return GET(url.toString())
}
}

View File

@ -29,15 +29,19 @@ private class RequestHandler(val chain: Interceptor.Chain) {
}
private fun getRequest(url: String): Response = when {
"filecdn.xyz" in url || "chickencdn.info" in url
-> ownCDNRequestHandler(url)
".xyz/" in url -> ownCDNRequestHandler(url)
else -> outsideRequestHandler(url)
}
private fun ownCDNRequestHandler(url: String): Response {
val res = proceedRequest(url)
return if (!isSuccess(res)) {
proceedRequest(url.replace("img.", "s3.")) // s3
val s3url = if (url.contains("img.")) {
url.replace("img.", "s3.")
} else {
url.replace("://", "://s3.")
}
proceedRequest(s3url) // s3
} else res
}
@ -54,4 +58,4 @@ private class RequestHandler(val chain: Interceptor.Chain) {
.removeHeader("SecondUrlToRequest")
.build()!!
)
}
}

View File

@ -40,7 +40,7 @@ class ManaMoa : ConfigurableSource, ParsedHttpSource() {
override val name = "ManaMoa"
// This keeps updating: https://twitter.com/manamoa20
private val defaultBaseUrl = "https://manamoa13.net"
private val defaultBaseUrl = "https://manamoa22.net"
override val baseUrl by lazy { getPrefBaseUrl() }
override val lang: String = "ko"