KekikStream 0.1.2__py3-none-any.whl → 0.1.4__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.
@@ -29,7 +29,7 @@ class PluginLoader:
29
29
  if not plugins:
30
30
  konsol.print("[yellow][!] Yüklenecek bir Plugin bulunamadı![/yellow]")
31
31
 
32
- return plugins
32
+ return dict(sorted(plugins.items()))
33
33
 
34
34
  def _load_from_directory(self, directory: Path) -> dict[str, PluginBase]:
35
35
  plugins = {}
@@ -1,6 +1,6 @@
1
1
  # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
2
 
3
- from ..Core import PluginLoader
3
+ from ..Core import PluginLoader, PluginBase
4
4
 
5
5
  class PluginManager:
6
6
  def __init__(self, plugin_dir="Plugins"):
@@ -8,11 +8,12 @@ class PluginManager:
8
8
  self.plugins = self.plugin_loader.load_all()
9
9
 
10
10
  def get_plugin_names(self):
11
- return list(self.plugins.keys())
11
+ return sorted(list(self.plugins.keys()))
12
12
 
13
13
  def select_plugin(self, plugin_name):
14
14
  return self.plugins.get(plugin_name)
15
15
 
16
16
  async def close_plugins(self):
17
17
  for plugin in self.plugins.values():
18
- await plugin.close()
18
+ if isinstance(plugin, PluginBase):
19
+ await plugin.close()
@@ -15,6 +15,15 @@ class UIManager:
15
15
  async def select_from_list(message, choices):
16
16
  return await inquirer.select(message=message, choices=choices).execute_async()
17
17
 
18
+ @staticmethod
19
+ async def select_from_fuzzy(message, choices):
20
+ return await inquirer.fuzzy(
21
+ message = message,
22
+ choices = choices,
23
+ validate = lambda result: result in [choice if isinstance(choice, str) else choice["value"] for choice in choices],
24
+ filter = lambda result: result
25
+ ).execute_async()
26
+
18
27
  @staticmethod
19
28
  async def prompt_text(message):
20
29
  return await inquirer.text(message=message).execute_async()
KekikStream/__init__.py CHANGED
@@ -26,16 +26,18 @@ class KekikStream:
26
26
  await self.plugin_manager.close_plugins()
27
27
 
28
28
  async def select_plugin(self):
