KekikStream 0.2.4__tar.gz → 0.2.5__tar.gz

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.
Files changed (48) hide show
  1. kekikstream-0.2.5/KekikStream/Extractors/Odnoklassniki.py +94 -0
  2. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/VidMoly.py +17 -18
  3. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Plugins/SineWix.py +3 -0
  4. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/__init__.py +21 -2
  5. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream.egg-info/PKG-INFO +1 -1
  6. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream.egg-info/SOURCES.txt +1 -0
  7. {kekikstream-0.2.4 → kekikstream-0.2.5}/PKG-INFO +1 -1
  8. {kekikstream-0.2.4 → kekikstream-0.2.5}/setup.py +1 -1
  9. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/CLI/__init__.py +0 -0
  10. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/CLI/check_update.py +0 -0
  11. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/ExtractorBase.py +0 -0
  12. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/ExtractorLoader.py +0 -0
  13. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/ExtractorModels.py +0 -0
  14. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/MediaHandler.py +0 -0
  15. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/PluginBase.py +0 -0
  16. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/PluginLoader.py +0 -0
  17. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/PluginModels.py +0 -0
  18. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Core/__init__.py +0 -0
  19. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/CloseLoad.py +0 -0
  20. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/MailRu.py +0 -0
  21. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/PixelDrain.py +0 -0
  22. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/RapidVid.py +0 -0
  23. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/SibNet.py +0 -0
  24. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/Sobreatsesuyp.py +0 -0
  25. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/TRsTX.py +0 -0
  26. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/TauVideo.py +0 -0
  27. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/TurboImgz.py +0 -0
  28. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Extractors/VidMoxy.py +0 -0
  29. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Managers/ExtractorManager.py +0 -0
  30. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Managers/MediaManager.py +0 -0
  31. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Managers/PluginManager.py +0 -0
  32. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Managers/UIManager.py +0 -0
  33. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Managers/__init__.py +0 -0
  34. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Plugins/FilmMakinesi.py +0 -0
  35. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Plugins/FullHDFilmizlesene.py +0 -0
  36. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Plugins/JetFilmizle.py +0 -0
  37. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Plugins/SezonlukDizi.py +0 -0
  38. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/Plugins/UgurFilm.py +0 -0
  39. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/__main__.py +0 -0
  40. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream/requirements.txt +0 -0
  41. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream.egg-info/dependency_links.txt +0 -0
  42. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream.egg-info/entry_points.txt +0 -0
  43. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream.egg-info/requires.txt +0 -0
  44. {kekikstream-0.2.4 → kekikstream-0.2.5}/KekikStream.egg-info/top_level.txt +0 -0
  45. {kekikstream-0.2.4 → kekikstream-0.2.5}/LICENSE +0 -0
  46. {kekikstream-0.2.4 → kekikstream-0.2.5}/MANIFEST.in +0 -0
  47. {kekikstream-0.2.4 → kekikstream-0.2.5}/README.md +0 -0
  48. {kekikstream-0.2.4 → kekikstream-0.2.5}/setup.cfg +0 -0
