KekikStream 2.0.5__py3-none-any.whl → 2.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,86 @@ class YTDLP(ExtractorBase):
10
10
 
11
11
  _FAST_DOMAIN_RE = None # compiled mega-regex (host üstünden)
12
12
 
13
+ _POPULAR_TLDS = {
14
+ "com", "net", "org", "tv", "io", "co", "me", "ly", "ru", "fr", "de", "es", "it",
15
+ "nl", "be", "ch", "at", "uk", "ca", "au", "jp", "kr", "cn", "in", "br", "mx",
16
+ "ar", "tr", "gov", "edu", "mil", "int", "info", "biz", "name", "pro", "aero",
17
+ "coop", "museum", "onion"
18
+ }
19
+
20
+ # 1. Literal TLD Regex: youtube\.com, vimeo\.com
21
+ # sorted by reverse length to prevent partial matches (e.g. 'co' matching 'com')
22
+ _LITERAL_TLD_RE = re.compile(
23
+ rf"([a-z0-9][-a-z0-9]*(?:\\\.[-a-z0-9]+)*\\\.(?:{'|'.join(sorted(_POPULAR_TLDS, key=len, reverse=True))}))",
24
+ re.IGNORECASE
25
+ )
26
+
27
+ # 2. Regex TLD Regex: dailymotion\.[a-z]{2,3}
28
+ _REGEX_TLD_RE = re.compile(
29
+ r"([a-z0-9][-a-z0-9]*)\\\.\[a-z\]\{?\d*,?\d*\}?",
30
+ re.IGNORECASE
31
+ )
32
+
33
+ # 3. Alternation TLD Regex: \.(?:com|net|org)
34
+ _ALT_TLD_RE = re.compile(
35
+ r"\\\.\(\?:([a-z|]+)\)",
36
+ re.IGNORECASE
37
+ )
38
+
39
+ # Kelime yakalayıcı (domain bulmak için)
40
+ _DOMAIN_WORD_RE = re.compile(
41
+ r"([a-z0-9][-a-z0-9]*)",
42
+ re.IGNORECASE
43
+ )
44
+
45
+ @classmethod
46
+ def _extract_literal_domains(cls, valid_url: str) -> set[str]:
47
+ """Pattern 1: Literal TLD domainlerini (youtube.com) çıkarır."""
48
+ return {
49
+ m.replace(r"\.", ".").lower()
50
+ for m in cls._LITERAL_TLD_RE.findall(valid_url)
51
+ }
52
+
53
+ @classmethod
54
+ def _extract_regex_tld_domains(cls, valid_url: str) -> set[str]:
55
+ """Pattern 2: Regex TLD domainlerini (dailymotion.[...]) çıkarır ve popüler TLD'lerle birleştirir."""
56
+ domains = set()
57
+ for base in cls._REGEX_TLD_RE.findall(valid_url):
58
+ base_domain = base.lower()
59
+ for tld in cls._POPULAR_TLDS:
60
+ domains.add(f"{base_domain}.{tld}")
61
+ return domains
62
+
63
+ @classmethod
64
+ def _extract_alternation_domains(cls, valid_url: str) -> set[str]:
65
+ """Pattern 3: Alternation TLD domainlerini (pornhub.(?:com|net)) çıkarır."""
66
+ domains = set()
67
+ for m in cls._ALT_TLD_RE.finditer(valid_url):
68
+ tlds = m.group(1).split("|")
69
+ start = m.start()
70
+
71
+ # Geriye doğru git ve domain'i bul
72
+ before = valid_url[:start]
73
+
74
+ # 1. Named Groups (?P<name> temizle
75
+ before = re.sub(r"\(\?P<[^>]+>", "", before)
76
+
77
+ # 2. Simple Non-Capturing Groups (?:xxx)? temizle (sadece alphanumeric ve escape)
78
+ before = re.sub(r"\(\?:[a-z0-9-]+\)\??", "", before)
79
+
80
+ # Son domain-like kelimeyi al
81
+ words = cls._DOMAIN_WORD_RE.findall(before)
82
+ if not words:
83
+ continue
84
+
85
+ base = words[-1].lower()
86
+ for tld in tlds:
87
+ tld = tld.strip().lower()
88
+ if tld and len(tld) <= 6:
89
+ domains.add(f"{base}.{tld}")
90
+
91
+ return domains
92
+
13
93
  @classmethod
14
94
  def _init_fast_domain_regex(cls):
