Skip to content

Commit

Permalink
🕊 #7
Browse files Browse the repository at this point in the history
🕊
  • Loading branch information
keyiflerolsun committed Nov 27, 2023
1 parent 3035749 commit 38b0c9a
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 44 deletions.
2 changes: 1 addition & 1 deletion DiziMom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 16
version = 17

cloudstream {
authors = listOf("keyiflerolsun")
Expand Down
76 changes: 44 additions & 32 deletions DiziMom/src/main/kotlin/com/keyiflerolsun/DiziMom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DiziMom : MainAPI() {
override val supportedTypes = setOf(TvType.TvSeries)

override val mainPage = mainPageOf(
"${mainUrl}/tum-bolumler/page/" to "Son Bölümler",
"${mainUrl}/turkce-dublaj-diziler/page/" to "Dublajlı Diziler",
"${mainUrl}/netflix-dizileri-izle/page/" to "Netflix Dizileri",
"${mainUrl}/yabanci-dizi-izle/page/" to "Yabancı Diziler",
Expand All @@ -33,12 +34,26 @@ class DiziMom : MainAPI() {

override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val document = app.get("${request.data}${page}/").document
val home = document.select("div.single-item").mapNotNull { it.toSearchResult() }
val home = if (request.data.contains("/tum-bolumler/")) {
document.select("div.episode-item").mapNotNull { it.sonBolumler() }
} else {
document.select("div.single-item").mapNotNull { it.diziler() }
}

return newHomePageResponse(request.name, home)
}

private fun Element.toSearchResult(): SearchResponse? {
private fun Element.sonBolumler(): SearchResponse? {
val name = this.selectFirst("div.episode-name a")?.text()?.substringBefore(" izle") ?: return null
val title = name.replace(".Sezon ","x").replace(". Bölüm","")

val href = fixUrlNull(this.selectFirst("div.episode-name a")?.attr("href")) ?: return null
val posterUrl = fixUrlNull(this.selectFirst("div.cat-img img")?.attr("src"))

return newTvSeriesSearchResponse(title, href, TvType.TvSeries) { this.posterUrl = posterUrl }
}

private fun Element.diziler(): SearchResponse? {
val title = this.selectFirst("div.categorytitle a")?.text()?.substringBefore(" izle") ?: return null
val href = fixUrlNull(this.selectFirst("div.categorytitle a")?.attr("href")) ?: return null
val posterUrl = fixUrlNull(this.selectFirst("div.cat-img img")?.attr("src"))
Expand All @@ -49,7 +64,7 @@ class DiziMom : MainAPI() {
override suspend fun search(query: String): List<SearchResponse> {
val document = app.get("${mainUrl}/?s=${query}").document

return document.select("div.single-item").mapNotNull { it.toSearchResult() }
return document.select("div.single-item").mapNotNull { it.diziler() }
}

override suspend fun quickSearch(query: String): List<SearchResponse> = search(query)
Expand Down Expand Up @@ -110,37 +125,34 @@ class DiziMom : MainAPI() {
if (iframe.contains("hdmomplayer")) {
i_source = app.get("${iframe}", referer="${mainUrl}/").text

// m3u_link = Regex("""file:\"([^\"]+)""").find(i_source)?.groupValues?.get(1)

// val track_str = Regex("""tracks:\[([^\]]+)""").find(i_source)?.groupValues?.get(1)
// if (track_str != null) {
// val tracks:List<Track> = jacksonObjectMapper().readValue("[${track_str}]")

// for (track in tracks) {
// if (track.file == null || track.label == null) continue
// if (track.label.contains("Forced")) continue

// subtitleCallback.invoke(
// SubtitleFile(
// lang = track.label,
// url = fixUrl("https://hdmomplayer.com" + track.file)
// )
// )
// }
// }

val bePlayer = Regex("""bePlayer\('([^']+)',\s*'(\{[^\}]+\})'\);""").find(i_source)?.groupValues
if (bePlayer == null) {
Log.d("DZM", "i_source » ${i_source}")
return false
}
val bePlayer = Regex("""bePlayer\('([^']+)',\s*'(\{[^\}]+\})'\);""").find(i_source)?.groupValues
if (bePlayer != null) {
val bePlayerPass = bePlayer.get(1)
val bePlayerData = bePlayer.get(2)
val encrypted = AesHelper.cryptoAESHandler(bePlayerData, bePlayerPass.toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")
Log.d("DZM", "encrypted » ${encrypted}")

m3u_link = Regex("""video_location\":\"([^\"]+)""").find(encrypted)?.groupValues?.get(1)
} else {
m3u_link = Regex("""file:\"([^\"]+)""").find(i_source)?.groupValues?.get(1)

val track_str = Regex("""tracks:\[([^\]]+)""").find(i_source)?.groupValues?.get(1)
if (track_str != null) {
val tracks:List<Track> = jacksonObjectMapper().readValue("[${track_str}]")

val key = bePlayer?.get(1) ?: return false
val crypted = bePlayer?.get(2) ?: return false
val decrypt = AesHelper.cryptoAESHandler(crypted, key.toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")
Log.d("DZM", "decrypt » ${decrypt}")
for (track in tracks) {
if (track.file == null || track.label == null) continue
if (track.label.contains("Forced")) continue

m3u_link = Regex("""video_location\":\"([^\"]+)""").find(decrypt)?.groupValues?.get(1)
subtitleCallback.invoke(
SubtitleFile(
lang = track.label,
url = fixUrl("https://hdmomplayer.com" + track.file)
)
)
}
}
}
}

if (iframe.contains("hdplayersystem")) {
Expand Down
71 changes: 60 additions & 11 deletions DiziMom/src/main/kotlin/com/keyiflerolsun/bakalim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,68 @@
from Kekik.cli import konsol
from cloudscraper import CloudScraper
from parsel import Selector
from re import findall
from re import search

oturum = CloudScraper()
istek = oturum.get("https://www.dizimom.pro/kader-baglari-1-bolum-izle-fox-hd/")
secici = Selector(istek.text)
konsol.print(secici.css("div#vast iframe::attr(src)").get())

oturum.headers.update({"User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36"})
oturum.cookies.update({"wordpress_logged_in_94427965a200eb7dd292509ed2c7c018": "keyiflerolsun|1699737674|EvfGx8bnw88aTkvvmRNqWQUuIYsUzLOIlWa4nwixKFn|87a00e3a0d391fa1074e004d37a54a66e7bfc85bdc0191a8eec3cb9df741db8c"})
istek = oturum.get("https://www.dizimom.pro/kader-baglari-1-bolum-izle-fox-hd/")
secici = Selector(istek.text)
konsol.print(secici.css("div#vast iframe::attr(src)").get())

oturum.headers.update({"User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36"})
istek = oturum.get("https://www.dizimom.pro/kader-baglari-1-bolum-izle-fox-hd/")
istek = oturum.get("https://www.dizimom.de/pokemon-pokemon-ustasi-olmak-1-sezon-3-bolum-izle/")
konsol.print(istek.url)

secici = Selector(istek.text)
konsol.print(secici.css("div#vast iframe::attr(src)").get())
iframe = secici.css("div#vast iframe::attr(src)").get()
konsol.print(iframe)

oturum.headers.update({"Referer": "https://www.dizimom.de/"})
i_source = oturum.get(iframe).text

be_player = search(r"bePlayer\('([^']+)',\s*'(\{[^\}]+\})'\);", i_source).groups()
konsol.print(be_player)

be_player_pass = be_player[0]
be_player_data = be_player[1]


from json import loads
from Crypto.Hash import MD5
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
from base64 import b64decode


def decrypt_aes_with_custom_kdf(crypted_data, password) -> str:
"""
AES/CBC/PKCS5Padding şifreleme şemasını kullanarak şifre çözme işlemi yapar.
:param crypted_data: JSON formatında şifrelenmiş veri (ct, iv, s içerir).
:param password: Anahtar türetmede kullanılacak şifre.
:return: Çözülmüş veri (string olarak).
"""

def generate_key_and_iv(password, salt, key_length=32, iv_length=16, iterations=1):
"""Anahtar ve IV oluşturmak için bir KDF fonksiyonu."""
d = d_i = b""
while len(d) < key_length + iv_length:
d_i = MD5.new(d_i + password + salt).digest()
for _ in range(1, iterations):
d_i = MD5.new(d_i).digest()
d += d_i
return d[:key_length], d[key_length : key_length + iv_length]

def hex_to_bytes(hex_str):
"""Hex string'i byte array'e çevirir."""
return bytes.fromhex(hex_str)

data = loads(crypted_data)

key, iv = generate_key_and_iv(password, hex_to_bytes(data["s"]), iv_length=len(data["iv"]) // 2)

cipher = AES.new(key, AES.MODE_CBC, iv)
decrypted = unpad(cipher.decrypt(b64decode(data["ct"])), AES.block_size)

return decrypted.decode("utf-8")


encrypted = decrypt_aes_with_custom_kdf(be_player_data, be_player_pass.encode()).replace("\\", "")
konsol.print(loads(encrypted))

2 comments on commit 38b0c9a

@Bymesut1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sezonluk dizi ve webteizle deki plus alternatifi gelmiyor sadece tarayıcıdan girdiğimde plus alternatifi geliyor uygulamada plus alternatifinin gelmesi gerektiğine inanıyorum umarım gelir iyi çalışmalar diliyorum

@keyiflerolsun
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sezonluk dizi ve webteizle deki plus alternatifi gelmiyor sadece tarayıcıdan girdiğimde plus alternatifi geliyor uygulamada plus alternatifinin gelmesi gerektiğine inanıyorum umarım gelir iyi çalışmalar diliyorum

#7

Please sign in to comment.