HentaiMama extension update (#668)
Co-authored-by: jmir1 <jhmiramon@gmail.com>
This commit is contained in:
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'HentaiMama'
|
||||
pkgNameSuffix = 'en.hentaimama'
|
||||
extClass = '.HentaiMama'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
libVersion = '12'
|
||||
containsNsfw = true
|
||||
}
|
||||
|
BIN
src/en/hentaimama/res/mipmap-hdpi/ic_launcher.png
Normal file
BIN
src/en/hentaimama/res/mipmap-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
src/en/hentaimama/res/mipmap-mdpi/ic_launcher.png
Normal file
BIN
src/en/hentaimama/res/mipmap-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
src/en/hentaimama/res/mipmap-xhdpi/ic_launcher.png
Normal file
BIN
src/en/hentaimama/res/mipmap-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
BIN
src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher.png
Normal file
BIN
src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
BIN
src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
@ -5,6 +5,7 @@ import android.content.SharedPreferences
|
||||
import androidx.preference.ListPreference
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
@ -75,7 +76,7 @@ class HentaiMama : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
val epNum = element.select("div.season_m a span.c").text().removePrefix("Episode ")
|
||||
val date = SimpleDateFormat("MMM. dd, yyyy").parse(element.select("div.data > span").text())
|
||||
episode.setUrlWithoutDomain(element.select("div.season_m a").attr("href"))
|
||||
episode.name = element.select("div.season_m a span.c").text()
|
||||
episode.name = element.select("div.data h3").text()
|
||||
episode.date_upload = date.time
|
||||
episode.episode_number = when {
|
||||
(epNum.isNotEmpty()) -> epNum.toFloat()
|
||||
@ -153,21 +154,45 @@ class HentaiMama : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
override fun videoUrlParse(document: Document) = throw Exception("not used")
|
||||
|
||||
// Search
|
||||
private var filterSearch = false
|
||||
|
||||
override fun searchAnimeFromElement(element: Element): SAnime {
|
||||
val anime = SAnime.create()
|
||||
anime.setUrlWithoutDomain(element.select("div.details > div.title a").attr("href"))
|
||||
anime.thumbnail_url = element.select("div.image div a img").attr("src")
|
||||
anime.title = element.select("div.details > div.title a").text()
|
||||
return anime
|
||||
if (filterSearch) {
|
||||
// filter search
|
||||
anime.setUrlWithoutDomain(element.select("a").attr("href"))
|
||||
anime.title = element.select("div.data h3 a").text()
|
||||
anime.thumbnail_url = element.select("div.poster img").attr("data-src")
|
||||
return anime
|
||||
} else {
|
||||
// normal search
|
||||
anime.setUrlWithoutDomain(element.select("div.details > div.title a").attr("href"))
|
||||
anime.thumbnail_url = element.select("div.image div a img").attr("src")
|
||||
anime.title = element.select("div.details > div.title a").text()
|
||||
return anime
|
||||
}
|
||||
}
|
||||
|
||||
override fun searchAnimeNextPageSelector(): String = "link[rel=next]"
|
||||
override fun searchAnimeNextPageSelector(): String {
|
||||
return if (filterSearch) {
|
||||
"div.pagination-wraper div.resppages a" // filter search
|
||||
} else {
|
||||
"link[rel=next]" // normal search
|
||||
}
|
||||
}
|
||||
|
||||
override fun searchAnimeSelector(): String = "article"
|
||||
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request =
|
||||
GET("$baseUrl/page/$page/?s=${query.replace(("[\\W]").toRegex(), " ")}")
|
||||
override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request {
|
||||
val parameters = getSearchParameters(filters)
|
||||
return if (query.isNotEmpty()) {
|
||||
filterSearch = false
|
||||
GET("$baseUrl/page/$page/?s=${query.replace(("[\\W]").toRegex(), " ")}") // regular search
|
||||
} else {
|
||||
filterSearch = true
|
||||
GET("$baseUrl/advance-search/page/$page/?$parameters") // filter search
|
||||
}
|
||||
}
|
||||
|
||||
// Details
|
||||
|
||||
@ -228,4 +253,326 @@ class HentaiMama : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
||||
}
|
||||
screen.addPreference(videoQualityPref)
|
||||
}
|
||||
|
||||
// Filters
|
||||
|
||||
internal class Genre(val id: String) : AnimeFilter.CheckBox(id)
|
||||
private class GenreList(genres: List<Genre>) : AnimeFilter.Group<Genre>("Genre", genres)
|
||||
private fun getGenres() = listOf(
|
||||
Genre("3D"),
|
||||
Genre("Action"),
|
||||
Genre("Adventure"),
|
||||
Genre("Ahegao"),
|
||||
Genre("Anal"),
|
||||
Genre("Animal Ears"),
|
||||
Genre("Beastiality"),
|
||||
Genre("Blackmail"),
|
||||
Genre("Blowjob"),
|
||||
Genre("Bondage"),
|
||||
Genre("Brainwashed"),
|
||||
Genre("Bukakke"),
|
||||
Genre("Cat Girl"),
|
||||
Genre("Comedy"),
|
||||
Genre("Cosplay"),
|
||||
Genre("Creampie"),
|
||||
Genre("Cross-dressing"),
|
||||
Genre("Dark Skin"),
|
||||
Genre("DeepThroat"),
|
||||
Genre("Demons"),
|
||||
Genre("Doctor"),
|
||||
Genre("Double Penatration"),
|
||||
Genre("Drama"),
|
||||
Genre("Dubbed"),
|
||||
Genre("Ecchi"),
|
||||
Genre("Elf"),
|
||||
Genre("Eroge"),
|
||||
Genre("Facesitting"),
|
||||
Genre("Facial"),
|
||||
Genre("Fantasy"),
|
||||
Genre("Female Doctor"),
|
||||
Genre("Female Teacher"),
|
||||
Genre("Femdom"),
|
||||
Genre("Footjob"),
|
||||
Genre("Futanari"),
|
||||
Genre("Gangbang"),
|
||||
Genre("Gore"),
|
||||
Genre("Gyaru"),
|
||||
Genre("Harem"),
|
||||
Genre("Historical"),
|
||||
Genre("Horny Slut"),
|
||||
Genre("Housewife"),
|
||||
Genre("Humiliation"),
|
||||
Genre("Incest"),
|
||||
Genre("Inflation"),
|
||||
Genre("Internal Cumshot"),
|
||||
Genre("Lactation"),
|
||||
Genre("Large Breasts"),
|
||||
Genre("Lolicon"),
|
||||
Genre("Magical Girls"),
|
||||
Genre("Maid"),
|
||||
Genre("Martial Arts"),
|
||||
Genre("Megane"),
|
||||
Genre("MILF"),
|
||||
Genre("Mind Break"),
|
||||
Genre("Molestation"),
|
||||
Genre("Non-Japanese"),
|
||||
Genre("NTR"),
|
||||
Genre("Nuns"),
|
||||
Genre("Nurses"),
|
||||
Genre("Office Ladies"),
|
||||
Genre("Police"),
|
||||
Genre("POV"),
|
||||
Genre("Pregnant"),
|
||||
Genre("Princess"),
|
||||
Genre("Public Sex"),
|
||||
Genre("Rape"),
|
||||
Genre("Rim job"),
|
||||
Genre("Romance"),
|
||||
Genre("Scat"),
|
||||
Genre("School Girls"),
|
||||
Genre("Sci-Fi"),
|
||||
Genre("Shimapan"),
|
||||
Genre("Short"),
|
||||
Genre("Shoutacon"),
|
||||
Genre("Slaves"),
|
||||
Genre("Sports"),
|
||||
Genre("Squirting"),
|
||||
Genre("Stocking"),
|
||||
Genre("Strap-on"),
|
||||
Genre("Strapped On"),
|
||||
Genre("Succubus"),
|
||||
Genre("Super Power"),
|
||||
Genre("Supernatural"),
|
||||
Genre("Swimsuit"),
|
||||
Genre("Tentacles"),
|
||||
Genre("Three some"),
|
||||
Genre("Tits Fuck"),
|
||||
Genre("Torture"),
|
||||
Genre("Toys"),
|
||||
Genre("Train Molestation"),
|
||||
Genre("Tsundere"),
|
||||
Genre("Uncensored"),
|
||||
Genre("Urination"),
|
||||
Genre("Vampire"),
|
||||
Genre("Vanilla"),
|
||||
Genre("Virgins"),
|
||||
Genre("Widow"),
|
||||
Genre("X-Ray"),
|
||||
Genre("Yuri"),
|
||||
)
|
||||
|
||||
internal class Year(val id: String) : AnimeFilter.CheckBox(id)
|
||||
private class YearList(years: List<Year>) : AnimeFilter.Group<Year>("Year", years)
|
||||
private fun getYears() = listOf(
|
||||
Year("2022"),
|
||||
Year("2021"),
|
||||
Year("2020"),
|
||||
Year("2019"),
|
||||
Year("2018"),
|
||||
Year("2017"),
|
||||
Year("2016"),
|
||||
Year("2015"),
|
||||
Year("2014"),
|
||||
Year("2013"),
|
||||
Year("2012"),
|
||||
Year("2011"),
|
||||
Year("2010"),
|
||||
Year("2009"),
|
||||
Year("2008"),
|
||||
Year("2007"),
|
||||
Year("2006"),
|
||||
Year("2005"),
|
||||
Year("2004"),
|
||||
Year("2003"),
|
||||
Year("2002"),
|
||||
Year("2001"),
|
||||
Year("2000"),
|
||||
Year("1999"),
|
||||
Year("1998"),
|
||||
Year("1997"),
|
||||
Year("1996"),
|
||||
Year("1995"),
|
||||
Year("1994"),
|
||||
Year("1993"),
|
||||
Year("1992"),
|
||||
Year("1991"),
|
||||
Year("1987"),
|
||||
)
|
||||
|
||||
internal class Producer(val id: String) : AnimeFilter.CheckBox(id)
|
||||
private class ProducerList(producers: List<Producer>) : AnimeFilter.Group<Producer>("Producer", producers)
|
||||
private fun getProducer() = listOf(
|
||||
Producer("8bit"),
|
||||
Producer("Actas"),
|
||||
Producer("Active"),
|
||||
Producer("AIC"),
|
||||
Producer("AIC A.S.T.A."),
|
||||
Producer("Alice Soft"),
|
||||
Producer("An DerCen"),
|
||||
Producer("Angelfish"),
|
||||
Producer("Animac"),
|
||||
Producer("AniMan"),
|
||||
Producer("Animax"),
|
||||
Producer("Antechinus"),
|
||||
Producer("APPP"),
|
||||
Producer("Armor"),
|
||||
Producer("Arms"),
|
||||
Producer("Asahi Production"),
|
||||
Producer("AT-2"),
|
||||
Producer("Blue Eyes"),
|
||||
Producer("BOMB! CUTE! BOMB!"),
|
||||
Producer("BOOTLEG"),
|
||||
Producer("Bunnywalker"),
|
||||
Producer("Central Park Media"),
|
||||
Producer("CherryLips"),
|
||||
Producer("ChiChinoya"),
|
||||
Producer("Chippai"),
|
||||
Producer("ChuChu"),
|
||||
Producer("Circle Tribute"),
|
||||
Producer("CLOCKUP"),
|
||||
Producer("Collaboration Works"),
|
||||
Producer("Comic Media"),
|
||||
Producer("Cosmic Ray"),
|
||||
Producer("Cosmo"),
|
||||
Producer("Cotton Doll"),
|
||||
Producer("Cranberry"),
|
||||
Producer("D3"),
|
||||
Producer("Daiei"),
|
||||
Producer("Digital Works"),
|
||||
Producer("Discovery"),
|
||||
Producer("Dream Force"),
|
||||
Producer("Dubbed"),
|
||||
Producer("Easy Film"),
|
||||
Producer("Echo"),
|
||||
Producer("EDGE"),
|
||||
Producer("Filmlink International"),
|
||||
Producer("Five Ways"),
|
||||
Producer("Front Line"),
|
||||
Producer("Frontier Works"),
|
||||
Producer("Godoy"),
|
||||
Producer("Gold Bear"),
|
||||
Producer("Green Bunny"),
|
||||
Producer("Himajin Planning"),
|
||||
Producer("Hokiboshi"),
|
||||
Producer("Hoods Entertainment"),
|
||||
Producer("Horipro"),
|
||||
Producer("Hot Bear"),
|
||||
Producer("HydraFXX"),
|
||||
Producer("Innocent Grey"),
|
||||
Producer("Jam"),
|
||||
Producer("JapanAnime"),
|
||||
Producer("King Bee"),
|
||||
Producer("Kitty Films"),
|
||||
Producer("Kitty Media"),
|
||||
Producer("Knack Productions"),
|
||||
Producer("KSS"),
|
||||
Producer("Lemon Heart"),
|
||||
Producer("Lune Pictures"),
|
||||
Producer("Majin"),
|
||||
Producer("Marvelous Entertainment"),
|
||||
Producer("Mary Jane"),
|
||||
Producer("Media"),
|
||||
Producer("Media Blasters"),
|
||||
Producer("Milkshake"),
|
||||
Producer("Mitsu"),
|
||||
Producer("Moonstone Cherry"),
|
||||
Producer("Mousou Senka"),
|
||||
Producer("MS Pictures"),
|
||||
Producer("Nihikime no Dozeu"),
|
||||
Producer("Nur"),
|
||||
Producer("NuTech Digital"),
|
||||
Producer("Obtain Future"),
|
||||
Producer("Office Take Off"),
|
||||
Producer("OLE-M"),
|
||||
Producer("Oriental Light and Magic"),
|
||||
Producer("Oz"),
|
||||
Producer("Pashmina"),
|
||||
Producer("Pink Pineapple"),
|
||||
Producer("Pixy"),
|
||||
Producer("PoRO"),
|
||||
Producer("Production I.G"),
|
||||
Producer("Queen Bee"),
|
||||
Producer("Sakura Purin Animation"),
|
||||
Producer("Schoolzone"),
|
||||
Producer("Selfish"),
|
||||
Producer("Seven"),
|
||||
Producer("Shelf"),
|
||||
Producer("Shinkuukan"),
|
||||
Producer("Shinyusha"),
|
||||
Producer("Shouten"),
|
||||
Producer("Silky’s"),
|
||||
Producer("Soft Garage"),
|
||||
Producer("SoftCel Pictures"),
|
||||
Producer("SPEED"),
|
||||
Producer("Studio 9 Maiami"),
|
||||
Producer("Studio Eromatick"),
|
||||
Producer("Studio Fantasia"),
|
||||
Producer("Studio Jack"),
|
||||
Producer("Studio Kyuuma"),
|
||||
Producer("Studio Matrix"),
|
||||
Producer("Studio Sign"),
|
||||
Producer("Studio Tulip"),
|
||||
Producer("Studio Unicorn"),
|
||||
Producer("Suzuki Mirano"),
|
||||
Producer("T-Rex"),
|
||||
Producer("The Right Stuf International"),
|
||||
Producer("Toho Company"),
|
||||
Producer("Top-Marschal"),
|
||||
Producer("Toranoana"),
|
||||
Producer("Toshiba Entertainment"),
|
||||
Producer("Triangle Bitter"),
|
||||
Producer("Triple X"),
|
||||
Producer("Union Cho"),
|
||||
Producer("Valkyria"),
|
||||
Producer("White Bear"),
|
||||
Producer("Y.O.U.C"),
|
||||
Producer("ZIZ Entertainment"),
|
||||
Producer("Zyc"),
|
||||
|
||||
)
|
||||
|
||||
private fun getSearchParameters(filters: AnimeFilterList): String {
|
||||
var totalstring = ""
|
||||
|
||||
filters.forEach { filter ->
|
||||
when (filter) {
|
||||
is GenreList -> { // ---Genre
|
||||
filter.state.forEach { Genre ->
|
||||
if (Genre.state) {
|
||||
totalstring =
|
||||
totalstring + "&genres_filter%5B" + "%5D=" + Genre.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is YearList -> { // ---Year
|
||||
filter.state.forEach { Year ->
|
||||
if (Year.state) {
|
||||
totalstring =
|
||||
totalstring + "&years_filter%5B" + "%5D=" + Year.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is ProducerList -> { // ---Producer
|
||||
filter.state.forEach { Producer ->
|
||||
if (Producer.state) {
|
||||
totalstring =
|
||||
totalstring + "&studios_filter%5B" + "%5D=" + Producer.id
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
return "$totalstring&submit=Submit"
|
||||
}
|
||||
|
||||
override fun getFilterList(): AnimeFilterList = AnimeFilterList(
|
||||
AnimeFilter.Header("Ignored if using Text Search"),
|
||||
AnimeFilter.Separator(),
|
||||
GenreList(getGenres()),
|
||||
YearList(getYears()),
|
||||
ProducerList(getProducer()),
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user