15
95
  """
@@ -19,44 +99,31 @@ class YTDLP(ExtractorBase):
19
99
  return
20
100
 
21
101
  domains = set()
22
-
23
- # Merkezi cache'den extractorları al
24
102
  extractors = get_ytdlp_extractors()
25
103
 
26
- # yt-dlp extractor'larının _VALID_URL regex'lerinden domain yakala
27
- # Regex metinlerinde domainler genelde "\." şeklinde geçer.
28
- domain_pat = re.compile(r"(?:[a-z0-9-]+\\\.)+[a-z]{2,}", re.IGNORECASE)
29
-
30
104
  for ie in extractors:
31
105
  valid = getattr(ie, "_VALID_URL", None)
32
106
  if not valid or not isinstance(valid, str):
33
107
  continue
34
108
 
35
- for m in domain_pat.findall(valid):
36
- d = m.replace(r"\.", ".").lower()
37
-
38
- # Çok agresif/şüpheli şeyleri elemek istersen burada filtre koyabilirsin
39
- # (genelde gerek kalmıyor)
40
- domains.add(d)
109
+ domains |= cls._extract_literal_domains(valid)
110
+ domains |= cls._extract_regex_tld_domains(valid)
111
+ domains |= cls._extract_alternation_domains(valid)
41
112
 
42
113
  # Hiç domain çıkmazsa (çok uç durum) fallback: boş regex
43
114
  if not domains:
44
115
  cls._FAST_DOMAIN_RE = re.compile(r"$^") # hiçbir şeye match etmez
45
116
  return
46
117
 
47
- # Host eşleştirmesi: subdomain destekli (m.youtube.com, player.vimeo.com vs.)
48
- # (?:^|.*\.) (domain1|domain2|...) $
49
- joined = "|".join(sorted(re.escape(d) for d in domains))
50
- pattern = rf"(?:^|.*\.)(?:{joined})$"
51
- cls._FAST_DOMAIN_RE = re.compile(pattern, re.IGNORECASE)
118
+ joined = "|".join(re.escape(d) for d in sorted(domains))
119
+ cls._FAST_DOMAIN_RE = re.compile(rf"(?:^|.*\.)(?:{joined})$", re.IGNORECASE)
52
120
 
53
121
  def __init__(self):
54
122
  self.__class__._init_fast_domain_regex()
55
123
 
56
124
  def can_handle_url(self, url: str) -> bool:
57
125
  """
