Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ar/Tuktukcinema): use streamwish lib for extractor #2654

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ar/tuktukcinema/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ext {
extName = 'توك توك سينما'
pkgNameSuffix = 'ar.tuktukcinema'
extClass = '.Tuktukcinema'
extVersionCode = 11
extVersionCode = 12
libVersion = '13'
}

Expand All @@ -15,8 +15,9 @@ dependencies {
implementation(project(':lib-dood-extractor'))
implementation(project(':lib-streamtape-extractor'))
implementation(project(':lib-vidbom-extractor'))
implementation "dev.datlag.jsunpacker:jsunpacker:1.0.1"
implementation(project(':lib-streamwish-extractor'))
implementation(project(':lib-playlist-utils'))
implementation "dev.datlag.jsunpacker:jsunpacker:1.0.1"
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.animesource.online.ParsedAnimeHttpSource
import eu.kanade.tachiyomi.lib.doodextractor.DoodExtractor
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
import eu.kanade.tachiyomi.lib.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.lib.uqloadextractor.UqloadExtractor
import eu.kanade.tachiyomi.lib.vidbomextractor.VidBomExtractor
Expand Down Expand Up @@ -137,7 +137,7 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
override fun episodeFromElement(element: Element): SEpisode = throw Exception("not used")

// ============================ video links ============================
private val playlistUtils by lazy { PlaylistUtils(client, headers) }
private val streamWishExtractor by lazy { StreamWishExtractor(client, headers) }

override fun videoListRequest(episode: SEpisode): Request {
val refererHeaders = headers.newBuilder().apply {
Expand All @@ -162,12 +162,8 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

private fun extractVideos(url: String): List<Video> {
return when {
url.contains("egtpgrvh") -> {
val videoList = mutableListOf<Video>()
val request = client.newCall(GET(url, headers)).execute().asJsoup()
val data = request.selectFirst("script:containsData(m3u8)")!!.data()
val masterUrl = data.substringAfter("sources: [{").substringAfter("file:\"").substringBefore("\"}")
playlistUtils.extractFromHls(masterUrl)
STREAMWISH_REGEX.containsMatchIn(url) -> {
streamWishExtractor.videosFromUrl(url)
}
url.contains("ok") -> {
OkruExtractor(client).videosFromUrl(url)
Expand All @@ -178,7 +174,7 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
}
DOOD_REGEX.containsMatchIn(url) -> {
val finalUrl = DOOD_REGEX.find(url)!!.groupValues[0]
DoodExtractor(client).videoFromUrl("https://www.$finalUrl", "Dood mirror", false)?.let(::listOf)
DoodExtractor(client).videoFromUrl(url, "Dood mirror")?.let(::listOf)
}
url.contains("uqload") -> {
UqloadExtractor(client).videosFromUrl(url, "mirror")
Expand Down Expand Up @@ -311,7 +307,7 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
// preferred quality settings
private fun getPrefHostUrl(preferences: SharedPreferences): String = preferences.getString(
"default_domain_v${BuildConfig.VERSION_CODE}",
"https://w38.tuktukcinema1.buzz/",
"https://ww.tuktukcima.com/",
)!!.trim()

override fun setupPreferenceScreen(screen: PreferenceScreen) {
Expand Down Expand Up @@ -355,6 +351,7 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
}
companion object {
private val VIDBOM_REGEX = Regex("(?:v[aie]d[bp][aoe]?m|myvii?d|govad|segavid|v[aei]{1,2}dshar[er]?)\\.(?:com|net|org|xyz)(?::\\d+)?/(?:embed[/-])?([A-Za-z0-9]+).html")
private val DOOD_REGEX = Regex("(do*d(?:stream)?\\.(?:com?|watch|to|s[ho]|cx|ds|la|w[sf]|pm|re|yt|stream))/[de]/([0-9a-zA-Z]+)")
private val DOOD_REGEX = Regex("(do*d(?:stream)?\\.(?:com?|watch|to|s[ho]|cx|la|w[sf]|pm|re|yt|stream))/[de]/([0-9a-zA-Z]+)|ds2play")
private val STREAMWISH_REGEX = Regex("ajmidyad|alhayabambi|atabknh[ks]|file|egtpgrvh")
}
}