Added NyanHentai multisrc (#6712)

* Create NyaHentai.kt

* Create NyaHentaiGenerator.kt

* Added Overrides

* Removed Old files

* Added more Nya Sources

* Added Lang Factorys
This commit is contained in:
Johannes Joens 2021-04-27 00:41:19 +12:00 committed by GitHub
parent 04373a8d47
commit 1befe9c9b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 314 additions and 34 deletions

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.bughentaien
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class BugHentaiEnFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
BugHentaiEnEN(),
BugHentaiEnJA(),
BugHentaiEnZH(),
BugHentaiEnALL(),
)
}
class BugHentaiEnEN : NyaHentai("BugHentai (en)", "https://en.bughentai.com", "en")
class BugHentaiEnJA : NyaHentai("BugHentai (en)", "https://en.bughentai.com", "ja")
class BugHentaiEnZH : NyaHentai("BugHentai (en)", "https://en.bughentai.com", "zh")
class BugHentaiEnALL : NyaHentai("BugHentai (en)", "https://en.bughentai.com", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.bughentaija
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class BugHentaiJaFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
BugHentaiJaEN(),
BugHentaiJaJA(),
BugHentaiJaZH(),
BugHentaiJaALL(),
)
}
class BugHentaiJaEN : NyaHentai("BugHentai (ja)", "https://ja.bughentai.com", "en")
class BugHentaiJaJA : NyaHentai("BugHentai (ja)", "https://ja.bughentai.com", "ja")
class BugHentaiJaZH : NyaHentai("BugHentai (ja)", "https://ja.bughentai.com", "zh")
class BugHentaiJaALL : NyaHentai("BugHentai (ja)", "https://ja.bughentai.com", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.cathentai
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class CatHentaiFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
CatHentaiEN(),
CatHentaiJA(),
CatHentaiZH(),
CatHentaiALL(),
)
}
class CatHentaiEN : NyaHentai("CatHentai", "https://cathentai.com", "en")
class CatHentaiJA : NyaHentai("CatHentai", "https://cathentai.com", "ja")
class CatHentaiZH : NyaHentai("CatHentai", "https://cathentai.com", "zh")
class CatHentaiALL : NyaHentai("CatHentai", "https://cathentai.com", "all")

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.doghentai
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class DogHentaiFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
DogHentaiEN(),
DogHentaiJA(),
DogHentaiZH(),
DogHentaiALL(),
)
}
class DogHentaiEN : NyaHentai("DogHentai", "https://zhb.doghentai.com", "en")
class DogHentaiJA : NyaHentai("DogHentai", "https://zhb.doghentai.com", "ja")
class DogHentaiZH : NyaHentai("DogHentai", "https://zhb.doghentai.com", "zh")
class DogHentaiALL : NyaHentai("DogHentai", "https://zhb.doghentai.com", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.foxhentai
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class FoxHentaiFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
FoxHentaiEN(),
FoxHentaiJA(),
FoxHentaiZH(),
FoxHentaiALL(),
)
}
class FoxHentaiEN : NyaHentai("FoxHentai", "https://ja.foxhentai.com", "en")
class FoxHentaiJA : NyaHentai("FoxHentai", "https://ja.foxhentai.com", "ja")
class FoxHentaiZH : NyaHentai("FoxHentai", "https://ja.foxhentai.com", "zh")
class FoxHentaiALL : NyaHentai("FoxHentai", "https://ja.foxhentai.com", "all")

View File

