|
|
@ -1,12 +1,12 @@
|
|
|
|
package eu.kanade.tachiyomi.animeextension.hi.yomovies
|
|
|
|
package eu.kanade.tachiyomi.animeextension.hi.yomovies
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.Application
|
|
|
|
import android.app.Application
|
|
|
|
import android.content.SharedPreferences
|
|
|
|
|
|
|
|
import android.widget.Toast
|
|
|
|
import android.widget.Toast
|
|
|
|
import androidx.preference.EditTextPreference
|
|
|
|
import androidx.preference.EditTextPreference
|
|
|
|
import androidx.preference.ListPreference
|
|
|
|
import androidx.preference.ListPreference
|
|
|
|
import androidx.preference.PreferenceScreen
|
|
|
|
import androidx.preference.PreferenceScreen
|
|
|
|
import eu.kanade.tachiyomi.AppInfo
|
|
|
|
import eu.kanade.tachiyomi.AppInfo
|
|
|
|
|
|
|
|
import eu.kanade.tachiyomi.animeextension.hi.yomovies.extractors.MinoplresExtractor
|
|
|
|
import eu.kanade.tachiyomi.animeextension.hi.yomovies.extractors.MovembedExtractor
|
|
|
|
import eu.kanade.tachiyomi.animeextension.hi.yomovies.extractors.MovembedExtractor
|
|
|
|
import eu.kanade.tachiyomi.animeextension.hi.yomovies.extractors.SpeedostreamExtractor
|
|
|
|
import eu.kanade.tachiyomi.animeextension.hi.yomovies.extractors.SpeedostreamExtractor
|
|
|
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
|
|
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
|
|
@ -44,7 +44,7 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
|
|
|
|
|
|
|
|
override val client: OkHttpClient = network.cloudflareClient
|
|
|
|
override val client: OkHttpClient = network.cloudflareClient
|
|
|
|
|
|
|
|
|
|
|
|
private val preferences: SharedPreferences by lazy {
|
|
|
|
private val preferences by lazy {
|
|
|
|
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
|
|
|
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +108,7 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
// ============================== Episodes ==============================
|
|
|
|
// ============================== Episodes ==============================
|
|
|
|
|
|
|
|
|
|
|
|
override fun episodeListParse(response: Response): List<SEpisode> {
|
|
|
|
override fun episodeListParse(response: Response): List<SEpisode> {
|
|
|
|
val document = response.asJsoup()
|
|
|
|
val document = response.use { it.asJsoup() }
|
|
|
|
val episodeList = mutableListOf<SEpisode>()
|
|
|
|
val episodeList = mutableListOf<SEpisode>()
|
|
|
|
|
|
|
|
|
|
|
|
val seasonList = document.select("div#seasons > div.tvseason")
|
|
|
|
val seasonList = document.select("div#seasons > div.tvseason")
|
|
|
@ -149,7 +149,7 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
// ============================ Video Links =============================
|
|
|
|
// ============================ Video Links =============================
|
|
|
|
|
|
|
|
|
|
|
|
override fun videoListParse(response: Response): List<Video> {
|
|
|
|
override fun videoListParse(response: Response): List<Video> {
|
|
|
|
val document = response.asJsoup()
|
|
|
|
val document = response.use { it.asJsoup() }
|
|
|
|
|
|
|
|
|
|
|
|
val videoList = document.select("div[id*=tab]:has(div.movieplay > iframe)").parallelMap { server ->
|
|
|
|
val videoList = document.select("div[id*=tab]:has(div.movieplay > iframe)").parallelMap { server ->
|
|
|
|
val iframe = server.selectFirst("div.movieplay > iframe")!!
|
|
|
|
val iframe = server.selectFirst("div.movieplay > iframe")!!
|
|
|
@ -176,6 +176,10 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
iframeUrl.contains("movembed.cc") -> {
|
|
|
|
iframeUrl.contains("movembed.cc") -> {
|
|
|
|
MovembedExtractor(client, headers).videosFromUrl(iframeUrl)
|
|
|
|
MovembedExtractor(client, headers).videosFromUrl(iframeUrl)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iframeUrl.contains("minoplres") -> {
|
|
|
|
|
|
|
|
MinoplresExtractor(client, headers).videosFromUrl(iframeUrl, name)
|
|
|
|
|
|
|
|
}
|
|
|
|
else -> emptyList()
|
|
|
|
else -> emptyList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -202,7 +206,7 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
override fun List<Video>.sort(): List<Video> {
|
|
|
|
override fun List<Video>.sort(): List<Video> {
|
|
|
|
val quality = preferences.getString(PREF_QUALITY_KEY, PREF_QUALITY_DEFAULT)!!
|
|
|
|
val quality = preferences.getString(PREF_QUALITY_KEY, PREF_QUALITY_DEFAULT)!!
|
|
|
|
|
|
|
|
|
|
|
|
return this.sortedWith(
|
|
|
|
return sortedWith(
|
|
|
|
compareBy(
|
|
|
|
compareBy(
|
|
|
|
{ it.quality.contains(quality) },
|
|
|
|
{ it.quality.contains(quality) },
|
|
|
|
{ Regex("""(\d+)p""").find(it.quality)?.groupValues?.get(1)?.toIntOrNull() ?: 0 },
|
|
|
|
{ Regex("""(\d+)p""").find(it.quality)?.groupValues?.get(1)?.toIntOrNull() ?: 0 },
|
|
|
@ -211,7 +215,7 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// From Dopebox
|
|
|
|
// From Dopebox
|
|
|
|
private fun <A, B> Iterable<A>.parallelMap(f: suspend (A) -> B): List<B> =
|
|
|
|
private inline fun <A, B> Iterable<A>.parallelMap(crossinline f: suspend (A) -> B): List<B> =
|
|
|
|
runBlocking {
|
|
|
|
runBlocking {
|
|
|
|
map { async(Dispatchers.Default) { f(it) } }.awaitAll()
|
|
|
|
map { async(Dispatchers.Default) { f(it) } }.awaitAll()
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -219,7 +223,7 @@ class YoMovies : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|
|
|
companion object {
|
|
|
|
companion object {
|
|
|
|
private val PREF_DOMAIN_KEY = "preferred_domain_name_v${AppInfo.getVersionName()}"
|
|
|
|
private val PREF_DOMAIN_KEY = "preferred_domain_name_v${AppInfo.getVersionName()}"
|
|
|
|
private const val PREF_DOMAIN_TITLE = "Override BaseUrl"
|
|
|
|
private const val PREF_DOMAIN_TITLE = "Override BaseUrl"
|
|
|
|
private const val PREF_DOMAIN_DEFAULT = "https://yomovies.baby"
|
|
|
|
private const val PREF_DOMAIN_DEFAULT = "https://yomovies.cheap"
|
|
|
|
private const val PREF_DOMAIN_SUMMARY = "For temporary uses. Updating the extension will erase this setting."
|
|
|
|
private const val PREF_DOMAIN_SUMMARY = "For temporary uses. Updating the extension will erase this setting."
|
|
|
|
|
|
|
|
|
|
|
|
private const val PREF_QUALITY_KEY = "preferred_quality"
|
|
|
|
private const val PREF_QUALITY_KEY = "preferred_quality"
|
|
|
|