diff --git a/src/es/estrenosdoramas/build.gradle b/src/es/estrenosdoramas/build.gradle new file mode 100644 index 0000000000..6b707d9549 --- /dev/null +++ b/src/es/estrenosdoramas/build.gradle @@ -0,0 +1,16 @@ +ext { + extName = 'EstrenosDoramas' + extClass = '.EstrenosDoramas' + extVersionCode = 1 +} + +apply from: "$rootDir/common.gradle" + +dependencies { + implementation(project(':lib:okru-extractor')) + implementation(project(':lib:streamwish-extractor')) + implementation(project(':lib:streamhidevid-extractor')) + implementation(project(':lib:voe-extractor')) + implementation(project(':lib:yourupload-extractor')) + implementation(project(':lib:vidguard-extractor')) +} \ No newline at end of file diff --git a/src/es/estrenosdoramas/res/mipmap-hdpi/ic_launcher.png b/src/es/estrenosdoramas/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..dc6014a2da Binary files /dev/null and b/src/es/estrenosdoramas/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/es/estrenosdoramas/res/mipmap-mdpi/ic_launcher.png b/src/es/estrenosdoramas/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..fb32665b15 Binary files /dev/null and b/src/es/estrenosdoramas/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/es/estrenosdoramas/res/mipmap-xhdpi/ic_launcher.png b/src/es/estrenosdoramas/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..c64a8b267c Binary files /dev/null and b/src/es/estrenosdoramas/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/es/estrenosdoramas/res/mipmap-xxhdpi/ic_launcher.png b/src/es/estrenosdoramas/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..aafd62f165 Binary files /dev/null and b/src/es/estrenosdoramas/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/es/estrenosdoramas/res/mipmap-xxxhdpi/ic_launcher.png b/src/es/estrenosdoramas/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..fe054ec2b1 Binary files /dev/null and b/src/es/estrenosdoramas/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/es/estrenosdoramas/src/eu/kanade/tachiyomi/animeextension/es/estrenosdoramas/EstrenosDoramas.kt b/src/es/estrenosdoramas/src/eu/kanade/tachiyomi/animeextension/es/estrenosdoramas/EstrenosDoramas.kt new file mode 100644 index 0000000000..7a85d1c092 --- /dev/null +++ b/src/es/estrenosdoramas/src/eu/kanade/tachiyomi/animeextension/es/estrenosdoramas/EstrenosDoramas.kt @@ -0,0 +1,220 @@ +package eu.kanade.tachiyomi.animeextension.es.estrenosdoramas + +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.AnimesPage +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.AnimeHttpSource +import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor +import eu.kanade.tachiyomi.lib.streamhidevidextractor.StreamHideVidExtractor +import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor +import eu.kanade.tachiyomi.lib.vidguardextractor.VidGuardExtractor +import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor +import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.util.asJsoup +import eu.kanade.tachiyomi.util.parallelCatchingFlatMapBlocking +import okhttp3.Request +import okhttp3.Response +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get + +class EstrenosDoramas : ConfigurableAnimeSource, AnimeHttpSource() { + + override val name = "EstrenosDoramas" + + override val baseUrl = "https://estrenosdoramas.es" + + override val lang = "es" + + override val supportsLatest = true + + private val preferences: SharedPreferences by lazy { + Injekt.get().getSharedPreferences("source_$id", 0x0000) + } + + companion object { + private const val PREF_QUALITY_KEY = "preferred_quality" + private const val PREF_QUALITY_DEFAULT = "1080" + private val QUALITY_LIST = arrayOf("1080", "720", "480", "360") + + private const val PREF_SERVER_KEY = "preferred_server" + private const val PREF_SERVER_DEFAULT = "Voe" + private val SERVER_LIST = arrayOf( + "StreamWish", + "Voe", + "Okru", + "YourUpload", + "FileLions", + "StreamHideVid", + "VidGuard", + ) + } + + override fun animeDetailsParse(response: Response): SAnime { + val document = response.asJsoup() + return SAnime.create().apply { + title = document.selectFirst(".entry-title")?.text()?.trim() ?: "" + description = document.selectFirst(".mindesc")?.text()?.trim() + genre = document.select(".genxed a").joinToString { it.text() } + thumbnail_url = document.selectFirst(".thumb img")?.attr("abs:src") + document.select(".spe > span").map { + val title = it.select("b").text() + when { + title.contains("Estado") -> status = it.ownText().getStatus() + title.contains("Casts") -> artist = it.select("a").joinToString { it.text() } + title.contains("Network") -> author = it.select("a").joinToString { it.text() } + } + } + } + } + + override fun popularAnimeRequest(page: Int) = GET("$baseUrl/temporadas/?page=$page&order=popular", headers) + + override fun popularAnimeParse(response: Response): AnimesPage { + val document = response.asJsoup() + val elements = document.select(".listupd article a") + val nextPage = document.select(".hpage .r, .pagination .next").any() + val animeList = elements.map { element -> + SAnime.create().apply { + setUrlWithoutDomain(element.attr("abs:href")) + title = element.attr("title") + thumbnail_url = element.selectFirst("img")!!.attr("abs:src") + } + } + return AnimesPage(animeList, nextPage) + } + + override fun latestUpdatesParse(response: Response) = popularAnimeParse(response) + + override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/temporadas/?page=$page&order=latest", headers) + + override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList): Request { + val params = EstrenosDoramasFilters.getSearchParameters(filters) + return when { + query.isNotBlank() -> GET("$baseUrl/page/$page/?s=$query", headers) + params.filter.isNotBlank() -> GET("$baseUrl/temporadas/${params.getQuery()}&page=$page", headers) + else -> popularAnimeRequest(page) + } + } + + override fun searchAnimeParse(response: Response) = popularAnimeParse(response) + + override fun episodeListParse(response: Response): List { + val document = response.asJsoup() + return document.select("#myList li a").mapIndexed { idx, it -> + val title = it.select(".epl-title").text().trim() + val epNumber = try { + """(\d+(\.\d+)?)""".toRegex().find(title)?.groupValues?.get(1)?.toFloat() ?: (idx + 1f) + } catch (_: Exception) { idx + 1f } + + SEpisode.create().apply { + episode_number = epNumber + name = title + scanlator = it.select(".epl-sub span").joinToString { it.text() } + setUrlWithoutDomain(it.attr("abs:href")) + } + } + } + + override fun videoListParse(response: Response): List