Skip to content

Commit

Permalink
Merge pull request #71 from Dark25/AllAnime
Browse files Browse the repository at this point in the history
feat(en/AllAnime): Add filemoon and streamwish extractors
  • Loading branch information
Dark25 authored Sep 5, 2024
2 parents e5c223f + f97920e commit 006f8b8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
6 changes: 4 additions & 2 deletions src/en/allanime/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AllAnime'
extClass = '.AllAnime'
extVersionCode = 34
extVersionCode = 35
}

apply from: "$rootDir/common.gradle"
Expand All @@ -12,5 +12,7 @@ dependencies {
implementation(project(':lib:dood-extractor'))
implementation(project(':lib:okru-extractor'))
implementation(project(':lib:gogostream-extractor'))
implementation "dev.datlag.jsunpacker:jsunpacker:1.0.1"
implementation(project(':lib:filemoon-extractor'))
implementation(project(':lib:streamwish-extractor'))
implementation libs.jsunpacker
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ 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.doodextractor.DoodExtractor
import eu.kanade.tachiyomi.lib.filemoonextractor.FilemoonExtractor
import eu.kanade.tachiyomi.lib.gogostreamextractor.GogoStreamExtractor
import eu.kanade.tachiyomi.lib.mp4uploadextractor.Mp4uploadExtractor
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
import eu.kanade.tachiyomi.lib.streamlareextractor.StreamlareExtractor
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.await
Expand Down Expand Up @@ -271,6 +273,8 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
private val okruExtractor by lazy { OkruExtractor(client) }
private val mp4uploadExtractor by lazy { Mp4uploadExtractor(client) }
private val streamlareExtractor by lazy { StreamlareExtractor(client) }
private val filemoonExtractor by lazy { FilemoonExtractor(client) }
private val streamwishExtractor by lazy { StreamWishExtractor(client, headers) }

override suspend fun getVideoList(episode: SEpisode): List<Video> {
val response = client.newCall(videoListRequest(episode)).await()
Expand All @@ -284,11 +288,13 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {

// list of alternative hosters
val mappings = listOf(
"vidstreaming" to listOf("vidstreaming", "https://gogo", "playgo1.cc", "playtaku"),
"vidstreaming" to listOf("vidstreaming", "https://gogo", "playgo1.cc", "playtaku", "vidcloud"),
"doodstream" to listOf("dood"),
"okru" to listOf("ok.ru"),
"okru" to listOf("ok.ru", "okru"),
"mp4upload" to listOf("mp4upload.com"),
"streamlare" to listOf("streamlare.com"),
"filemoon" to listOf("filemoon", "moonplayer"),
"streamwish" to listOf("wish"),
)

videoJson.data.episode.sourceUrls.forEach { video ->
Expand Down Expand Up @@ -356,6 +362,12 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
sName == "streamlare" -> {
streamlareExtractor.videosFromUrl(server.sourceUrl)
}
sName == "filemoon" -> {
filemoonExtractor.videosFromUrl(server.sourceUrl, prefix = "Filemoon:")
}
sName == "streamwish" -> {
streamwishExtractor.videosFromUrl(server.sourceUrl, videoNameGen = { "StreamWish:$it" })
}
else -> emptyList()
}.let { it.map { v -> Pair(v, server.priority) } }
},
Expand All @@ -367,15 +379,13 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
// ============================= Utilities ==============================

private fun String.decryptSource(): String {
return if (this.startsWith("-")) {
this.substringAfterLast('-').chunked(2)
.map { it.toInt(16).toByte() }
.toByteArray().map {
(it.toInt() xor 56).toChar()
}.joinToString("")
} else {
this
}
if (!this.startsWith("-")) return this

return this.substringAfterLast('-').chunked(2)
.map { it.toInt(16).toByte() }
.toByteArray().map {
(it.toInt() xor 56).toChar()
}.joinToString("")
}

private fun prioritySort(pList: List<Pair<Video, Float>>): List<Video> {
Expand Down Expand Up @@ -466,6 +476,8 @@ class AllAnime : ConfigurableAnimeSource, AnimeHttpSource() {
"mp4upload",
"streamlare",
"doodstream",
"filemoon",
"streamwish",
)

private const val PREF_SITE_DOMAIN_KEY = "preferred_site_domain"
Expand Down

0 comments on commit 006f8b8

Please sign in to comment.