KekikStream 0.3.4__tar.gz → 0.3.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 (63) hide show
  1. kekikstream-0.3.5/KekikStream/__init__.py +248 -0
  2. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream.egg-info/PKG-INFO +1 -1
  3. {kekikstream-0.3.4 → kekikstream-0.3.5}/PKG-INFO +1 -1
  4. {kekikstream-0.3.4 → kekikstream-0.3.5}/setup.py +1 -1
  5. kekikstream-0.3.4/KekikStream/__init__.py +0 -258
  6. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/CLI/__init__.py +0 -0
  7. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/CLI/pypi_kontrol.py +0 -0
  8. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/ExtractorBase.py +0 -0
  9. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/ExtractorLoader.py +0 -0
  10. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/ExtractorModels.py +0 -0
  11. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/MediaHandler.py +0 -0
  12. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/PluginBase.py +0 -0
  13. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/PluginLoader.py +0 -0
  14. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/PluginModels.py +0 -0
  15. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Core/__init__.py +0 -0
  16. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/CloseLoad.py +0 -0
  17. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/ContentX.py +0 -0
  18. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/FourCX.py +0 -0
  19. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/FourPichive.py +0 -0
  20. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/FourPlayRu.py +0 -0
  21. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/HDStreamAble.py +0 -0
  22. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/Hotlinger.py +0 -0
  23. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/MailRu.py +0 -0
  24. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/MixPlayHD.py +0 -0
  25. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/Odnoklassniki.py +0 -0
  26. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/OkRuHTTP.py +0 -0
  27. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/OkRuSSL.py +0 -0
  28. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/PeaceMakerst.py +0 -0
  29. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/Pichive.py +0 -0
  30. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/PixelDrain.py +0 -0
  31. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/PlayRu.py +0 -0
  32. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/RapidVid.py +0 -0
  33. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/SibNet.py +0 -0
  34. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/Sobreatsesuyp.py +0 -0
  35. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/TRsTX.py +0 -0
  36. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/TauVideo.py +0 -0
  37. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/TurboImgz.py +0 -0
  38. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/VidMoly.py +0 -0
  39. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/VidMoxy.py +0 -0
  40. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Extractors/VideoSeyred.py +0 -0
  41. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Managers/ExtractorManager.py +0 -0
  42. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Managers/MediaManager.py +0 -0
  43. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Managers/PluginManager.py +0 -0
  44. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Managers/UIManager.py +0 -0
  45. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Managers/__init__.py +0 -0
  46. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/DiziBox.py +0 -0
  47. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/FilmMakinesi.py +0 -0
  48. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/FullHDFilmizlesene.py +0 -0
  49. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/JetFilmizle.py +0 -0
  50. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/SezonlukDizi.py +0 -0
  51. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/SineWix.py +0 -0
  52. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/Plugins/UgurFilm.py +0 -0
  53. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/__main__.py +0 -0
  54. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream/requirements.txt +0 -0
  55. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream.egg-info/SOURCES.txt +0 -0
  56. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream.egg-info/dependency_links.txt +0 -0
  57. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream.egg-info/entry_points.txt +0 -0
  58. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream.egg-info/requires.txt +0 -0
  59. {kekikstream-0.3.4 → kekikstream-0.3.5}/KekikStream.egg-info/top_level.txt +0 -0
  60. {kekikstream-0.3.4 → kekikstream-0.3.5}/LICENSE +0 -0
  61. {kekikstream-0.3.4 → kekikstream-0.3.5}/MANIFEST.in +0 -0
  62. {kekikstream-0.3.4 → kekikstream-0.3.5}/README.md +0 -0
  63. {kekikstream-0.3.4 → kekikstream-0.3.5}/setup.cfg +0 -0