@ -0,0 +1,20 @@
package eu.kanade.tachiyomi.extension.all.nyahentai
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiEN(),
NyaHentaiJA(),
NyaHentaiZH(),
NyaHentaiALL(),
)
}
class NyaHentaiEN : NyaHentai("NyaHentai", "https://nyahentai.com", "en"){
override val id = 9170089554867447899
}
class NyaHentaiJA : NyaHentai("NyaHentai", "https://nyahentai.com", "ja")
class NyaHentaiZH : NyaHentai("NyaHentai", "https://nyahentai.com", "zh")
class NyaHentaiALL : NyaHentai("NyaHentai", "https://nyahentai.com", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaiclub
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiClubFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiClubEN(),
NyaHentaiClubJA(),
NyaHentaiClubZH(),
NyaHentaiClubALL(),
)
}
class NyaHentaiClubEN : NyaHentai("NyaHentai.club", "https://nyahentai.club", "en")
class NyaHentaiClubJA : NyaHentai("NyaHentai.club", "https://nyahentai.club", "ja")
class NyaHentaiClubZH : NyaHentai("NyaHentai.club", "https://nyahentai.club", "zh")
class NyaHentaiClubALL : NyaHentai("NyaHentai.club", "https://nyahentai.club", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaico
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiCoFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiCoEN(),
NyaHentaiCoJA(),
NyaHentaiCoZH(),
NyaHentaiCoALL(),
)
}
class NyaHentaiCoEN : NyaHentai("NyaHentai.co", "https://nyahentai.co", "en")
class NyaHentaiCoJA : NyaHentai("NyaHentai.co", "https://nyahentai.co", "ja")
class NyaHentaiCoZH : NyaHentai("NyaHentai.co", "https://nyahentai.co", "zh")
class NyaHentaiCoALL : NyaHentai("NyaHentai.co", "https://nyahentai.co", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaifun
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiFunFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiFunEN(),
NyaHentaiFunJA(),
NyaHentaiFunZH(),
NyaHentaiFunALL(),
)
}
class NyaHentaiFunEN : NyaHentai("NyaHentai.fun", "https://nyahentai.fun", "en")
class NyaHentaiFunJA : NyaHentai("NyaHentai.fun", "https://nyahentai.fun", "ja")
class NyaHentaiFunZH : NyaHentai("NyaHentai.fun", "https://nyahentai.fun", "zh")
class NyaHentaiFunALL : NyaHentai("NyaHentai.fun", "https://nyahentai.fun", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaime
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiMeFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiMeEN(),
NyaHentaiMeJA(),
NyaHentaiMeZH(),
NyaHentaiMeALL(),
)
}
class NyaHentaiMeEN : NyaHentai("NyaHentai.me", "https://ja.nyahentai.me", "en")
class NyaHentaiMeJA : NyaHentai("NyaHentai.me", "https://ja.nyahentai.me", "ja")
class NyaHentaiMeZH : NyaHentai("NyaHentai.me", "https://ja.nyahentai.me", "zh")
class NyaHentaiMeALL : NyaHentai("NyaHentai.me", "https://ja.nyahentai.me", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaisite
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiSiteFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiSiteEN(),
NyaHentaiSiteJA(),
NyaHentaiSiteZH(),
NyaHentaiSiteALL(),
)
}
class NyaHentaiSiteEN : NyaHentai("NyaHentai.site", "https://nyahentai.site", "en")
class NyaHentaiSiteJA : NyaHentai("NyaHentai.site", "https://nyahentai.site", "ja")
class NyaHentaiSiteZH : NyaHentai("NyaHentai.site", "https://nyahentai.site", "zh")
class NyaHentaiSiteALL : NyaHentai("NyaHentai.site", "https://nyahentai.site", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaithreecom
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiThreeComFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiThreeComEN(),
NyaHentaiThreeComJA(),
NyaHentaiThreeComZH(),
NyaHentaiThreeComALL(),
)
}
class NyaHentaiThreeComEN : NyaHentai("NyaHentai3.com", "https://nyahentai3.com", "en")
class NyaHentaiThreeComJA : NyaHentai("NyaHentai3.com", "https://nyahentai3.com", "ja")
class NyaHentaiThreeComZH : NyaHentai("NyaHentai3.com", "https://nyahentai3.com", "zh")
class NyaHentaiThreeComALL : NyaHentai("NyaHentai3.com", "https://nyahentai3.com", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.nyahentaitwocom
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class NyaHentaiTwoComFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
NyaHentaiTwoComEN(),
NyaHentaiTwoComJA(),
NyaHentaiTwoComZH(),
NyaHentaiTwoComALL(),
)
}
class NyaHentaiTwoComEN : NyaHentai("NyaHentai2.com", "https://nyahentai2.com", "en")
class NyaHentaiTwoComJA : NyaHentai("NyaHentai2.com", "https://nyahentai2.com", "ja")
class NyaHentaiTwoComZH : NyaHentai("NyaHentai2.com", "https://nyahentai2.com", "zh")
class NyaHentaiTwoComALL : NyaHentai("NyaHentai2.com", "https://nyahentai2.com", "all")

View File