29
- plugin_name = await self.ui_manager.select_from_list(
29
+ plugin_name = await self.ui_manager.select_from_fuzzy(
30
30
  message = "Bir eklenti seçin:",
31
- choices = self.plugin_manager.get_plugin_names()
31
+ choices = ["Tüm Eklentilerde Ara", *self.plugin_manager.get_plugin_names()]
32
32
  )
33
33
 
34
- self.current_plugin = self.plugin_manager.select_plugin(plugin_name)
35
-
36
- await self.search()
34
+ if plugin_name == "Tüm Eklentilerde Ara":
35
+ await self.search_all()
36
+ else:
37
+ self.current_plugin = self.plugin_manager.select_plugin(plugin_name)
38
+ await self.search_single_plugin()
37
39
 
38
- async def search(self):
40
+ async def search_single_plugin(self):
39
41
  self.ui_manager.clear_console()
40
42
  konsol.rule(f"[bold cyan]{self.current_plugin.name} Eklentisinde Arama Yapın[/bold cyan]")
41
43
 
@@ -46,30 +48,57 @@ class KekikStream:
46
48
  konsol.print("[bold red]Arama sonucu bulunamadı![/bold red]")
47
49
  return
48
50
 
49
- await self.select_result(results)
51
+ selected_result = await self.select_result(results)
52
+
53
+ if selected_result:
54
+ await self.show_details({"plugin": self.current_plugin.name, "url": selected_result})
55
+
56
+ async def search_all(self):
57
+ self.ui_manager.clear_console()
58
+ konsol.rule("[bold cyan]Tüm Eklentilerde Arama Yapın[/bold cyan]")
59
+
60
+ query = await self.ui_manager.prompt_text("Arama sorgusu girin:")
61
+ results = await self.search_all_plugins(query)
62
+
63
+ if not results:
64
+ return
65
+
66
+ selected_result = await self.select_from_all_results(results)
67
+
68
+ if selected_result:
69
+ await self.show_details(selected_result)
50
70
 
51
71
  async def select_result(self, results):
52
- selected_url = await self.ui_manager.select_from_list(
72
+ selected_url = await self.ui_manager.select_from_fuzzy(
53
73
  message = "Bir içerik seçin:",
54
74
  choices = [{"name": res.title, "value": res.url} for res in results]
55
75
  )
56
76
 
57
- await self.show_details(selected_url)
77
+ if selected_url:
78
+ return selected_url
58
79
 
59
- async def show_details(self, url):
80
+ async def show_details(self, selected_result):
60
81
  try:
82
+ if isinstance(selected_result, dict) and "plugin" in selected_result:
83
+ plugin_name = selected_result["plugin"]
84
+ url = selected_result["url"]
85
+
86
+ self.current_plugin = self.plugin_manager.select_plugin(plugin_name)
87
+ else:
88
+ url = selected_result
89
+
61
90
  media_info = await self.current_plugin.load_item(url)
62
91
  except Exception as hata:
63
- konsol.log(url)
92
+ konsol.log(selected_result)
64
93
  hata_yakala(hata)
65
94
  return
66
95
 
67
96
  self.media_manager.set_title(f"{self.current_plugin.name} | {media_info.title}")
68
97
 
69
- self.ui_manager.display_media_info(self.current_plugin.name, media_info)
98
+ self.ui_manager.display_media_info(f"{self.current_plugin.name} | {media_info.title}", media_info)
70
99
 
71
100
  if isinstance(media_info, SeriesInfo):
72
- selected_episode = await self.ui_manager.select_from_list(
101
+ selected_episode = await self.ui_manager.select_from_fuzzy(
73
102
  message="Bir bölüm seçin:",
74
103
  choices=[
75
104
  {"name": f"{episode.season}. Sezon {episode.episode}. Bölüm - {episode.title}", "value": episode.url}
@@ -143,6 +172,42 @@ class KekikStream:
143
172
  self.media_manager.set_headers({"Referer": extract_data.referer})
144
173
  self.media_manager.play_media(extract_data)
145
174
 
175
+ async def search_all_plugins(self, query: str):
176
+ all_results = []
177
+
178
+ for plugin_name, plugin in self.plugin_manager.plugins.items():
179
+ if not isinstance(plugin, PluginBase):
180
+ konsol.print(f"[yellow][!] {plugin_name} geçerli bir PluginBase değil, atlanıyor...[/yellow]")
181
+ continue
182
+
183
+ konsol.log(f"[yellow][~] {plugin_name:<18} eklentisinde arama yapılıyor...[/]")
184
+ try:
185
+ results = await plugin.search(query)
186
+ if results:
187
+ all_results.extend(
188
+ [{"plugin": plugin_name, "title": result.title, "url": result.url, "poster": result.poster} for result in results]
189
+ )
190
+ except Exception as hata:
191
+ konsol.print(f"[bold red]{plugin_name} eklentisinde hata oluştu: {hata}[/bold red]")
192
+
193
+ if not all_results:
194
+ konsol.print("[bold red]Hiçbir sonuç bulunamadı![/bold red]")
195
+ return []
196
+
197
+ return all_results
198
+
199
+ async def select_from_all_results(self, results):
200
+ choices = [
201
+ {"name": f"[{res['plugin']}] {res['title']}", "value": res}
202
+ for res in results
203
+ ]
204
+
205
+ selected_result = await self.ui_manager.select_from_fuzzy(
206
+ message = "Bir içerik seçin:",
207
+ choices = choices
208
+ )
209
+
210
+ return selected_result
146
211
 
147
212
  from .CLI import check_and_update_package
148
213
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: KekikStream
3
- Version: 0.1.2
3
+ Version: 0.1.4
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,4 +1,4 @@
1
- KekikStream/__init__.py,sha256=kZae3M7ad7nX1r-hek5dfek3DImgrTZSbIb1rtCe-rI,6230
1
+ KekikStream/__init__.py,sha256=2WkuSFmzMV_NULu_-9CHsba4kD4xNMfDS622WMzPSOA,8819
2
2
  KekikStream/__main__.py,sha256=4U-NO1f0Mts5Mf_QnWhWqRbTsRBy2y2VPlpHyaqG9_I,137
3
3
  KekikStream/requirements.txt,sha256=Kh3E0NzIkAmhVODtIwRVffVOHLiElO6Ua9kIgjbocPE,57
4
4
  KekikStream/CLI/__init__.py,sha256=9YlF135BVff85y492hX4sq2WY2CNqa4BuVzF9hIIaKE,233
@@ -8,7 +8,7 @@ KekikStream/Core/ExtractorLoader.py,sha256=JovJJr6Clk3xpbRLlh7v_XOl3FGwVXCjTZive
8
8
  KekikStream/Core/ExtractorModels.py,sha256=vJeh4qd05K7nbqdCCGU29UkGQpce6jXfsCm7LuDL1G8,454
9
9
  KekikStream/Core/MediaHandler.py,sha256=Q_9LMc4Wnmv8PhMfoo2IgxpHLeikUgrqp_B_Rfs217U,3005
10
10
  KekikStream/Core/PluginBase.py,sha256=CHq2ANsedSY1BQhGZgP4CumERRnOjiyopW3FMrE4J70,1474
11
- KekikStream/Core/PluginLoader.py,sha256=POayKsWOjAuReMbp6_aWbG5lIioQzpQT3u1LQXMqUwY,2574
11
+ KekikStream/Core/PluginLoader.py,sha256=og5EPfnVqrb2kUkeGU65AY0fU43IbiUo_h3ix6ZiINY,2596
12
12
  KekikStream/Core/PluginModels.py,sha256=-V4Be9ebnUQsQtGzLxg0kGK13RJTmpB7bvAUwsE-ir0,2208
13
13
  KekikStream/Core/__init__.py,sha256=HZpXs3MKy4joO0sDpIGcZ2DrUKwK49IKG-GQgKbO2jk,416
14
14
  KekikStream/Extractors/CloseLoad.py,sha256=YmDB3YvuDaCUbQ0T_tmhnkEsC5mSdEN6GNoAR662fl8,990
@@ -16,16 +16,16 @@ KekikStream/Extractors/MailRu.py,sha256=lB3Xy912EaSEUw7Im65L5TwtIeM7OLFV1_9lan39
16
16
  KekikStream/Extractors/VidMoxy.py,sha256=UnVrCEI4XNiONE2aLV9dGUhRqQ9ELJTnYVXyG81N11A,1800
17
17
  KekikStream/Managers/ExtractorManager.py,sha256=4p5VaERx3qIIzvti9gl_khkCWYcVnzUNORmMP-OrQu0,925
18
18
  KekikStream/Managers/MediaManager.py,sha256=F7mkSvAttAaMHRvnDcxnV2K1D_sK644BCSrEaAmMl_U,522
19
- KekikStream/Managers/PluginManager.py,sha256=5O19YNCt4P7a6yVzlDvmxfZLA9SX9LxDs5bqqZ4i1rA,566
20
- KekikStream/Managers/UIManager.py,sha256=7C_y3DZhMYxmfE88be5v4DlEk_H8CmBzn4dRHwr5klY,1162
19
+ KekikStream/Managers/PluginManager.py,sha256=YDBLHB_Fh79A3Pei0ny2KLVY4VSihdNiKBh_w5tBl-0,637
20
+ KekikStream/Managers/UIManager.py,sha256=8paUE-ocnakckuTXwVrbWvEbioDaVVNnb0zIQCyBMsg,1532
21
21
  KekikStream/Managers/__init__.py,sha256=3085I_9Sa2L_Vq6Z-QvYUYn1BapkN4sQqBo8ITZoD_4,251
22
22
  KekikStream/Plugins/FilmMakinesi.py,sha256=g4LRDP5Atn97PqbgnEdm0-wjVdXaJIVk1Ru0F8B66Ws,2902
23
23
  KekikStream/Plugins/FullHDFilmizlesene.py,sha256=HJzHDXHhhMpvXxiD2SjpoZEYs7dmnPymE8EXCSvLKVo,3106
24
24
  KekikStream/Plugins/SineWix.py,sha256=RJxggTrZxBimQHI4ehtJipVeIBpfHy85NW-ixE2iF2k,4762
25
25
  KekikStream/Plugins/UgurFilm.py,sha256=U7ryNWpjSZJWuYlMGX1Be9uuyiM3SfuI9VJcEiXedNs,2960
26
- KekikStream-0.1.2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
27
- KekikStream-0.1.2.dist-info/METADATA,sha256=k4y1FyCbvIH72DZKaZ4KaprpT9Jh1YokpM-SWE4uUGE,3961
28
- KekikStream-0.1.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
29
- KekikStream-0.1.2.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
30
- KekikStream-0.1.2.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
31
- KekikStream-0.1.2.dist-info/RECORD,,
26
+ KekikStream-0.1.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
27
+ KekikStream-0.1.4.dist-info/METADATA,sha256=bNR32dNy170g0oPnuyWM3i-fhJ_NsYkW9a4Zu7bYc3k,3961
28
+ KekikStream-0.1.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
29
+ KekikStream-0.1.4.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
30
+ KekikStream-0.1.4.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
31
+ KekikStream-0.1.4.dist-info/RECORD,,