@@ -0,0 +1,248 @@
1
+ # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
+
3
+ from .CLI import konsol, cikis_yap, hata_yakala, pypi_kontrol_guncelle
4
+ from .Managers import PluginManager, ExtractorManager, UIManager, MediaManager
5
+ from .Core import PluginBase, ExtractorBase, SeriesInfo
6
+ from asyncio import run
7
+
8
+ class KekikStream:
9
+ def __init__(self):
10
+ self.eklentiler_yonetici = PluginManager()
11
+ self.cikaricilar_yonetici = ExtractorManager()
12
+ self.arayuz_yonetici = UIManager()
13
+ self.medya_yonetici = MediaManager()
14
+ self.suanki_eklenti: PluginBase = None
15
+
16
+ async def calistir(self):
17
+ self.arayuz_yonetici.clear_console()
18
+ konsol.rule("[bold cyan]KekikStream Başlatılıyor[/bold cyan]")
19
+ if not self.eklentiler_yonetici.get_plugin_names():
20
+ konsol.print("[bold red]Hiçbir eklenti bulunamadı![/bold red]")
21
+ return
22
+
23
+ try:
24
+ await self.eklenti_sec()
25
+ finally:
26
+ await self.eklentiler_yonetici.close_plugins()
27
+
28
+ async def hicbir_sonuc_bulunamazsa(self):
29
+ secim = await self.arayuz_yonetici.select_from_list(
30
+ message = "Ne yapmak istersiniz?",
31
+ choices = ["Tüm Eklentilerde Ara", "Ana Menü", "Çıkış"]
32
+ )
33
+
34
+ match secim:
35
+ case "Tüm Eklentilerde Ara":
36
+ await self.tum_eklentilerde_ara()
37
+ case "Ana Menü":
38
+ await self.calistir()
39
+ case "Çıkış":
40
+ cikis_yap(False)
41
+
42
+ async def eklenti_sec(self):
43
+ eklenti_adi = await self.arayuz_yonetici.select_from_fuzzy(
44
+ message = "Arama yapılacak eklentiyi seçin:",
45
+ choices = ["Tüm Eklentilerde Ara", *self.eklentiler_yonetici.get_plugin_names()]
46
+ )
47
+
48
+ if eklenti_adi == "Tüm Eklentilerde Ara":
49
+ await self.tum_eklentilerde_ara()
50
+ else:
51
+ self.suanki_eklenti = self.eklentiler_yonetici.select_plugin(eklenti_adi)
52
+ await self.eklenti_ile_ara()
53
+
54
+ async def eklenti_ile_ara(self):
55
+ self.arayuz_yonetici.clear_console()
56
+ konsol.rule(f"[bold cyan]{self.suanki_eklenti.name} Eklentisinde Arama Yapın[/bold cyan]")
57
+
58
+ sorgu = await self.arayuz_yonetici.prompt_text("Arama sorgusu girin:")
59
+ sonuclar = await self.suanki_eklenti.search(sorgu)
60
+
61
+ if not sonuclar:
62
+ konsol.print("[bold red]Arama sonucu bulunamadı![/bold red]")
63
+ return await self.hicbir_sonuc_bulunamazsa()
64
+
65
+ if secilen_sonuc:= await self.sonuc_sec(sonuclar) :
66
+ await self.detaylari_goster({"plugin": self.suanki_eklenti.name, "url": secilen_sonuc})
67
+
68
+ async def tum_eklentilerde_ara(self):
69
+ self.arayuz_yonetici.clear_console()
70
+ konsol.rule("[bold cyan]Tüm Eklentilerde Arama Yapın[/bold cyan]")
71
+
72
+ sorgu = await self.arayuz_yonetici.prompt_text("Arama sorgusu girin:")
73
+ sonuclar = await self.tum_eklentilerde_arama(sorgu)
74
+
75
+ if not sonuclar:
76
+ return await self.hicbir_sonuc_bulunamazsa()
77
+
78
+ secilen_sonuc = await self.tum_sonuc_sec(sonuclar)
79
+
80
+ if secilen_sonuc:
81
+ await self.detaylari_goster(secilen_sonuc)
82
+
83
+ async def sonuc_sec(self, sonuclar):
84
+ return await self.arayuz_yonetici.select_from_fuzzy(
85
+ message = "İçerik sonuclarından birini seçin:",
86
+ choices = [{"name": sonuc.title, "value": sonuc.url} for sonuc in sonuclar]
87
+ )
88
+
89
+ async def detaylari_goster(self, secilen_sonuc):
90
+ try:
91
+ if isinstance(secilen_sonuc, dict) and "plugin" in secilen_sonuc:
92
+ eklenti_adi = secilen_sonuc["plugin"]
93
+ url = secilen_sonuc["url"]
94
+
95
+ self.suanki_eklenti = self.eklentiler_yonetici.select_plugin(eklenti_adi)
96
+ else:
97
+ url = secilen_sonuc
98
+
99
+ medya_bilgi = await self.suanki_eklenti.load_item(url)
100
+ except Exception as hata:
101
+ konsol.log(secilen_sonuc)
102
+ hata_yakala(hata)
103
+ return
104
+
105
+ self.medya_yonetici.set_title(f"{self.suanki_eklenti.name} | {medya_bilgi.title}")
106
+ self.arayuz_yonetici.display_media_info(f"{self.suanki_eklenti.name} | {medya_bilgi.title}", medya_bilgi)
107
+
108
+ if isinstance(medya_bilgi, SeriesInfo):
109
+ secilen_bolum = await self.arayuz_yonetici.select_from_fuzzy(
110
+ message = "İzlemek istediğiniz bölümü seçin:",
111
+ choices = [
112
+ {"name": f"{bolum.season}. Sezon {bolum.episode}. Bölüm - {bolum.title}", "value": bolum.url}
113
+ for bolum in medya_bilgi.episodes
114
+ ]
115
+ )
116
+ if secilen_bolum:
117
+ baglantilar = await self.suanki_eklenti.load_links(secilen_bolum)
118
+ await self.secenekleri_goster(baglantilar)
119
+ else:
120
+ baglantilar = await self.suanki_eklenti.load_links(medya_bilgi.url)
121
+ await self.secenekleri_goster(baglantilar)
122
+
123
+ async def secenekleri_goster(self, baglantilar):
124
+ if not baglantilar:
125
+ konsol.print("[bold red]Hiçbir bağlantı bulunamadı![/bold red]")
126
+ return await self.hicbir_sonuc_bulunamazsa()
127
+
128
+ haritalama = self.cikaricilar_yonetici.map_links_to_extractors(baglantilar)
129
+ play_fonksiyonu_var = hasattr(self.suanki_eklenti, "play") and callable(getattr(self.suanki_eklenti, "play", None))
130
+ # ! DEBUG
131
+ # konsol.print(baglantilar)
132
+ if not haritalama and not play_fonksiyonu_var:
133
+ konsol.print("[bold red]Hiçbir Extractor bulunamadı![/bold red]")
134
+ konsol.print(baglantilar)
135
+ return await self.hicbir_sonuc_bulunamazsa()
136
+
137
+ if not haritalama:
138
+ secilen_link = await self.arayuz_yonetici.select_from_list(
139
+ message = "Doğrudan oynatmak için bir bağlantı seçin:",
140
+ choices = [{"name": self.suanki_eklenti.name, "value": link} for link in baglantilar]
141
+ )
142
+ if secilen_link:
143
+ await self.medya_oynat(secilen_link)
144
+ return
145
+
146
+ secim = await self.arayuz_yonetici.select_from_list(
147
+ message = "Ne yapmak istersiniz?",
148
+ choices = ["İzle", "Tüm Eklentilerde Ara", "Ana Menü"]
149
+ )
150
+
151
+ match secim:
152
+ case "İzle":
153
+ secilen_link = await self.arayuz_yonetici.select_from_list(
154
+ message = "İzlemek için bir bağlantı seçin:",
155
+ choices = [{"name": cikarici_adi, "value": link} for link, cikarici_adi in haritalama.items()]
156
+ )
157
+ if secilen_link:
158
+ await self.medya_oynat(secilen_link)
159
+
160
+ case "Tüm Eklentilerde Ara":
161
+ await self.tum_eklentilerde_ara()
162
+
163
+ case _:
164
+ await self.calistir()
165
+
166
+ async def medya_oynat(self, secilen_link):
167
+ if hasattr(self.suanki_eklenti, "play") and callable(self.suanki_eklenti.play):
168
+ konsol.log(f"[yellow][»] Oynatılıyor : {secilen_link}")
169
+ return await self.suanki_eklenti.play(
170
+ name = self.suanki_eklenti._data[secilen_link]["name"],
171
+ url = secilen_link,
172
+ referer = self.suanki_eklenti._data[secilen_link]["referer"],
173
+ subtitles = self.suanki_eklenti._data[secilen_link]["subtitles"]
174
+ )
175
+
176
+ cikarici: ExtractorBase = self.cikaricilar_yonetici.find_extractor(secilen_link)
177
+ if not cikarici:
178
+ return konsol.print("[bold red]Uygun Extractor bulunamadı.[/bold red]")
179
+
180
+ try:
181
+ extract_data = await cikarici.extract(secilen_link, referer=self.suanki_eklenti.main_url)
182
+ except Exception as hata:
183
+ konsol.print(f"[bold red]{cikarici.name} » hata oluştu: {hata}[/bold red]")
184
+ return await self.hicbir_sonuc_bulunamazsa()
185
+
186
+ if isinstance(extract_data, list):
187
+ secilen_data = await self.arayuz_yonetici.select_from_list(
188
+ message = "Birden fazla bağlantı bulundu, lütfen birini seçin:",
189
+ choices = [{"name": data.name, "value": data} for data in extract_data]
190
+ )
191
+ else:
192
+ secilen_data = extract_data
193
+
194
+ if secilen_data.headers.get("Cookie"):
195
+ self.medya_yonetici.set_headers({"Cookie": secilen_data.headers.get("Cookie")})
196
+
197
+ self.medya_yonetici.set_title(f"{self.medya_yonetici.get_title()} | {secilen_data.name}")
198
+ self.medya_yonetici.set_headers({"Referer": secilen_data.referer})
199
+ konsol.log(f"[yellow][»] Oynatılıyor : {secilen_data.url}")
200
+ self.medya_yonetici.play_media(secilen_data)
201
+
202
+ async def tum_eklentilerde_arama(self, sorgu: str):
203
+ tum_sonuclar = []
204
+
205
+ for eklenti_adi, eklenti in self.eklentiler_yonetici.plugins.items():
206
+ if not isinstance(eklenti, PluginBase):
207
+ konsol.print(f"[yellow][!] {eklenti_adi} geçerli bir PluginBase değil, atlanıyor...[/yellow]")
208
+ continue
209
+
210
+ konsol.log(f"[yellow][~] {eklenti_adi:<19} aranıyor...[/]")
211
+ try:
212
+ sonuclar = await eklenti.search(sorgu)
213
+ if sonuclar:
214
+ tum_sonuclar.extend(
215
+ [{"plugin": eklenti_adi, "title": sonuc.title, "url": sonuc.url, "poster": sonuc.poster} for sonuc in sonuclar]
216
+ )
217
+ except Exception as hata:
218
+ konsol.print(f"[bold red]{eklenti_adi} » hata oluştu: {hata}[/bold red]")
219
+
220
+ if not tum_sonuclar:
221
+ konsol.print("[bold red]Hiçbir sonuç bulunamadı![/bold red]")
222
+ await self.hicbir_sonuc_bulunamazsa()
223
+ return []
224
+
225
+ return tum_sonuclar
226
+
227
+ async def tum_sonuc_sec(self, sonuclar):
228
+ secenekler = [
229
+ {"name": f"{f'[{sonuc["plugin"]}]':<21} » {sonuc['title']}", "value": sonuc}
230
+ for sonuc in sonuclar
231
+ ]
232
+
233
+ return await self.arayuz_yonetici.select_from_fuzzy(
234
+ message = "Arama sonuclarından bir içerik seçin:",
235
+ choices = secenekler
236
+ )
237
+
238
+ def basla():
239
+ try:
240
+ pypi_kontrol_guncelle("KekikStream")
241
+
242
+ app = KekikStream()
243
+ run(app.calistir())
244
+ cikis_yap(False)
245
+ except KeyboardInterrupt:
246
+ cikis_yap(True)
247
+ except Exception as hata:
248
+ hata_yakala(hata)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: KekikStream
3
- Version: 0.3.4
3
+ Version: 0.3.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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: KekikStream
3
- Version: 0.3.4
3
+ Version: 0.3.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.3.4",
9
+ version = "0.3.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"],
@@ -1,258 +0,0 @@
1
- # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
-
3
- from .CLI import konsol, cikis_yap, hata_yakala, pypi_kontrol_guncelle
4
- from .Managers import PluginManager, ExtractorManager, UIManager, MediaManager
5
- from .Core import PluginBase, ExtractorBase, SeriesInfo
6
- from asyncio import run
7
-
8
- class KekikStream:
9
- def __init__(self):
10
- self.plugin_manager = PluginManager()
11
- self.extractor_manager = ExtractorManager()
12
- self.ui_manager = UIManager()
13
- self.media_manager = MediaManager()
14
- self.current_plugin:PluginBase = None
15
-
16
- async def run(self):
17
- self.ui_manager.clear_console()
18
- konsol.rule("[bold cyan]KekikStream Başlatılıyor[/bold cyan]")
19
- if not self.plugin_manager.get_plugin_names():
20
- konsol.print("[bold red]Hiçbir eklenti bulunamadı![/bold red]")
21
- return
22
-
23
- try:
24
- await self.select_plugin()
25
- finally:
26
- await self.plugin_manager.close_plugins()
27
-
28
- async def handle_no_results(self):
29
- action = await self.ui_manager.select_from_list(
30
- message = "Ne yapmak istersiniz?",
31
- choices = ["Tüm Eklentilerde Ara", "Ana Menü", "Çıkış"]
32
- )
33
-
34
- match action:
35
- case "Tüm Eklentilerde Ara":
36
- await self.search_all()
37
- case "Ana Menü":
38
- await self.run()
39
- case "Çıkış":
40
- cikis_yap(False)
41
-
42
- async def select_plugin(self):
43
- plugin_name = await self.ui_manager.select_from_fuzzy(
44
- message = "Arama yapılacak eklentiyi seçin:",
45
- choices = ["Tüm Eklentilerde Ara", *self.plugin_manager.get_plugin_names()]
46
- )
47
-
48
- if plugin_name == "Tüm Eklentilerde Ara":
49
- await self.search_all()
50
- else:
51
- self.current_plugin = self.plugin_manager.select_plugin(plugin_name)
52
- await self.search_single_plugin()
53
-
54
- async def search_single_plugin(self):
55
- self.ui_manager.clear_console()
56
- konsol.rule(f"[bold cyan]{self.current_plugin.name} Eklentisinde Arama Yapın[/bold cyan]")
57
-
58
- query = await self.ui_manager.prompt_text("Arama sorgusu girin:")
59
- results = await self.current_plugin.search(query)
60
-
61
- if not results:
62
- konsol.print("[bold red]Arama sonucu bulunamadı![/bold red]")
63
- return await self.handle_no_results()
64
-
65
- selected_result = await self.select_result(results)
66
-
67
- if selected_result:
68
- await self.show_details({"plugin": self.current_plugin.name, "url": selected_result})
69
-
70
- async def search_all(self):
71
- self.ui_manager.clear_console()
72
- konsol.rule("[bold cyan]Tüm Eklentilerde Arama Yapın[/bold cyan]")
73
-
74
- query = await self.ui_manager.prompt_text("Arama sorgusu girin:")
75
- results = await self.search_all_plugins(query)
76
-
77
- if not results:
78
- return await self.handle_no_results()
79
-
80
- selected_result = await self.select_from_all_results(results)
81
-
82
- if selected_result:
83
- await self.show_details(selected_result)
84
-
85
- async def select_result(self, results):
86
- selected_url = await self.ui_manager.select_from_fuzzy(
87
- message = "İçerik sonuçlarından birini seçin:",
88
- choices = [{"name": res.title, "value": res.url} for res in results]
89
- )
90
-
91
- if selected_url:
92
- return selected_url
93
-
94
- async def show_details(self, selected_result):
95
- try:
96
- if isinstance(selected_result, dict) and "plugin" in selected_result:
97
- plugin_name = selected_result["plugin"]
98
- url = selected_result["url"]
99
-
100
- self.current_plugin = self.plugin_manager.select_plugin(plugin_name)
101
- else:
102
- url = selected_result
103
-
104
- media_info = await self.current_plugin.load_item(url)
105
- except Exception as hata:
106
- konsol.log(selected_result)
107
- hata_yakala(hata)
108
- return
109
-
110
- self.media_manager.set_title(f"{self.current_plugin.name} | {media_info.title}")
111
-
112
- self.ui_manager.display_media_info(f"{self.current_plugin.name} | {media_info.title}", media_info)
113
-
114
- if isinstance(media_info, SeriesInfo):
115
- selected_episode = await self.ui_manager.select_from_fuzzy(
116
- message = "İzlemek istediğiniz bölümü seçin:",
117
- choices = [
118
- {"name": f"{episode.season}. Sezon {episode.episode}. Bölüm - {episode.title}", "value": episode.url}
119
- for episode in media_info.episodes
120
- ]
121
- )
122
- if selected_episode:
123
- links = await self.current_plugin.load_links(selected_episode)
124
- await self.show_options(links)
125
- else:
126
- links = await self.current_plugin.load_links(media_info.url)
127
- await self.show_options(links)
128
-
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
-
134
- mapping = self.extractor_manager.map_links_to_extractors(links)
135
- has_play_method = hasattr(self.current_plugin, "play") and callable(getattr(self.current_plugin, "play", None))
136
- # ! DEBUG
137
- # konsol.print(links)
138
- if not mapping and not has_play_method:
139
- konsol.print("[bold red]Hiçbir Extractor bulunamadı![/bold red]")
140
- konsol.print(links)
141
- return await self.handle_no_results()
142
-
143
- if not mapping:
144
- selected_link = await self.ui_manager.select_from_list(
145
- message = "Doğrudan oynatmak için bir bağlantı seçin:",
146
- choices = [{"name": self.current_plugin.name, "value": link} for link in links]
147
- )
148
- if selected_link:
149
- await self.play_media(selected_link)
150
- return
151
-
152
- action = await self.ui_manager.select_from_list(
153
- message = "Ne yapmak istersiniz?",
154
- choices = ["İzle", "Geri Git", "Ana Menü"]
155
- )
156
-
157
- match action:
158
- case "İzle":
159
- selected_link = await self.ui_manager.select_from_list(
160
- message = "İzlemek için bir bağlantı seçin:",
161
- choices = [{"name": extractor_name, "value": link} for link, extractor_name in mapping.items()]
162
- )
163
- if selected_link:
164
- await self.play_media(selected_link)
165
-
166
- case "Geri Git":
167
- await self.search_all()
168
-
169
- case _:
170
- await self.run()
171
-
172
- async def play_media(self, selected_link):
173
- if hasattr(self.current_plugin, "play") and callable(self.current_plugin.play):
174
- konsol.log(f"[yellow][»] Oynatılıyor : {selected_link}")
175
- await self.current_plugin.play(
176
- name = self.current_plugin._data[selected_link]["name"],
177
- url = selected_link,
178
- referer = self.current_plugin._data[selected_link]["referer"],
179
- subtitles = self.current_plugin._data[selected_link]["subtitles"]
180
- )
181
- return
182
-
183
- extractor: ExtractorBase = self.extractor_manager.find_extractor(selected_link)
184
- if not extractor:
185
- konsol.print("[bold red]Uygun Extractor bulunamadı.[/bold red]")
186
- return
187
-
188
- try:
189
- extract_data = await extractor.extract(selected_link, referer=self.current_plugin.main_url)
190
- except Exception as hata:
191
- konsol.print(f"[bold red]{extractor.name} » hata oluştu: {hata}[/bold red]")
192
- await self.handle_no_results()
193
- return
194
-
195
- if isinstance(extract_data, list):
196
- selected_data = await self.ui_manager.select_from_list(
197
- message = "Birden fazla bağlantı bulundu, lütfen birini seçin:",
198
- choices = [{"name": data.name, "value": data} for data in extract_data]
199
- )
200
- else:
201
- selected_data = extract_data
202
-
203
- if selected_data.headers.get("Cookie"):
204
- self.media_manager.set_headers({"Cookie": selected_data.headers.get("Cookie")})
205
-
206
- self.media_manager.set_title(f"{self.media_manager.get_title()} | {selected_data.name}")
207
- self.media_manager.set_headers({"Referer": selected_data.referer})
208
- konsol.log(f"[yellow][»] Oynatılıyor : {selected_data.url}")
209
- self.media_manager.play_media(selected_data)
210
-
211
- async def search_all_plugins(self, query: str):
212
- all_results = []
213
-
214
- for plugin_name, plugin in self.plugin_manager.plugins.items():
215
- if not isinstance(plugin, PluginBase):
216
- konsol.print(f"[yellow][!] {plugin_name} geçerli bir PluginBase değil, atlanıyor...[/yellow]")
217
- continue
218
-
219
- konsol.log(f"[yellow][~] {plugin_name:<19} aranıyor...[/]")
220
- try:
221
- results = await plugin.search(query)
222
- if results:
223
- all_results.extend(
224
- [{"plugin": plugin_name, "title": result.title, "url": result.url, "poster": result.poster} for result in results]
225
- )
226
- except Exception as hata:
227
- konsol.print(f"[bold red]{plugin_name} » hata oluştu: {hata}[/bold red]")
228
-
229
- if not all_results:
230
- konsol.print("[bold red]Hiçbir sonuç bulunamadı![/bold red]")
231
- await self.handle_no_results()
232
- return []
233
-
234
- return all_results
235
-
236
- async def select_from_all_results(self, results):
237
- choices = [
238
- {"name": f"{f'[{res["plugin"]}]':<21} » {res['title']}", "value": res}
239
- for res in results
240
- ]
241
-
242
- return await self.ui_manager.select_from_fuzzy(
243
- message = "Arama sonuçlarından bir içerik seçin:",
244
- choices = choices
245
- )
246
-
247
-
248
- def basla():
249
- try:
250
- pypi_kontrol_guncelle("KekikStream")
251
-
252
- app = KekikStream()
253
- run(app.run())
254
- cikis_yap(False)
255
- except KeyboardInterrupt:
256
- cikis_yap(True)
257
- except Exception as hata:
258
- hata_yakala(hata)
File without changes
File without changes
File without changes
File without changes