@@ -0,0 +1,94 @@
1
+ # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
+
3
+ from KekikStream.Core import ExtractorBase, ExtractResult
4
+ import re
5
+ import json
6
+
7
+ class Odnoklassniki(ExtractorBase):
8
+ name = "Odnoklassniki"
9
+ main_url = "https://odnoklassniki.ru"
10
+
11
+ async def extract(self, url, referer=None) -> ExtractResult:
12
+ if referer:
13
+ self.oturum.headers.update({"Referer": referer})
14
+
15
+ self.oturum.headers.update({
16
+ "User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36"
17
+ })
18
+
19
+ try:
20
+ # İlk isteği yap, ancak yönlendirmeyi manuel olarak kontrol et.
21
+ istek = await self.oturum.get(url, follow_redirects=False)
22
+ if istek.status_code == 302: # Yönlendirme varsa
23
+ redirected_url = istek.headers.get("Location")
24
+ if not redirected_url:
25
+ raise ValueError("Redirect location not found.")
26
+
27
+ # Yönlendirilmiş URL'yi kullanarak isteği yeniden yap.
28
+ url = redirected_url if redirected_url.startswith("http") else f"https://{redirected_url}"
29
+ istek = await self.oturum.get(url)
30
+
31
+ istek.raise_for_status()
32
+ except Exception as e:
33
+ raise RuntimeError(f"Failed to fetch the URL: {url}, Error: {e}")
34
+
35
+ response_text = (
36
+ istek.text.replace("\\"", "\"")
37
+ .replace("\\\\", "\\")
38
+ .replace(r"\\u", "\\u")
39
+ )
40
+ response_text = re.sub(
41
+ r"\\u([0-9A-Fa-f]{4})",
42
+ lambda match: chr(int(match.group(1), 16)),
43
+ response_text
44
+ )
45
+
46
+ videos_match = re.search(r'"videos":(\[.*?\])', response_text)
47
+ if not videos_match:
48
+ raise ValueError("No video data found in the response.")
49
+
50
+ videos_str = videos_match.group(1)
51
+ try:
52
+ videos = json.loads(videos_str)
53
+ except json.JSONDecodeError:
54
+ raise ValueError("Failed to parse video data.")
55
+
56
+ quality_order = {
57
+ "ULTRA": 6, # 4K veya daha yüksek
58
+ "QUAD": 5, # 1440p
59
+ "FULL": 4, # 1080p
60
+ "HD": 3, # 720p
61
+ "SD": 2, # 480p
62
+ "LOW": 1, # 360p
63
+ "MOBILE": 0 # 144p
64
+ }
65
+
66
+ # Kaliteye göre en iyi videoyu seçme
67
+ best_video = None
68
+ best_quality_score = -1
69
+
70
+ for video in videos:
71
+ video_url = video.get("url")
72
+ quality_name = video.get("name", "").upper()
73
+
74
+ if not video_url or not quality_name:
75
+ continue
76
+
77
+ # Kalite sıralamasına göre puanla
78
+ quality_score = quality_order.get(quality_name, -1)
79
+ if quality_score > best_quality_score:
80
+ best_quality_score = quality_score
81
+ best_video = video_url
82
+
83
+ if not best_video:
84
+ raise ValueError("No valid video URLs found.")
85
+
86
+ if best_video.startswith("//"):
87
+ best_video = f"https:{best_video}"
88
+
89
+ return ExtractResult(
90
+ name = self.name,
91
+ url = best_video,
92
+ referer = self.main_url,
93
+ subtitles = []
94
+ )
@@ -14,24 +14,23 @@ class VidMoly(ExtractorBase):
14
14
  if referer:
15
15
  self.oturum.headers.update({"Referer": referer})
16
16
 
17
- headers = {
18
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
19
- "Sec-Fetch-Dest": "iframe",
20
- }
17
+ self.oturum.headers.update({
18
+ "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
19
+ "Sec-Fetch-Dest" : "iframe",
20
+ })
21
21
 
22
22
  # Embed URL oluştur
23
- embed_url = (
24
- url.replace("/w/", "/embed-") + "-920x360.html" if "/w/" in url else url
25
- )
23
+ embed_url = url.replace("/w/", "/embed-") + "-920x360.html" if "/w/" in url else url
26
24
  script_content = None
27
- attempts = 0
25
+ attempts = 0
28
26
 
29
27
  # Script verisini almak için deneme yap
30
28
  while attempts < 10 and not script_content:
31
29
  attempts += 1
32
- response = await self.oturum.get(embed_url, headers=headers)
30
+ response = await self.oturum.get(embed_url)
33
31
  response.raise_for_status()
34
- script_match = re.search(r"sources:\s*\[(.*?)\],", response.text, re.DOTALL)
32
+
33
+ script_match = re.search(r"sources:\s*\[(.*?)\],", response.text, re.DOTALL)
35
34
  script_content = script_match.group(1) if script_match else None
36
35
  if not script_content:
37
36
  await asyncio.sleep(0.5)
@@ -58,11 +57,11 @@ class VidMoly(ExtractorBase):
58
57
  subtitle_sources = json.loads(f"[{subtitle_data}]")
59
58
  subtitles = [
60
59
  Subtitle(
61
- name=sub.get("label"),
62
- url=self.fix_url(sub.get("file")),
60
+ name = sub.get("label"),
61
+ url = self.fix_url(sub.get("file")),
63
62
  )
64
- for sub in subtitle_sources
65
- if sub.get("kind") == "captions"
63
+ for sub in subtitle_sources
64
+ if sub.get("kind") == "captions"
66
65
  ]
67
66
  except json.JSONDecodeError:
68
67
  pass
