Skip to content

Commit

Permalink
fix(src/ar): Mass fix for some Arabic extensions (aniyomiorg#2651)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedgamal17 authored Dec 17, 2023
1 parent 06cbdfe commit 02879fc
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ar/akwam/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ext {
extName = 'أكوام'
pkgNameSuffix = 'ar.akwam'
extClass = '.Akwam'
extVersionCode = 8
extVersionCode = 9
libVersion = '13'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override val name = "أكوام"

override val baseUrl = "https://akwam.im"
override val baseUrl = "https://akw-cdn1.link"

override val lang = "ar"

Expand Down Expand Up @@ -100,7 +100,7 @@ class Akwam : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override fun videoListParse(response: Response): List<Video> {
val document = response.asJsoup()
val iframe = "https://akwam.im/watch" + document.select("a.link-show").attr("href").substringAfter("watch") + "/" + document.ownerDocument()!!.select("input#page_id").attr("value")
val iframe = "https://akw-cdn1.link/watch" + document.select("a.link-show").attr("href").substringAfter("watch") + "/" + document.ownerDocument()!!.select("input#page_id").attr("value")
val referer = response.request.url.toString()
val refererHeaders = Headers.headersOf("referer", referer)
val iframeResponse = client.newCall(GET(iframe, refererHeaders))
Expand Down
2 changes: 1 addition & 1 deletion src/ar/egydead/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ext {
extName = 'Egy Dead'
pkgNameSuffix = 'ar.egydead'
extClass = '.EgyDead'
extVersionCode = 6
extVersionCode = 7
libVersion = '13'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.widget.Toast
import androidx.preference.EditTextPreference
import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.animeextension.BuildConfig
import dev.datlag.jsunpacker.JsUnpacker
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
Expand Down Expand Up @@ -318,8 +319,8 @@ class EgyDead : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
// ================================== preferences ==================================

private fun getPrefHostUrl(preferences: SharedPreferences): String = preferences.getString(
"default_domain",
"https://w9.egydead.live/",
"default_domain_v${BuildConfig.VERSION_CODE}",
"https://egydead.space/",
)!!.trim()

override fun setupPreferenceScreen(screen: PreferenceScreen) {
Expand Down Expand Up @@ -365,7 +366,7 @@ class EgyDead : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
// like|kharabnahk
companion object {
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]+)")
private val STREAMWISH_REGEX = Regex("ajmidyad|alhayabambi|atabknh[ks]|file")
private val STREAMWISH_REGEX = Regex("ajmidyad|alhayabambi|atabknh[ks]|file|egtpgrvh")
private val SOURCE_URL_REGEX = Regex("sources:\\s*\\[\\{\\s*\\t*file:\\s*[\"']([^\"']+)")
private val QUALITIES_REGEX = Regex("(.*)_,(.*),\\.urlset/master(.*)")
}
Expand Down
2 changes: 1 addition & 1 deletion src/ar/faselhd/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ext {
extName = 'فاصل اعلاني'
pkgNameSuffix = 'ar.faselhd'
extClass = '.FASELHD'
extVersionCode = 13
extVersionCode = 14
libVersion = '13'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FASELHD : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

override val name = "فاصل اعلاني"

override val baseUrl = "https://www.faselhd.vip"
override val baseUrl = "https://www.faselhd.pro"

override val lang = "ar"

Expand Down
3 changes: 2 additions & 1 deletion 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 = 10
extVersionCode = 11
libVersion = '13'
}

Expand All @@ -16,6 +16,7 @@ dependencies {
implementation(project(':lib-streamtape-extractor'))
implementation(project(':lib-vidbom-extractor'))
implementation "dev.datlag.jsunpacker:jsunpacker:1.0.1"
implementation(project(':lib-playlist-utils'))
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.widget.Toast
import androidx.preference.EditTextPreference
import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.animeextension.BuildConfig
import eu.kanade.tachiyomi.animeextension.ar.tuktukcinema.extractors.UpStreamExtractor
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
Expand All @@ -16,6 +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.streamtapeextractor.StreamTapeExtractor
import eu.kanade.tachiyomi.lib.uqloadextractor.UqloadExtractor
import eu.kanade.tachiyomi.lib.vidbomextractor.VidBomExtractor
Expand Down Expand Up @@ -135,6 +137,15 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
override fun episodeFromElement(element: Element): SEpisode = throw Exception("not used")

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

override fun videoListRequest(episode: SEpisode): Request {
val refererHeaders = headers.newBuilder().apply {
add("Referer", "$baseUrl/")
}.build()

return GET("$baseUrl/${episode.url}", headers = refererHeaders)
}

override fun videoListSelector() = "div.watch--servers--list ul li.server--item"

Expand All @@ -151,6 +162,13 @@ 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)
}
url.contains("ok") -> {
OkruExtractor(client).videosFromUrl(url)
}
Expand Down Expand Up @@ -292,8 +310,8 @@ class Tuktukcinema : ConfigurableAnimeSource, ParsedAnimeHttpSource() {

// preferred quality settings
private fun getPrefHostUrl(preferences: SharedPreferences): String = preferences.getString(
"default_domain",
"https://w.tuktukcinema.tv/",
"default_domain_v${BuildConfig.VERSION_CODE}",
"https://w38.tuktukcinema1.buzz/",
)!!.trim()

override fun setupPreferenceScreen(screen: PreferenceScreen) {
Expand Down Expand Up @@ -337,6 +355,6 @@ 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|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|ds|la|w[sf]|pm|re|yt|stream))/[de]/([0-9a-zA-Z]+)")
}
}

0 comments on commit 02879fc

Please sign in to comment.