@ -0,0 +1,18 @@
package eu.kanade.tachiyomi.extension.all.qqhentai
import eu.kanade.tachiyomi.multisrc.nyahentai.NyaHentai
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class QQHentaiFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
QQHentaiEN(),
QQHentaiJA(),
QQHentaiZH(),
QQHentaiALL(),
)
}
class QQHentaiEN : NyaHentai("QQHentai", "https://zhb.qqhentai.com", "en")
class QQHentaiJA : NyaHentai("QQHentai", "https://zhb.qqhentai.com", "ja")
class QQHentaiZH : NyaHentai("QQHentai", "https://zhb.qqhentai.com", "zh")
class QQHentaiALL : NyaHentai("QQHentai", "https://zhb.qqhentai.com", "all")

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.en.nyahentai
package eu.kanade.tachiyomi.multisrc.nyahentai
import eu.kanade.tachiyomi.annotations.Nsfw
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
@ -16,19 +15,25 @@ import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
@Nsfw
class NyaHentai : ParsedHttpSource() {
abstract class NyaHentai (
override val name: String,
override val baseUrl: String,
override val lang: String
) : ParsedHttpSource() {
companion object {
const val TAG = "NyaHentai"
}
val nyaLang = when (lang) {
"en" -> "english"
"zh" -> "chinese"
"ja" -> "japanese"
else -> ""
}
override val name = "NyaHentai (en)"
override val baseUrl = "https://nyahentai.com"
val languageUrl = "$baseUrl/language/english"
override val lang = "en"
val languageUrl = when (nyaLang){
"" -> baseUrl
else -> "$baseUrl/language/$nyaLang"
}
override val supportsLatest = true
@ -37,11 +42,7 @@ class NyaHentai : ParsedHttpSource() {
override fun latestUpdatesSelector() = "div.container div.gallery a"
override fun latestUpdatesRequest(page: Int): Request {
return if (page == 1) {
GET(languageUrl, headers)
} else {
GET("$languageUrl/page/$page", headers)
}
return GET("$languageUrl/page/$page", headers)
}
override fun latestUpdatesFromElement(element: Element): SManga {
@ -148,7 +149,10 @@ class NyaHentai : ParsedHttpSource() {
throw UnsupportedOperationException("Not used")
override fun popularMangaRequest(page: Int): Request =
GET("$languageUrl/popular/page/$page", headers)
GET(when (nyaLang){
"" -> "$languageUrl/page/$page"
else -> "$languageUrl/popular/page/$page"
}, headers)
override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element)
@ -161,14 +165,14 @@ class NyaHentai : ParsedHttpSource() {
// TODO: Additional filter options, specifically the type[] parameter
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
// todo: remove "english" from the search query in the future
var url = "$baseUrl/search/q_$query english/page/$page"
var url = "$baseUrl/search/q_$query $nyaLang/page/$page"
if (query.isBlank()) {
filters.forEach { filter ->
when (filter) {
is Tag -> {
url = if (page == 1) {
"$baseUrl/tag/${filter.state}&type[]=3" // "Contents" tag
"$baseUrl/tag/${filter.state}/$nyaLang" // "Contents" tag
} else {
"$tagUrl/page/$page"
}

View File

@ -0,0 +1,37 @@
package eu.kanade.tachiyomi.multisrc.nyahentai
import generator.ThemeSourceData.MultiLang
import generator.ThemeSourceGenerator
class NyaHentaiGenerator : ThemeSourceGenerator {
override val themePkg = "nyahentai"
override val themeClass = "NyaHentai"
override val baseVersionCode: Int = 1
override val sources = listOf(
MultiLang("NyaHentai", "https://nyahentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiFactory", overrideVersionCode = 3),
MultiLang("NyaHentai.site", "https://nyahentai.site", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiSiteFactory", pkgName = "nyahentaisite"),
MultiLang("NyaHentai.me", "https://ja.nyahentai.me", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiMeFactory", pkgName = "nyahentaime"),
MultiLang("NyaHentai.fun", "https://nyahentai.fun", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiFunFactory", pkgName = "nyahentaifun"),
MultiLang("NyaHentai.club", "https://nyahentai.club", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiClubFactory", pkgName = "nyahentaiclub"),
MultiLang("NyaHentai2.com", "https://nyahentai2.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiTwoComFactory", pkgName = "nyahentaitwocom"),
MultiLang("NyaHentai.co", "https://nyahentai.co", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiCoFactory", pkgName = "nyahentaico"),
MultiLang("NyaHentai3.com", "https://nyahentai3.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "NyaHentaiThreeComFactory", pkgName = "nyahentaithreecom"),
MultiLang("CatHentai", "https://cathentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "CatHentaiFactory"),
MultiLang("DogHentai", "https://zhb.doghentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "DogHentaiFactory"),
MultiLang("BugHentai (ja)", "https://ja.bughentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "BugHentaiJaFactory", pkgName = "bughentaija"),
MultiLang("BugHentai (en)", "https://en.bughentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "BugHentaiEnFactory", pkgName = "bughentaien"),
MultiLang("QQHentai", "https://zhb.qqhentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "QQHentaiFactory"),
MultiLang("FoxHentai", "https://ja.foxhentai.com", listOf("en","ja", "zh", "all"), isNsfw = true, className = "FoxHentaiFactory"),
)
companion object {
@JvmStatic
fun main(args: Array<String>) {
NyaHentaiGenerator().createAll()
}
}
}

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="eu.kanade.tachiyomi.extension" />

View File

@ -1,13 +0,0 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
ext {
extName = 'NyaHentai'
pkgNameSuffix = 'en.nyahentai'
extClass = '.NyaHentai'
extVersionCode = 3
libVersion = '1.2'
containsNsfw = true
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB