Skip to content

Commit

Permalink
Merge branch 'master' into Streamingcommunity_fixx
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark25 authored Mar 27, 2024
2 parents 164e317 + 8bedaa3 commit b3577df
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 30 deletions.
1 change: 1 addition & 0 deletions lib/streamhidevid-extractor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

dependencies {
implementation(project(":lib:playlist-utils"))
implementation("dev.datlag.jsunpacker:jsunpacker:1.0.1") {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
package eu.kanade.tachiyomi.lib.streamhidevidextractor

import dev.datlag.jsunpacker.JsUnpacker
import eu.kanade.tachiyomi.animesource.model.Track
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
import eu.kanade.tachiyomi.network.GET
import okhttp3.OkHttpClient

class StreamHideVidExtractor(private val client: OkHttpClient) {
// from nineanime / ask4movie FilemoonExtractor
private val subtitleRegex = Regex("""#EXT-X-MEDIA:TYPE=SUBTITLES.*?NAME="(.*?)".*?URI="(.*?)"""")

private val playlistUtils by lazy { PlaylistUtils(client) }

fun videosFromUrl(url: String, prefix: String = ""): List<Video> {
val page = client.newCall(GET(url)).execute().body.string()
val unpacked = JsUnpacker.unpackAndCombine(page) ?: return emptyList()
val playlistUrl = unpacked.substringAfter("sources:")
val playlistUrl = (JsUnpacker.unpackAndCombine(page) ?: page)
.substringAfter("sources:")
.substringAfter("file:\"") // StreamHide
.substringAfter("src:\"") // StreamVid
.substringBefore('"')

val playlistData = client.newCall(GET(playlistUrl)).execute().body.string()

val subs = subtitleRegex.findAll(playlistData).map {
val urlPart = it.groupValues[2]
val subUrl = when {
!urlPart.startsWith("https:") ->
playlistUrl.substringBeforeLast("/") + "/$urlPart"
else -> urlPart
}
Track(subUrl, it.groupValues[1])
}.toList()

// The playlist usually only have one video quality.
return listOf(Video(playlistUrl, "${prefix}StreamHideVid", playlistUrl, subtitleTracks = subs))
if (!playlistUrl.startsWith("http")) return emptyList()
return playlistUtils.extractFromHls(playlistUrl,
videoNameGen = { "${prefix}StreamHideVid - $it" }
)
}
}
2 changes: 1 addition & 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 = 35
extVersionCode = 36
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/es/asialiveaction/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AsiaLiveAction'
extClass = '.AsiaLiveAction'
extVersionCode = 27
extVersionCode = 28
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/es/doramasflix/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Doramasflix'
extClass = '.Doramasflix'
extVersionCode = 17
extVersionCode = 18
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/es/gnula/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Gnula'
extClass = '.Gnula'
extVersionCode = 15
extVersionCode = 16
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/es/hentaila/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'HentaiLA'
extClass = '.Hentaila'
extVersionCode = 22
extVersionCode = 23
isNsfw = true
}

Expand Down
2 changes: 1 addition & 1 deletion src/es/lacartoons/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'LACartoons'
extClass = '.Lacartoons'
extVersionCode = 1
extVersionCode = 2
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/es/locopelis/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'LocoPelis'
extClass = '.LocoPelis'
extVersionCode = 21
extVersionCode = 22
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/fr/frenchanime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.FrenchAnime'
themePkg = 'datalifeengine'
baseUrl = 'https://french-anime.com'
overrideVersionCode = 5
overrideVersionCode = 6
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/fr/wiflix/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.Wiflix'
themePkg = 'datalifeengine'
baseUrl = 'https://wiflix.voto'
overrideVersionCode = 4
overrideVersionCode = 5
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/pt/pifansubs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.PiFansubs'
themePkg = 'dooplay'
baseUrl = 'https://pifansubs.club'
overrideVersionCode = 18
overrideVersionCode = 19
isNsfw = true
}

Expand Down

0 comments on commit b3577df

Please sign in to comment.