@@ -80,10 +79,10 @@ class VidMoly(ExtractorBase):
80
79
 
81
80
  await self.close()
82
81
  return ExtractResult(
83
- name=self.name,
84
- url=video_url,
85
- referer=self.main_url,
86
- subtitles=subtitles,
82
+ name = self.name,
83
+ url = video_url,
84
+ referer = self.main_url,
85
+ subtitles = subtitles
87
86
  )
88
87
 
89
88
  def _add_marks(self, text: str, field: str) -> str:
@@ -50,6 +50,9 @@ class SineWix(PluginBase):
50
50
  episodes = []
51
51
  for season in veri.get("seasons"):
52
52
  for episode in season.get("episodes"):
53
+ if not episode.get("videos"):
54
+ continue
55
+
53
56
  ep_model = Episode(
54
57
  season = season.get("season_number"),
55
58
  episode = episode.get("episode_number"),
@@ -25,6 +25,20 @@ class KekikStream:
25
25
  finally:
26
26
  await self.plugin_manager.close_plugins()
27
27
 
28
+ async def handle_no_results(self):
29
+ action = await self.ui_manager.select_from_list(
30
+ message = "Ne yapmak istersiniz?",
31
+ choices = ["Geri Git", "Ana Menü", "Çıkış"]
32
+ )
33
+
34
+ match action:
35
+ case "Geri Git":
36
+ await self.search_all()
37
+ case "Ana Menü":
38
+ await self.run()
39
+ case "Çıkış":
40
+ cikis_yap(False)
41
+
28
42
  async def select_plugin(self):
29
43
  plugin_name = await self.ui_manager.select_from_fuzzy(
30
44
  message = "Arama yapılacak eklentiyi seçin:",
@@ -113,6 +127,10 @@ class KekikStream:
113
127
  await self.show_options(links)
114
128
 
115
129
  async def show_options(self, links):
130
+ if not links:
131
+ konsol.print("[bold red]Hiçbir bağlantı bulunamadı![/bold red]")
132
+ return await self.handle_no_results()
133
+
116
134
  mapping = self.extractor_manager.map_links_to_extractors(links)
117
135
  has_play_method = hasattr(self.current_plugin, "play") and callable(getattr(self.current_plugin, "play", None))
118
136
  # ! DEBUG
@@ -120,7 +138,7 @@ class KekikStream:
120
138
  if not mapping and not has_play_method:
121
139
  konsol.print("[bold red]Hiçbir Extractor bulunamadı![/bold red]")
122
140
  konsol.print(links)
123
- return
141
+ return await self.handle_no_results()
124
142
 
125
143
  if not mapping:
126
144
  selected_link = await self.ui_manager.select_from_list(
@@ -146,7 +164,7 @@ class KekikStream:
146
164
  await self.play_media(selected_link)
147
165
 
148
166
  case "Geri Git":
149
- await self.search()
167
+ await self.search_all()
150
168
 
151
169
  case _:
152
170
  await self.run()
@@ -203,6 +221,7 @@ class KekikStream:
203
221
 
204
222
  if not all_results:
205
223
  konsol.print("[bold red]Hiçbir sonuç bulunamadı![/bold red]")
224
+ await self.handle_no_results()
206
225
  return []
207
226
 
208
227
  return all_results
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: KekikStream
3
- Version: 0.2.4
3
+ Version: 0.2.5
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
@@ -23,6 +23,7 @@ KekikStream/Core/PluginModels.py
23
23
  KekikStream/Core/__init__.py
24
24
  KekikStream/Extractors/CloseLoad.py
25
25
  KekikStream/Extractors/MailRu.py
26
+ KekikStream/Extractors/Odnoklassniki.py
26
27
  KekikStream/Extractors/PixelDrain.py
27
28
  KekikStream/Extractors/RapidVid.py
28
29
  KekikStream/Extractors/SibNet.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: KekikStream
3
- Version: 0.2.4
3
+ Version: 0.2.5
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
@@ -6,7 +6,7 @@ from io import open
6
6
  setup(
7
7
  # ? Genel Bilgiler
8
8
  name = "KekikStream",
9
- version = "0.2.4",
9
+ version = "0.2.5",
10
10
  url = "https://github.com/keyiflerolsun/KekikStream",
11
11
  description = "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ı",
12
12
  keywords = ["KekikStream", "KekikAkademi", "keyiflerolsun"],
File without changes
File without changes
File without changes
File without changes