diff --git a/src/en/hentaimama/AndroidManifest.xml b/src/en/hentaimama/AndroidManifest.xml new file mode 100644 index 000000000..acb4de356 --- /dev/null +++ b/src/en/hentaimama/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/en/hentaimama/build.gradle b/src/en/hentaimama/build.gradle new file mode 100644 index 000000000..323301721 --- /dev/null +++ b/src/en/hentaimama/build.gradle @@ -0,0 +1,13 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' + +ext { + extName = 'HentaiMama' + pkgNameSuffix = 'en.hentaimama' + extClass = '.HentaiMama' + extVersionCode = 1 + libVersion = '12' + containsNsfw = true +} + +apply from: "$rootDir/common.gradle" diff --git a/src/en/hentaimama/ic_launcher-playstore.png b/src/en/hentaimama/ic_launcher-playstore.png new file mode 100644 index 000000000..a3de5ca08 Binary files /dev/null and b/src/en/hentaimama/ic_launcher-playstore.png differ diff --git a/src/en/hentaimama/res/mipmap-anydpi-v26/ic_launcher.xml b/src/en/hentaimama/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 000000000..036d09bc5 --- /dev/null +++ b/src/en/hentaimama/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/en/hentaimama/res/mipmap-anydpi-v26/ic_launcher_round.xml b/src/en/hentaimama/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 000000000..036d09bc5 --- /dev/null +++ b/src/en/hentaimama/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/en/hentaimama/res/mipmap-hdpi/ic_launcher_foreground.png b/src/en/hentaimama/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..418da6ce2 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/src/en/hentaimama/res/mipmap-hdpi/ic_launcher_round.png b/src/en/hentaimama/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 000000000..8ca1cd562 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/src/en/hentaimama/res/mipmap-mdpi/ic_launcher_foreground.png b/src/en/hentaimama/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..2c1fab36d Binary files /dev/null and b/src/en/hentaimama/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/src/en/hentaimama/res/mipmap-mdpi/ic_launcher_round.png b/src/en/hentaimama/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 000000000..a3b9b3219 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/src/en/hentaimama/res/mipmap-xhdpi/ic_launcher_foreground.png b/src/en/hentaimama/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..c30ff9452 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/src/en/hentaimama/res/mipmap-xhdpi/ic_launcher_round.png b/src/en/hentaimama/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 000000000..8237f01ae Binary files /dev/null and b/src/en/hentaimama/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher_foreground.png b/src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..f595a1229 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher_round.png b/src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 000000000..307a33734 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..b3db68f21 Binary files /dev/null and b/src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher_round.png b/src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 000000000..82837f27a Binary files /dev/null and b/src/en/hentaimama/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/src/en/hentaimama/res/values/ic_launcher_background.xml b/src/en/hentaimama/res/values/ic_launcher_background.xml new file mode 100644 index 000000000..34b3e0683 --- /dev/null +++ b/src/en/hentaimama/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #0F0F0F + \ No newline at end of file diff --git a/src/en/hentaimama/src/eu/kanade/tachiyomi/animeextension/en/hentaimama/HentaiMama.kt b/src/en/hentaimama/src/eu/kanade/tachiyomi/animeextension/en/hentaimama/HentaiMama.kt new file mode 100644 index 000000000..f55cbc825 --- /dev/null +++ b/src/en/hentaimama/src/eu/kanade/tachiyomi/animeextension/en/hentaimama/HentaiMama.kt @@ -0,0 +1,231 @@ +package eu.kanade.tachiyomi.animeextension.en.hentaimama + +import android.app.Application +import android.content.SharedPreferences +import androidx.preference.ListPreference +import androidx.preference.PreferenceScreen +import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource +import eu.kanade.tachiyomi.animesource.model.AnimeFilterList +import eu.kanade.tachiyomi.animesource.model.SAnime +import eu.kanade.tachiyomi.animesource.model.SEpisode +import eu.kanade.tachiyomi.animesource.model.Video +import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.POST +import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.FormBody +import okhttp3.Headers +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get +import java.text.SimpleDateFormat + +class HentaiMama : ConfigurableAnimeSource, ParsedAnimeHttpSource() { + + override val name = "HentaiMama" + + override val baseUrl = "https://hentaimama.io" + + override val lang = "en" + + override val supportsLatest = true + + override val client: OkHttpClient = network.cloudflareClient + + private val preferences: SharedPreferences by lazy { + Injekt.get().getSharedPreferences("source_$id", 0x0000) + } + + override fun headersBuilder(): Headers.Builder { + return super.headersBuilder() + .add("Referer", baseUrl) + } + + // Popular Anime + + override fun popularAnimeSelector(): String = "article.tvshows" + + override fun popularAnimeRequest(page: Int): Request = + GET("$baseUrl/advance-search/page/$page/?submit=Submit&filter=weekly") + + override fun popularAnimeFromElement(element: Element): SAnime { + val anime = SAnime.create() + 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 + } + + override fun popularAnimeNextPageSelector(): String = "div.pagination-wraper div.resppages a" + + // episodes + + override fun episodeListParse(response: Response): List { + return super.episodeListParse(response).reversed() + } + + override fun episodeListSelector() = "div.series div.items article" + + override fun episodeFromElement(element: Element): SEpisode { + val episode = SEpisode.create() + 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.date_upload = date.time + episode.episode_number = when { + (epNum.isNotEmpty()) -> epNum.toFloat() + else -> 1F + } + + return episode + } + + // Video Extractor + + override fun videoListParse(response: Response): List