Skip to content

Commit

Permalink
feat(src/es): Implementation universal extractor in extensions Part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark25 committed Sep 12, 2024
1 parent 43f3a7c commit 32cccd7
Show file tree
Hide file tree
Showing 23 changed files with 259 additions and 181 deletions.
3 changes: 2 additions & 1 deletion src/es/animefenix/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Animefenix'
extClass = '.Animefenix'
extVersionCode = 46
extVersionCode = 47
}

apply from: "$rootDir/common.gradle"
Expand All @@ -21,4 +21,5 @@ dependencies {
implementation(project(':lib:dood-extractor'))
implementation(project(':lib:upstream-extractor'))
implementation(project(':lib:streamhidevid-extractor'))
implementation(project(':lib:universal-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ 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.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.lib.upstreamextractor.UpstreamExtractor
import eu.kanade.tachiyomi.lib.uqloadextractor.UqloadExtractor
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
Expand Down Expand Up @@ -232,6 +233,10 @@ class Animefenix : ConfigurableAnimeSource, AnimeHttpSource() {
StreamWishExtractor(client, headers).videosFromUrl(url, videoNameGen = { "FileLions:$it" }).also(videoList::addAll)
}
} catch (_: Exception) { }

if (videoList.isEmpty()) {
UniversalExtractor(client).videosFromUrl(url, headers).let { videoList.addAll(it) }
}
return videoList
}

Expand Down
3 changes: 2 additions & 1 deletion src/es/animeid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
ext {
extName = 'AnimeID'
extClass = '.AnimeID'
extVersionCode = 11
extVersionCode = 12
}

apply from: "$rootDir/common.gradle"

dependencies {
implementation(project(':lib:streamtape-extractor'))
implementation(project(':lib:streamwish-extractor'))
implementation(project(':lib:universal-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
import eu.kanade.tachiyomi.lib.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.util.asJsoup
import kotlinx.serialization.json.Json
Expand Down Expand Up @@ -120,6 +121,7 @@ class AnimeID : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
// ============================ Video Links =============================
private val streamwishExtractor by lazy { StreamWishExtractor(client, headers) }
private val streamtapeExtractor by lazy { StreamTapeExtractor(client) }
private val universalExtractor by lazy { UniversalExtractor(client) }

override fun videoListParse(response: Response): List<Video> {
val document = response.asJsoup()
Expand All @@ -128,11 +130,10 @@ class AnimeID : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
val jsonString = script.attr("data")
val jsonUnescape = unescapeJava(jsonString)!!.replace("\\", "")
val url = fetchUrls(jsonUnescape).firstOrNull()?.replace("\\\\", "\\") ?: ""
if (url.contains("streamtape") || url.contains("tape") || url.contains("stp")) {
streamtapeExtractor.videosFromUrl(url).also(videoList::addAll)
}
if (url.contains("wish") || url.contains("fviplions") || url.contains("obeywish")) {
streamwishExtractor.videosFromUrl(url, videoNameGen = { "StreamWish:$it" }).also(videoList::addAll)
return when {
url.contains("streamtape") || url.contains("tape") || url.contains("stp") -> streamtapeExtractor.videosFromUrl(url)
url.contains("wish") || url.contains("fviplions") || url.contains("obeywish") -> streamwishExtractor.videosFromUrl(url, videoNameGen = { "StreamWish:$it" })
else -> universalExtractor.videosFromUrl(url, headers)
}
}
return videoList
Expand Down
3 changes: 2 additions & 1 deletion src/es/animemovil/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AnimeMovil'
extClass = '.AnimeMovil'
extVersionCode = 23
extVersionCode = 24
}

apply from: "$rootDir/common.gradle"
Expand All @@ -20,4 +20,5 @@ dependencies {
implementation(project(':lib:streamtape-extractor'))
implementation(project(':lib:playlist-utils'))
implementation(project(':lib:streamlare-extractor'))
implementation(project(':lib:universal-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.animeextension.es.animemovil

import android.app.Application
import android.content.SharedPreferences
import android.util.Log
import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
Expand All @@ -20,6 +21,7 @@ import eu.kanade.tachiyomi.lib.mp4uploadextractor.Mp4uploadExtractor
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.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.lib.upstreamextractor.UpstreamExtractor
import eu.kanade.tachiyomi.lib.uqloadextractor.UqloadExtractor
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
Expand Down Expand Up @@ -233,48 +235,53 @@ class AnimeMovil : ConfigurableAnimeSource, AnimeHttpSource() {
val videoList = mutableListOf<Video>()
val embedUrl = url.lowercase()
try {
if (embedUrl.contains("voe")) {
VoeExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
if (embedUrl.contains("filemoon") || embedUrl.contains("moonplayer")) {
FilemoonExtractor(client).videosFromUrl(url, prefix = "Filemoon:").also(videoList::addAll)
}
if (embedUrl.contains("uqload")) {
UqloadExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
if (embedUrl.contains("mp4upload")) {
val newHeaders = headers.newBuilder().add("referer", "https://re.animepelix.net/").build()
Mp4uploadExtractor(client).videosFromUrl(url, newHeaders).also(videoList::addAll)
}
if (embedUrl.contains("wishembed") || embedUrl.contains("streamwish") || embedUrl.contains("wish")) {
val docHeaders = headers.newBuilder()
.add("Referer", "$baseUrl/")
.build()
StreamWishExtractor(client, docHeaders).videosFromUrl(url, videoNameGen = { "StreamWish:$it" }).also(videoList::addAll)
}
if (embedUrl.contains("doodstream") || embedUrl.contains("dood.")) {
DoodExtractor(client).videoFromUrl(url, "DoodStream")?.let { videoList.add(it) }
}
if (embedUrl.contains("streamlare")) {
StreamlareExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
if (embedUrl.contains("yourupload")) {
YourUploadExtractor(client).videoFromUrl(url, headers = headers).also(videoList::addAll)
}
if (embedUrl.contains("burstcloud") || embedUrl.contains("burst")) {
BurstCloudExtractor(client).videoFromUrl(url, headers = headers).also(videoList::addAll)
}
if (embedUrl.contains("fastream")) {
FastreamExtractor(client, headers).videosFromUrl(url).also(videoList::addAll)
}
if (embedUrl.contains("upstream")) {
UpstreamExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
if (embedUrl.contains("streamtape")) {
StreamTapeExtractor(client).videoFromUrl(url)?.also(videoList::add)
}
if (embedUrl.contains("filelions") || embedUrl.contains("lion")) {
StreamWishExtractor(client, headers).videosFromUrl(url, videoNameGen = { "FileLions:$it" }).also(videoList::addAll)
return when {
embedUrl.contains("voe") -> {
VoeExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
embedUrl.contains("filemoon") || embedUrl.contains("moonplayer") -> {
FilemoonExtractor(client).videosFromUrl(url, prefix = "Filemoon:").also(videoList::addAll)
}
embedUrl.contains("uqload") -> {
UqloadExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
embedUrl.contains("mp4upload") -> {
val newHeaders = headers.newBuilder().add("referer", "https://re.animepelix.net/").build()
Mp4uploadExtractor(client).videosFromUrl(url, newHeaders).also(videoList::addAll)
}
embedUrl.contains("wishembed") || embedUrl.contains("streamwish") || embedUrl.contains("wish") -> {
val docHeaders = headers.newBuilder()
.add("Referer", "$baseUrl/")
.build()
StreamWishExtractor(client, docHeaders).videosFromUrl(url, videoNameGen = { "StreamWish:$it" }).also(videoList::addAll)
}
embedUrl.contains("doodstream") || embedUrl.contains("dood.") -> {
DoodExtractor(client).videosFromUrl(url, "DoodStream").also(videoList::addAll)
}
embedUrl.contains("streamlare") -> {
StreamlareExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
embedUrl.contains("yourupload") -> {
YourUploadExtractor(client).videoFromUrl(url, headers = headers).also(videoList::addAll)
}
embedUrl.contains("burstcloud") || embedUrl.contains("burst") -> {
BurstCloudExtractor(client).videoFromUrl(url, headers = headers).also(videoList::addAll)
}
embedUrl.contains("fastream") -> {
FastreamExtractor(client, headers).videosFromUrl(url).also(videoList::addAll)
}
embedUrl.contains("upstream") -> {
UpstreamExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
embedUrl.contains("streamtape") -> {
StreamTapeExtractor(client).videosFromUrl(url).also(videoList::addAll)
}
embedUrl.contains("filelions") || embedUrl.contains("lion") -> {
StreamWishExtractor(client, headers).videosFromUrl(url, videoNameGen = { "FileLions:$it" }).also(videoList::addAll)
}
else -> {
UniversalExtractor(client).videosFromUrl(url, headers).also(videoList::addAll)
}
}
} catch (_: Exception) {}
return videoList
Expand Down
3 changes: 2 additions & 1 deletion src/es/animenix/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ ext {
extClass = '.Animenix'
themePkg = 'dooplay'
baseUrl = 'https://animenix.com'
overrideVersionCode = 4
overrideVersionCode = 5
}

apply from: "$rootDir/common.gradle"

dependencies {
implementation(project(":lib:filemoon-extractor"))
implementation(project(":lib:streamwish-extractor"))
implementation(project(":lib:universal-extractor"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
import eu.kanade.tachiyomi.lib.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
Expand Down Expand Up @@ -64,13 +65,14 @@ class Animenix : DooPlay(

private val filemoonExtractor by lazy { FilemoonExtractor(client) }
private val streamWishExtractor by lazy { StreamWishExtractor(headers = headers, client = client) }
private val universalExtractor by lazy { UniversalExtractor(client) }

private fun getPlayerVideos(link: String): List<Video> {
return when {
link.contains("filemoon") -> filemoonExtractor.videosFromUrl(link)
link.contains("swdyu") -> streamWishExtractor.videosFromUrl(link)
link.contains("wishembed") || link.contains("cdnwish") || link.contains("flaswish") || link.contains("sfastwish") || link.contains("streamwish") || link.contains("asnwish") -> streamWishExtractor.videosFromUrl(link)
else -> emptyList()
else -> universalExtractor.videosFromUrl(link, headers)
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/es/animeonlineninja/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.AnimeOnlineNinja'
themePkg = 'dooplay'
baseUrl = 'https://ww3.animeonline.ninja'
overrideVersionCode = 44
overrideVersionCode = 45
}

apply from: "$rootDir/common.gradle"
Expand All @@ -14,4 +14,5 @@ dependencies {
implementation(project(':lib:filemoon-extractor'))
implementation(project(':lib:mixdrop-extractor'))
implementation(project(':lib:uqload-extractor'))
implementation(project(':lib:universal-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.lib.doodextractor.DoodExtractor
import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
import eu.kanade.tachiyomi.lib.mixdropextractor.MixDropExtractor
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.lib.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.lib.uqloadextractor.UqloadExtractor
import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay
import eu.kanade.tachiyomi.network.GET
Expand Down Expand Up @@ -115,6 +116,7 @@ class AnimeOnlineNinja : DooPlay(
private val streamTapeExtractor by lazy { StreamTapeExtractor(client) }
private val mixDropExtractor by lazy { MixDropExtractor(client) }
private val uqloadExtractor by lazy { UqloadExtractor(client) }
private val universalExtractor by lazy { UniversalExtractor(client) }

private fun extractVideos(url: String, lang: String): List<Video> {
return when {
Expand Down Expand Up @@ -142,8 +144,8 @@ class AnimeOnlineNinja : DooPlay(
listOf(Video(videoUrl, "$lang WolfStream", videoUrl, headers = headers))
}
}
else -> null
} ?: emptyList<Video>()
else -> universalExtractor.videosFromUrl(url, headers, prefix = lang)
} ?: emptyList()
}

private fun extractFromMulti(url: String): List<Video> {
Expand Down
3 changes: 2 additions & 1 deletion src/es/animeytes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.AnimeYTES'
themePkg = 'animestream'
baseUrl = 'https://animeyt.pro'
overrideVersionCode = 5
overrideVersionCode = 6
}

apply from: "$rootDir/common.gradle"
Expand All @@ -15,4 +15,5 @@ dependencies {
implementation(project(":lib:yourupload-extractor"))
implementation(project(":lib:burstcloud-extractor"))
implementation(project(":lib:filemoon-extractor"))
implementation(project(":lib:universal-extractor"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
import eu.kanade.tachiyomi.lib.sendvidextractor.SendvidExtractor
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.lib.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.lib.youruploadextractor.YourUploadExtractor
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
import uy.kohesive.injekt.Injekt
Expand Down Expand Up @@ -48,6 +49,7 @@ class AnimeYTES : AnimeStream(
private val youruploadExtractor by lazy { YourUploadExtractor(client) }
private val burstcloudExtractor by lazy { BurstCloudExtractor(client) }
private val filemoonExtractor by lazy { FilemoonExtractor(client) }
private val universalExtractor by lazy { UniversalExtractor(client) }

override fun getVideoList(url: String, name: String): List<Video> {
return when (name) {
Expand All @@ -57,7 +59,7 @@ class AnimeYTES : AnimeStream(
"Your" -> youruploadExtractor.videoFromUrl(url, headers)
"Alpha" -> burstcloudExtractor.videoFromUrl(url, headers)
"Moon" -> filemoonExtractor.videosFromUrl(url)
else -> emptyList()
else -> universalExtractor.videosFromUrl(url, headers)
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/es/cine24h/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Cine24h'
extClass = '.Cine24h'
extVersionCode = 4
extVersionCode = 5
}

apply from: "$rootDir/common.gradle"
Expand All @@ -11,4 +11,5 @@ dependencies {
implementation(project(':lib:dood-extractor'))
implementation(project(':lib:filemoon-extractor'))
implementation(project(':lib:voe-extractor'))
implementation(project(':lib:universal-extractor'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
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.universalextractor.UniversalExtractor
import eu.kanade.tachiyomi.lib.voeextractor.VoeExtractor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.util.asJsoup
Expand Down Expand Up @@ -153,6 +154,7 @@ open class Cine24h : ConfigurableAnimeSource, AnimeHttpSource() {
private val filemoonExtractor by lazy { FilemoonExtractor(client) }
private val doodExtractor by lazy { DoodExtractor(client) }
private val voeExtractor by lazy { VoeExtractor(client) }
private val universalExtractor by lazy { UniversalExtractor(client) }

private fun serverVideoResolver(url: String): List<Video> {
val embedUrl = url.lowercase()
Expand All @@ -164,7 +166,7 @@ open class Cine24h : ConfigurableAnimeSource, AnimeHttpSource() {
embedUrl.contains("filemoon") || embedUrl.contains("moonplayer") -> filemoonExtractor.videosFromUrl(url, prefix = "Filemoon:")
embedUrl.contains("voe") -> voeExtractor.videosFromUrl(url)
embedUrl.contains("dood") -> doodExtractor.videosFromUrl(url)
else -> emptyList()
else -> universalExtractor.videosFromUrl(url, headers)
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/es/cinecalidad/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'CineCalidad'
extClass = '.CineCalidad'
extVersionCode = 9
extVersionCode = 10
}

apply from: "$rootDir/common.gradle"
Expand All @@ -23,4 +23,6 @@ dependencies {
implementation(project(':lib:fastream-extractor'))
implementation(project(':lib:upstream-extractor'))
implementation(project(':lib:streamhidevid-extractor'))
implementation(project(':lib:goodstream-extractor'))
implementation(project(':lib:universal-extractor'))
}
Loading

0 comments on commit 32cccd7

Please sign in to comment.