diff --git a/src/es/cinecalidad/build.gradle b/src/es/cinecalidad/build.gradle index 0f373828b8..4da981c67f 100644 --- a/src/es/cinecalidad/build.gradle +++ b/src/es/cinecalidad/build.gradle @@ -1,18 +1,26 @@ ext { - extName = 'Cinecalidad' - extClass = '.Cinecalidad' - extVersionCode = 4 + extName = 'CineCalidad' + extClass = '.CineCalidad' + extVersionCode = 5 } apply from: "$rootDir/common.gradle" dependencies { - implementation(project(':lib:streamtape-extractor')) - implementation(project(':lib:voe-extractor')) - implementation(project(':lib:filemoon-extractor')) + implementation(project(':lib:vudeo-extractor')) + implementation(project(':lib:uqload-extractor')) implementation(project(':lib:streamwish-extractor')) + implementation(project(':lib:filemoon-extractor')) + implementation(project(':lib:streamlare-extractor')) + implementation(project(':lib:yourupload-extractor')) + implementation(project(':lib:streamtape-extractor')) implementation(project(':lib:dood-extractor')) - implementation(project(':lib:vidhide-extractor')) + implementation(project(':lib:voe-extractor')) implementation(project(':lib:okru-extractor')) - implementation libs.jsunpacker + implementation(project(':lib:mp4upload-extractor')) + implementation(project(':lib:mixdrop-extractor')) + implementation(project(':lib:burstcloud-extractor')) + implementation(project(':lib:fastream-extractor')) + implementation(project(':lib:upstream-extractor')) + implementation(project(':lib:streamhidevid-extractor')) } \ No newline at end of file diff --git a/src/es/cinecalidad/src/eu/kanade/tachiyomi/animeextension/es/cinecalidad/CineCalidad.kt b/src/es/cinecalidad/src/eu/kanade/tachiyomi/animeextension/es/cinecalidad/CineCalidad.kt new file mode 100644 index 0000000000..9ce7ceaca1 --- /dev/null +++ b/src/es/cinecalidad/src/eu/kanade/tachiyomi/animeextension/es/cinecalidad/CineCalidad.kt @@ -0,0 +1,325 @@ +package eu.kanade.tachiyomi.animeextension.es.cinecalidad + +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.AnimeFilter +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.lib.burstcloudextractor.BurstCloudExtractor +import eu.kanade.tachiyomi.lib.doodextractor.DoodExtractor +import eu.kanade.tachiyomi.lib.fastreamextractor.FastreamExtractor +import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor +import eu.kanade.tachiyomi.lib.mp4uploadextractor.Mp4uploadExtractor +import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor +import eu.kanade.tachiyomi.lib.streamhidevidextractor.StreamHideVidExtractor +import eu.kanade.tachiyomi.lib.streamlareextractor.StreamlareExtractor +import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor +import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor +import eu.kanade.tachiyomi.lib.upstreamextractor.UpstreamExtractor +import eu.kanade.tachiyomi.lib.uqloadextractor.UqloadExtractor +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.HttpUrl.Companion.toHttpUrl +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.util.Calendar + +class CineCalidad : ConfigurableAnimeSource, ParsedAnimeHttpSource() { + + override val name = "CineCalidad" + + override val baseUrl = "https://www.cinecalidad.ec" + + 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( + "YourUpload", "BurstCloud", "Voe", "Mp4Upload", "Doodstream", + "Upload", "BurstCloud", "Upstream", "StreamTape", "Amazon", + "Fastream", "Filemoon", "StreamWish", "Okru", "Streamlare", + ) + + private val REGEX_EPISODE_NAME = "^S(\\d+)-E(\\d+)$".toRegex() + } + + override fun popularAnimeSelector(): String = ".item[data-cf] .custom" + + override fun popularAnimeRequest(page: Int): Request = GET("$baseUrl/page/$page") + + override fun popularAnimeFromElement(element: Element): SAnime { + return SAnime.create().apply { + title = element.select("img").attr("alt") + thumbnail_url = element.select("img").attr("data-src") + setUrlWithoutDomain(element.selectFirst("a")?.attr("href") ?: "") + } + } + + override fun popularAnimeNextPageSelector(): String = ".nextpostslink" + + override fun episodeListParse(response: Response): List { + val document = response.asJsoup() + return if (document.location().contains("ver-pelicula")) { + listOf( + SEpisode.create().apply { + name = "PELÍCULA" + episode_number = 1f + setUrlWithoutDomain(document.location()) + }, + ) + } else { + document.select(".mark-1").mapIndexed { idx, it -> + val epLink = it.select(".episodiotitle a").attr("href") + val epName = it.select(".episodiotitle a").text() + val nameSeasonEpisode = it.select(".numerando").text() + val matchResult = REGEX_EPISODE_NAME.matchEntire(nameSeasonEpisode) + + val episodeName = if (matchResult != null) { + val season = matchResult.groups[1]?.value + val episode = matchResult.groups[2]?.value + "T$season - E$episode - $epName" + } else { + "$nameSeasonEpisode $epName" + } + + SEpisode.create().apply { + name = episodeName + episode_number = idx + 1f + setUrlWithoutDomain(epLink) + } + }.reversed() + } + } + + override fun episodeListSelector() = "uwu" + + override fun episodeFromElement(element: Element) = throw UnsupportedOperationException() + + override fun videoListParse(response: Response): List