58
- Fast-path: URL host'unu tek mega-regex ile kontrol et (loop yok)
59
- Slow-path: gerekirse mevcut extract_info tabanlı kontrolün
126
+ Fast-path: URL host'unu tek mega-regex ile kontrol et
60
127
  """
61
128
  # URL parse + host al
62
129
  try:
@@ -77,40 +144,7 @@ class YTDLP(ExtractorBase):
77
144
  if host and self.__class__._FAST_DOMAIN_RE.search(host):
78
145
  return True
79
146
 
80
- # SLOW PATH: Diğer siteler için yt-dlp'nin native kontrolü
81
- # try:
82
- # # stderr'ı geçici olarak kapat (hata mesajlarını gizle)
83
- # old_stderr = sys.stderr
84
- # sys.stderr = open(os.devnull, "w")
85
-
86
- # try:
87
- # ydl_opts = {
88
- # "simulate" : True, # Download yok, sadece tespit
89
- # "quiet" : True, # Log kirliliği yok
90
- # "no_warnings" : True, # Uyarı mesajları yok
91
- # "extract_flat" : True, # Minimal işlem
92
- # "no_check_certificates" : True,
93
- # "ignoreerrors" : True, # Hataları yoksay
94
- # "socket_timeout" : 3,
95
- # "retries" : 1
96
- # }
97
-
98
- # with yt_dlp.YoutubeDL(ydl_opts) as ydl:
99
- # # URL'yi işleyebiliyor mu kontrol et
100
- # info = ydl.extract_info(url, download=False, process=False)
101
-
102
- # # Generic extractor ise atla
103
- # if info and info.get("extractor_key") != "Generic":
104
- # return True
105
-
106
- # return False
107
- # finally:
108
- # # stderr'ı geri yükle
109
- # sys.stderr.close()
110
- # sys.stderr = old_stderr
111
-
112
- # except Exception:
113
- # yt-dlp işleyemezse False döndür
147
+ # yt-dlp işleyemezse False döndür
114
148
  return False
115
149
 
116
150
  async def extract(self, url: str, referer: str | None = None) -> ExtractResult:
@@ -3,7 +3,7 @@
3
3
  from KekikStream.Core import PluginBase, MainPageResult, SearchResult, MovieInfo, ExtractResult, Subtitle
4
4
  from parsel import Selector
5
5
  from Kekik.Sifreleme import Packer, StreamDecoder
6
- import random, string, re
6
+ import random, string, re, base64
7
7
 
8
8
  class HDFilmCehennemi(PluginBase):
9
9
  name = "HDFilmCehennemi"
@@ -146,17 +146,85 @@ class HDFilmCehennemi(PluginBase):
146
146
 
147
147
  return results
148
148
 
149
+ def hdch_decode(self, value_parts: list[str]) -> str:
150
+ """
151
+ HDFilmCehennemi için özel decoder.
152
+ JavaScript sırası: join -> reverse -> atob -> atob -> shift_back
153
+ """
154
+ try:
155
+ # 1. Parçaları birleştir
156
+ joined = ''.join(value_parts)
157
+
158
+ # 2. Ters çevir (REV)
159
+ result = StreamDecoder._reverse(joined)
160
+
161
+ # 3. İlk base64 decode (B64D)
162
+ result = StreamDecoder._base64_decode(result)
163
+ if result is None:
164
+ return ""
165
+
166
+ # 4. İkinci base64 decode (B64D) - JavaScript'te iki kez atob yapılıyor!
167
+ result = StreamDecoder._base64_decode(result)
168
+ if result is None:
169
+ return ""
170
+
171
+ # 5. Shift back (SHF)
172
+ result = StreamDecoder._shift_back(result)
173
+
174
+ return result
175
+ except Exception:
176
+ return ""
177
+
178
+ def extract_hdch_url(self, unpacked: str) -> str:
179
+ """HDFilmCehennemi unpacked script'ten video URL'sini çıkar"""
180
+ # 1) Decode fonksiyonunun adını bul: function <NAME>(value_parts)
181
+ match_fn = re.search(r'function\s+(\w+)\s*\(\s*value_parts\s*\)', unpacked)
182
+ if not match_fn:
183
+ return ""
184
+
185
+ fn_name = match_fn.group(1)
186
+
187
+ # 2) Bu fonksiyonun array ile çağrıldığı yeri bul: <NAME>([ ... ])
188
+ array_call_regex = re.compile(rf'{re.escape(fn_name)}\(\s*\[(.*?)\]\s*\)', re.DOTALL)
189
+ match_call = array_call_regex.search(unpacked)
190
+ if not match_call:
191
+ return ""
192
+
193
+ array_body = match_call.group(1)
194
+
195
+ # 3) Array içindeki string parçalarını topla
196
+ parts = re.findall(r'["\']([^"\']+)["\']', array_body)
197
+ if not parts:
198
+ return ""
199
+
200
+ # 4) Özel decoder ile çöz
201
+ return self.hdch_decode(parts)
202
+
149
203
  async def invoke_local_source(self, iframe: str, source: str, url: str):
150
- self.httpx.headers.update({"Referer": f"{self.main_url}/"})
204
+ self.httpx.headers.update({
205
+ "Referer": f"{self.main_url}/",
206
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0"
207
+ })
151
208
  istek = await self.httpx.get(iframe)
152
209
 
210
+ if not istek.text:
211
+ return await self.cehennempass(iframe.split("/")[-1])
212
+
213
+ # eval(function...) içeren packed script bul
214
+ eval_match = re.search(r'(eval\(function[\s\S]+)', istek.text)
215
+ if not eval_match:
216
+ return await self.cehennempass(iframe.split("/")[-1])
217
+
153
218
  try:
154
- eval_func = re.compile(r'\s*(eval\(function[\s\S].*)\s*').findall(istek.text)[0]
219
+ unpacked = Packer.unpack(eval_match.group(1))
155
220
  except Exception:
156
221
  return await self.cehennempass(iframe.split("/")[-1])
157
222
 
158
- unpacked = Packer.unpack(eval_func)
159
- video_url = StreamDecoder.extract_stream_url(unpacked)
223
+ # HDFilmCehennemi özel decoder ile video URL'sini çıkar
224
+ video_url = self.extract_hdch_url(unpacked)
225
+
226
+ if not video_url:
227
+ return await self.cehennempass(iframe.split("/")[-1])
160
228
 
161
229
  subtitles = []
162
230
  try:
@@ -200,8 +268,15 @@ class HDFilmCehennemi(PluginBase):
200
268
  match = re.search(r'data-src=\\\"([^"]+)', api_get.text)
201
269
  iframe = match[1].replace("\\", "") if match else None
202
270
 
203
- if iframe and "?rapidrame_id=" in iframe:
204
- iframe = f"{self.main_url}/playerr/{iframe.split('?rapidrame_id=')[1]}"
271
+ if not iframe:
272
+ continue
273
+
274
+ # mobi URL'si varsa direkt kullan (query string'i kaldır)
275
+ if "mobi" in iframe:
276
+ iframe = iframe.split("?")[0] # rapidrame_id query param'ı kaldır
277
+ # mobi değilse ve rapidrame varsa rplayer kullan
278
+ elif "rapidrame" in iframe and "?rapidrame_id=" in iframe:
279
+ iframe = f"{self.main_url}/rplayer/{iframe.split('?rapidrame_id=')[1]}"
205
280
 
206
281
  video_data_list = await self.invoke_local_source(iframe, source, url)
207
282
  if not video_data_list:
@@ -199,6 +199,13 @@ class SetFilmIzle(PluginBase):
199
199
 
200
200
  nonce = secici.css("div#playex::attr(data-nonce)").get() or ""
201
201
 
202
+ # partKey to dil label mapping
203
+ part_key_labels = {
204
+ "turkcedublaj" : "Türkçe Dublaj",
205
+ "turkcealtyazi" : "Türkçe Altyazı",
206
+ "orijinal" : "Orijinal"
207
+ }
208
+
202
209
  links = []
203
210
  for player in secici.css("nav.player a"):
204
211
  source_id = player.css("::attr(data-post-id)").get()
@@ -233,10 +240,19 @@ class SetFilmIzle(PluginBase):
233
240
  if "setplay" not in iframe_url and part_key:
234
241
  iframe_url = f"{iframe_url}?partKey={part_key}"
235
242
 
243
+ # Dil etiketi oluştur
244
+ label = part_key_labels.get(part_key, "")
245
+ if not label and part_key:
246
+ label = part_key.replace("_", " ").title()
247
+
236
248
  extractor = self.ex_manager.find_extractor(iframe_url)
249
+ name = extractor.name if extractor else player_name or "Direct Link"
250
+ if label:
251
+ name = f"{name} | {label}"
252
+
237
253
  links.append({
238
254
  "url" : iframe_url,
239
- "name" : extractor.name if extractor else player_name or "Direct Link",
255
+ "name" : name,
240
256
  "referer" : self.main_url
241
257
  })
242
258
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: KekikStream
3
- Version: 2.0.5
3
+ Version: 2.0.7
4
4
  Summary: terminal üzerinden medya içeriği aramanızı ve VLC/MPV gibi popüler medya oynatıcılar aracılığıyla doğrudan izlemenizi sağlayan modüler ve genişletilebilir bir bıdı bıdı
5
5
  Home-page: https://github.com/keyiflerolsun/KekikStream
6
6
  Author: keyiflerolsun
@@ -47,7 +47,7 @@ KekikStream/Extractors/VidMoly.py,sha256=zuo3LqaDJ0Qs6H6l9z5TjosTSpsQ37KEBXQpGVO
47
47
  KekikStream/Extractors/VidMoxy.py,sha256=LT7wTKBtuuagXwfGjWZwQF2NQGuChurZJ-I6gM0Jcek,1771
48
48
  KekikStream/Extractors/VidPapi.py,sha256=g9ohdL9VJrxy4N7xerbIRz3ZxjsXFHlJWy0NaZ31hFY,3259
49
49
  KekikStream/Extractors/VideoSeyred.py,sha256=M6QPZ_isX9vM_7LPo-2I_8Cf1vB9awHw8vvzBODtoiQ,1977
50
- KekikStream/Extractors/YTDLP.py,sha256=KKvvv6XiKM57NON2Vpw24O31xUKpgcovHTPYh05QHW8,6543
50
+ KekikStream/Extractors/YTDLP.py,sha256=Hy8loCSFSquu2zaL3INord-Jm6T8CM6K2-VcDA2K79g,7390
51
51
  KekikStream/Extractors/YildizKisaFilm.py,sha256=R_JlrOVeMiDlXYcuTdItnKvidyx8_u3B14fSrxew2aE,1316
52
52
  KekikStream/Plugins/BelgeselX.py,sha256=WdCeU_Zvsph0kHt7jAWaZ3DQ_2rxaFChmhGKPcHLJpo,8728
53
53
  KekikStream/Plugins/DiziBox.py,sha256=sxM7ckKeKwMrMkRNUAvh5wE9wdOuVda6Ag_zAdwSvi8,9935
@@ -59,13 +59,13 @@ KekikStream/Plugins/FilmMakinesi.py,sha256=xKI7iw3xvmIgyI2oir3bAWXVMFbaEDo6JrqhV
59
59
  KekikStream/Plugins/FilmModu.py,sha256=0qFkpX7zuH3GCwmseoKpXLved5Yg243oJb8N7DySrCQ,6871
60
60
  KekikStream/Plugins/FullHDFilm.py,sha256=kkb-JtWf23uiEzP9f_uds0tROYiKOyxcX0D-jNtQFi0,7005
61
61
  KekikStream/Plugins/FullHDFilmizlesene.py,sha256=8ozxyuJnivFe1Cu_Fb8HjVPH-ptKCSWawYzGFcA1B98,6160
62
- KekikStream/Plugins/HDFilmCehennemi.py,sha256=-PV2u4ep6TvpuycaivkmaWie60k99T-rNtqfg5n7k5M,9584
62
+ KekikStream/Plugins/HDFilmCehennemi.py,sha256=dwTEb2i7BxHE3Iy60A8WOVl4Rtm2DvS0FfTUQ3Vu3IA,12409
63
63
  KekikStream/Plugins/JetFilmizle.py,sha256=Jm2cYEgV_bRXVjrDtnLTelvyxGHVAUCZkKmP3lUkEA8,6631
64
64
  KekikStream/Plugins/KultFilmler.py,sha256=fABm74yQhEUsvuWRSEK0jiy0VJflxtFZ5p65UDC_NP0,9103
65
65
  KekikStream/Plugins/RecTV.py,sha256=dF3Ogf7KE_zpfLQRjVcEJQMuWtBtHo6iB73_ECQEJ58,7544
66
66
  KekikStream/Plugins/RoketDizi.py,sha256=PY9Cf6X0I21FdMj0K48WwvwRPtznoqI3mMsctXAeLHs,8672
67
67
  KekikStream/Plugins/SelcukFlix.py,sha256=rajt0BbdiJDFvihD5HmjwizNdgmOXb3BN8c4Ju7aRkc,12533
68
- KekikStream/Plugins/SetFilmIzle.py,sha256=deHLi0PvOUOz6L7wru-t8jWCHrYJ01qfWMLAyGAzLcg,9727
68
+ KekikStream/Plugins/SetFilmIzle.py,sha256=buz8B8MOTPw-TMV8U-k4IG3PUEFFKtOXb0fV7VZlwMA,10224
69
69
  KekikStream/Plugins/SezonlukDizi.py,sha256=vW-Mvk63Y9sAJmPnY1IdFwBzCMEB2tF03zwHVETZTtI,7262
70
70
  KekikStream/Plugins/SineWix.py,sha256=xdTeg8GHUpyZsY6EQ5I1ZIT4-lB_qwBwvHQVmdMPpEI,7364
71
71
  KekikStream/Plugins/Sinefy.py,sha256=riB2lgSSG5MkgxnVtX1OlApBcHG6vVjfiHyJ6h8_6DM,9965
@@ -73,9 +73,9 @@ KekikStream/Plugins/SinemaCX.py,sha256=dIJUOOtWSyMx7vGOE1NjrsCeW1n5DHh40--KSiW0k
73
73
  KekikStream/Plugins/Sinezy.py,sha256=gdszlee5QpUka0qMzGMbBoXwJCtZbe5hlA5o9FJQI1o,6226
74
74
  KekikStream/Plugins/SuperFilmGeldi.py,sha256=4kgdWpYCLBSAn2XfL1usFG33LsTtDvo28fmDecwNA_U,5480
75
75
  KekikStream/Plugins/UgurFilm.py,sha256=sQatQ2zb9NER8J52DRLI5K9EnYFv4I1ZgZ22HtauX3Q,4813
76
- kekikstream-2.0.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
77
- kekikstream-2.0.5.dist-info/METADATA,sha256=ZjBv64LipReZl9qjFkDcELL93TtS5hOVlaqkm1iGG2I,10090
78
- kekikstream-2.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
79
- kekikstream-2.0.5.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
80
- kekikstream-2.0.5.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
81
- kekikstream-2.0.5.dist-info/RECORD,,
76
+ kekikstream-2.0.7.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
77
+ kekikstream-2.0.7.dist-info/METADATA,sha256=xuc3sfApA6A_sT8w-BECu-zUC6kG-qTmF2SN4hOp73I,10090
78
+ kekikstream-2.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
79
+ kekikstream-2.0.7.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
80
+ kekikstream-2.0.7.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
81
+ kekikstream-2.0.7.dist-info/RECORD,,