KekikStream 0.3.4__py3-none-any.whl → 0.3.6__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.
- KekikStream/__init__.py +149 -161
- {KekikStream-0.3.4.dist-info → KekikStream-0.3.6.dist-info}/METADATA +1 -1
- {KekikStream-0.3.4.dist-info → KekikStream-0.3.6.dist-info}/RECORD +7 -7
- {KekikStream-0.3.4.dist-info → KekikStream-0.3.6.dist-info}/LICENSE +0 -0
- {KekikStream-0.3.4.dist-info → KekikStream-0.3.6.dist-info}/WHEEL +0 -0
- {KekikStream-0.3.4.dist-info → KekikStream-0.3.6.dist-info}/entry_points.txt +0 -0
- {KekikStream-0.3.4.dist-info → KekikStream-0.3.6.dist-info}/top_level.txt +0 -0
KekikStream/__init__.py
CHANGED
@@ -7,250 +7,238 @@ from asyncio import run
|
|
7
7
|
|
8
8
|
class KekikStream:
|
9
9
|
def __init__(self):
|
10
|
-
self.
|
11
|
-
self.
|
12
|
-
self.
|
13
|
-
self.
|
14
|
-
self.
|
15
|
-
|
16
|
-
async def
|
17
|
-
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 baslat(self):
|
17
|
+
self.arayuz_yonetici.clear_console()
|
18
18
|
konsol.rule("[bold cyan]KekikStream Başlatılıyor[/bold cyan]")
|
19
|
-
if not self.
|
20
|
-
konsol.print("[bold red]Hiçbir eklenti bulunamadı![/bold red]")
|
21
|
-
return
|
19
|
+
if not self.eklentiler_yonetici.get_plugin_names():
|
20
|
+
return konsol.print("[bold red]Hiçbir eklenti bulunamadı![/bold red]")
|
22
21
|
|
23
22
|
try:
|
24
|
-
await self.
|
23
|
+
await self.eklenti_secimi()
|
25
24
|
finally:
|
26
|
-
await self.
|
25
|
+
await self.eklentiler_yonetici.close_plugins()
|
27
26
|
|
28
|
-
async def
|
29
|
-
|
27
|
+
async def sonuc_bulunamadi(self):
|
28
|
+
secim = await self.arayuz_yonetici.select_from_list(
|
30
29
|
message = "Ne yapmak istersiniz?",
|
31
30
|
choices = ["Tüm Eklentilerde Ara", "Ana Menü", "Çıkış"]
|
32
31
|
)
|
33
32
|
|
34
|
-
match
|
33
|
+
match secim:
|
35
34
|
case "Tüm Eklentilerde Ara":
|
36
|
-
await self.
|
35
|
+
await self.tum_eklentilerde_arama()
|
37
36
|
case "Ana Menü":
|
38
|
-
await self.
|
37
|
+
await self.baslat()
|
39
38
|
case "Çıkış":
|
40
39
|
cikis_yap(False)
|
41
40
|
|
42
|
-
async def
|
43
|
-
|
41
|
+
async def eklenti_secimi(self):
|
42
|
+
eklenti_adi = await self.arayuz_yonetici.select_from_fuzzy(
|
44
43
|
message = "Arama yapılacak eklentiyi seçin:",
|
45
|
-
choices = ["Tüm Eklentilerde Ara", *self.
|
44
|
+
choices = ["Tüm Eklentilerde Ara", *self.eklentiler_yonetici.get_plugin_names()]
|
46
45
|
)
|
47
46
|
|
48
|
-
if
|
49
|
-
await self.
|
47
|
+
if eklenti_adi == "Tüm Eklentilerde Ara":
|
48
|
+
await self.tum_eklentilerde_arama()
|
50
49
|
else:
|
51
|
-
self.
|
52
|
-
await self.
|
50
|
+
self.suanki_eklenti = self.eklentiler_yonetici.select_plugin(eklenti_adi)
|
51
|
+
await self.eklenti_ile_arama()
|
53
52
|
|
54
|
-
async def
|
55
|
-
self.
|
56
|
-
konsol.rule(f"[bold cyan]{self.
|
53
|
+
async def eklenti_ile_arama(self):
|
54
|
+
self.arayuz_yonetici.clear_console()
|
55
|
+
konsol.rule(f"[bold cyan]{self.suanki_eklenti.name} Eklentisinde Arama Yapın[/bold cyan]")
|
57
56
|
|
58
|
-
|
59
|
-
|
57
|
+
sorgu = await self.arayuz_yonetici.prompt_text("Arama sorgusu girin:")
|
58
|
+
sonuclar = await self.suanki_eklenti.search(sorgu)
|
60
59
|
|
61
|
-
if not
|
60
|
+
if not sonuclar:
|
62
61
|
konsol.print("[bold red]Arama sonucu bulunamadı![/bold red]")
|
63
|
-
return await self.
|
64
|
-
|
65
|
-
selected_result = await self.select_result(results)
|
62
|
+
return await self.sonuc_bulunamadi()
|
66
63
|
|
67
|
-
if
|
68
|
-
await self.
|
64
|
+
if secilen_sonuc := await self.sonuc_secimi(sonuclar):
|
65
|
+
await self.sonuc_detaylari_goster({"plugin": self.suanki_eklenti.name, "url": secilen_sonuc})
|
69
66
|
|
70
|
-
async def
|
71
|
-
self.
|
67
|
+
async def tum_eklentilerde_arama(self):
|
68
|
+
self.arayuz_yonetici.clear_console()
|
72
69
|
konsol.rule("[bold cyan]Tüm Eklentilerde Arama Yapın[/bold cyan]")
|
73
70
|
|
74
|
-
|
75
|
-
|
71
|
+
sorgu = await self.arayuz_yonetici.prompt_text("Arama sorgusu girin:")
|
72
|
+
sonuclar = await self.tum_eklentilerde_arama_sorgula(sorgu)
|
76
73
|
|
77
|
-
if not
|
78
|
-
return await self.
|
74
|
+
if not sonuclar:
|
75
|
+
return await self.sonuc_bulunamadi()
|
79
76
|
|
80
|
-
|
77
|
+
secilen_sonuc = await self.tum_sonuc_secimi(sonuclar)
|
81
78
|
|
82
|
-
if
|
83
|
-
await self.
|
79
|
+
if secilen_sonuc:
|
80
|
+
await self.sonuc_detaylari_goster(secilen_sonuc)
|
84
81
|
|
85
|
-
async def
|
86
|
-
|
82
|
+
async def sonuc_secimi(self, sonuclar):
|
83
|
+
return await self.arayuz_yonetici.select_from_fuzzy(
|
87
84
|
message = "İçerik sonuçlarından birini seçin:",
|
88
|
-
choices = [{"name":
|
85
|
+
choices = [{"name": sonuc.title, "value": sonuc.url} for sonuc in sonuclar]
|
89
86
|
)
|
90
87
|
|
91
|
-
|
92
|
-
|
88
|
+
async def tum_eklentilerde_arama_sorgula(self, sorgu: str):
|
89
|
+
tum_sonuclar = []
|
90
|
+
|
91
|
+
for eklenti_adi, eklenti in self.eklentiler_yonetici.plugins.items():
|
92
|
+
if not isinstance(eklenti, PluginBase):
|
93
|
+
konsol.print(f"[yellow][!] {eklenti_adi} geçerli bir PluginBase değil, atlanıyor...[/yellow]")
|
94
|
+
continue
|
95
|
+
|
96
|
+
konsol.log(f"[yellow][~] {eklenti_adi:<19} aranıyor...[/]")
|
97
|
+
try:
|
98
|
+
sonuclar = await eklenti.search(sorgu)
|
99
|
+
if sonuclar:
|
100
|
+
tum_sonuclar.extend(
|
101
|
+
[{"plugin": eklenti_adi, "title": sonuc.title, "url": sonuc.url, "poster": sonuc.poster} for sonuc in sonuclar]
|
102
|
+
)
|
103
|
+
except Exception as hata:
|
104
|
+
konsol.print(f"[bold red]{eklenti_adi} » hata oluştu: {hata}[/bold red]")
|
105
|
+
|
106
|
+
if not tum_sonuclar:
|
107
|
+
konsol.print("[bold red]Hiçbir sonuç bulunamadı![/bold red]")
|
108
|
+
await self.sonuc_bulunamadi()
|
109
|
+
return []
|
110
|
+
|
111
|
+
return tum_sonuclar
|
112
|
+
|
113
|
+
async def tum_sonuc_secimi(self, sonuclar):
|
114
|
+
secenekler = [
|
115
|
+
{"name": f"{f'[{sonuc["plugin"]}]':<21} » {sonuc['title']}", "value": sonuc}
|
116
|
+
for sonuc in sonuclar
|
117
|
+
]
|
118
|
+
|
119
|
+
return await self.arayuz_yonetici.select_from_fuzzy(
|
120
|
+
message = "Arama sonuçlarından bir içerik seçin:",
|
121
|
+
choices = secenekler
|
122
|
+
)
|
93
123
|
|
94
|
-
async def
|
124
|
+
async def sonuc_detaylari_goster(self, secilen_sonuc):
|
95
125
|
try:
|
96
|
-
if isinstance(
|
97
|
-
|
98
|
-
url =
|
126
|
+
if isinstance(secilen_sonuc, dict) and "plugin" in secilen_sonuc:
|
127
|
+
eklenti_adi = secilen_sonuc["plugin"]
|
128
|
+
url = secilen_sonuc["url"]
|
99
129
|
|
100
|
-
self.
|
130
|
+
self.suanki_eklenti = self.eklentiler_yonetici.select_plugin(eklenti_adi)
|
101
131
|
else:
|
102
|
-
url =
|
132
|
+
url = secilen_sonuc
|
103
133
|
|
104
|
-
|
134
|
+
medya_bilgi = await self.suanki_eklenti.load_item(url)
|
105
135
|
except Exception as hata:
|
106
|
-
konsol.log(
|
107
|
-
hata_yakala(hata)
|
108
|
-
return
|
136
|
+
konsol.log(secilen_sonuc)
|
137
|
+
return hata_yakala(hata)
|
109
138
|
|
110
|
-
self.
|
139
|
+
self.medya_yonetici.set_title(f"{self.suanki_eklenti.name} | {medya_bilgi.title}")
|
140
|
+
self.arayuz_yonetici.display_media_info(f"{self.suanki_eklenti.name} | {medya_bilgi.title}", medya_bilgi)
|
111
141
|
|
112
|
-
|
113
|
-
|
114
|
-
if isinstance(media_info, SeriesInfo):
|
115
|
-
selected_episode = await self.ui_manager.select_from_fuzzy(
|
142
|
+
if isinstance(medya_bilgi, SeriesInfo):
|
143
|
+
secilen_bolum = await self.arayuz_yonetici.select_from_fuzzy(
|
116
144
|
message = "İzlemek istediğiniz bölümü seçin:",
|
117
145
|
choices = [
|
118
|
-
{"name": f"{
|
119
|
-
for
|
146
|
+
{"name": f"{bolum.season}. Sezon {bolum.episode}. Bölüm - {bolum.title}", "value": bolum.url}
|
147
|
+
for bolum in medya_bilgi.episodes
|
120
148
|
]
|
121
149
|
)
|
122
|
-
if
|
123
|
-
|
124
|
-
await self.
|
150
|
+
if secilen_bolum:
|
151
|
+
baglantilar = await self.suanki_eklenti.load_links(secilen_bolum)
|
152
|
+
await self.baglanti_secenekleri_goster(baglantilar)
|
125
153
|
else:
|
126
|
-
|
127
|
-
await self.
|
154
|
+
baglantilar = await self.suanki_eklenti.load_links(medya_bilgi.url)
|
155
|
+
await self.baglanti_secenekleri_goster(baglantilar)
|
128
156
|
|
129
|
-
async def
|
130
|
-
if not
|
157
|
+
async def baglanti_secenekleri_goster(self, baglantilar):
|
158
|
+
if not baglantilar:
|
131
159
|
konsol.print("[bold red]Hiçbir bağlantı bulunamadı![/bold red]")
|
132
|
-
return await self.
|
160
|
+
return await self.sonuc_bulunamadi()
|
133
161
|
|
134
|
-
|
135
|
-
|
162
|
+
haritalama = self.cikaricilar_yonetici.map_links_to_extractors(baglantilar)
|
163
|
+
play_fonksiyonu_var = hasattr(self.suanki_eklenti, "play") and callable(getattr(self.suanki_eklenti, "play", None))
|
136
164
|
# ! DEBUG
|
137
|
-
# konsol.print(
|
138
|
-
if not
|
165
|
+
# konsol.print(baglantilar)
|
166
|
+
if not haritalama and not play_fonksiyonu_var:
|
139
167
|
konsol.print("[bold red]Hiçbir Extractor bulunamadı![/bold red]")
|
140
|
-
konsol.print(
|
141
|
-
return await self.
|
168
|
+
konsol.print(baglantilar)
|
169
|
+
return await self.sonuc_bulunamadi()
|
142
170
|
|
143
|
-
if not
|
144
|
-
|
171
|
+
if not haritalama:
|
172
|
+
secilen_link = await self.arayuz_yonetici.select_from_list(
|
145
173
|
message = "Doğrudan oynatmak için bir bağlantı seçin:",
|
146
|
-
choices = [{"name": self.
|
174
|
+
choices = [{"name": self.suanki_eklenti.name, "value": link} for link in baglantilar]
|
147
175
|
)
|
148
|
-
if
|
149
|
-
await self.
|
176
|
+
if secilen_link:
|
177
|
+
await self.medya_oynat(secilen_link)
|
150
178
|
return
|
151
179
|
|
152
|
-
|
180
|
+
secim = await self.arayuz_yonetici.select_from_list(
|
153
181
|
message = "Ne yapmak istersiniz?",
|
154
|
-
choices = ["İzle", "
|
182
|
+
choices = ["İzle", "Tüm Eklentilerde Ara", "Ana Menü"]
|
155
183
|
)
|
156
184
|
|
157
|
-
match
|
185
|
+
match secim:
|
158
186
|
case "İzle":
|
159
|
-
|
160
|
-
message = "İzlemek için bir bağlantı seçin:",
|
161
|
-
choices = [{"name":
|
187
|
+
secilen_link = await self.arayuz_yonetici.select_from_list(
|
188
|
+
message = "İzlemek için bir bağlantı seçin:",
|
189
|
+
choices = [{"name": cikarici_adi, "value": link} for link, cikarici_adi in haritalama.items()]
|
162
190
|
)
|
163
|
-
if
|
164
|
-
await self.
|
191
|
+
if secilen_link:
|
192
|
+
await self.medya_oynat(secilen_link)
|
165
193
|
|
166
|
-
case "
|
167
|
-
await self.
|
194
|
+
case "Tüm Eklentilerde Ara":
|
195
|
+
await self.tum_eklentilerde_arama()
|
168
196
|
|
169
197
|
case _:
|
170
|
-
await self.
|
171
|
-
|
172
|
-
async def
|
173
|
-
if hasattr(self.
|
174
|
-
konsol.log(f"[yellow][»] Oynatılıyor : {
|
175
|
-
await self.
|
176
|
-
name = self.
|
177
|
-
url =
|
178
|
-
referer = self.
|
179
|
-
subtitles = self.
|
198
|
+
await self.baslat()
|
199
|
+
|
200
|
+
async def medya_oynat(self, secilen_link):
|
201
|
+
if hasattr(self.suanki_eklenti, "play") and callable(self.suanki_eklenti.play):
|
202
|
+
konsol.log(f"[yellow][»] Oynatılıyor : {secilen_link}")
|
203
|
+
return await self.suanki_eklenti.play(
|
204
|
+
name = self.suanki_eklenti._data[secilen_link]["name"],
|
205
|
+
url = secilen_link,
|
206
|
+
referer = self.suanki_eklenti._data[secilen_link]["referer"],
|
207
|
+
subtitles = self.suanki_eklenti._data[secilen_link]["subtitles"]
|
180
208
|
)
|
181
|
-
return
|
182
209
|
|
183
|
-
|
184
|
-
if not
|
185
|
-
konsol.print("[bold red]Uygun Extractor bulunamadı.[/bold red]")
|
186
|
-
return
|
210
|
+
cikarici: ExtractorBase = self.cikaricilar_yonetici.find_extractor(secilen_link)
|
211
|
+
if not cikarici:
|
212
|
+
return konsol.print("[bold red]Uygun Extractor bulunamadı.[/bold red]")
|
187
213
|
|
188
214
|
try:
|
189
|
-
extract_data = await
|
215
|
+
extract_data = await cikarici.extract(secilen_link, referer=self.suanki_eklenti.main_url)
|
190
216
|
except Exception as hata:
|
191
|
-
konsol.print(f"[bold red]{
|
192
|
-
await self.
|
193
|
-
return
|
217
|
+
konsol.print(f"[bold red]{cikarici.name} » hata oluştu: {hata}[/bold red]")
|
218
|
+
return await self.sonuc_bulunamadi()
|
194
219
|
|
195
220
|
if isinstance(extract_data, list):
|
196
|
-
|
221
|
+
secilen_data = await self.arayuz_yonetici.select_from_list(
|
197
222
|
message = "Birden fazla bağlantı bulundu, lütfen birini seçin:",
|
198
223
|
choices = [{"name": data.name, "value": data} for data in extract_data]
|
199
224
|
)
|
200
225
|
else:
|
201
|
-
|
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 []
|
226
|
+
secilen_data = extract_data
|
233
227
|
|
234
|
-
|
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
|
-
)
|
228
|
+
if secilen_data.headers.get("Cookie"):
|
229
|
+
self.medya_yonetici.set_headers({"Cookie": secilen_data.headers.get("Cookie")})
|
246
230
|
|
231
|
+
self.medya_yonetici.set_title(f"{self.medya_yonetici.get_title()} | {secilen_data.name}")
|
232
|
+
self.medya_yonetici.set_headers({"Referer": secilen_data.referer})
|
233
|
+
konsol.log(f"[yellow][»] Oynatılıyor : {secilen_data.url}")
|
234
|
+
self.medya_yonetici.play_media(secilen_data)
|
247
235
|
|
248
236
|
def basla():
|
249
237
|
try:
|
250
238
|
pypi_kontrol_guncelle("KekikStream")
|
251
239
|
|
252
240
|
app = KekikStream()
|
253
|
-
run(app.
|
241
|
+
run(app.baslat())
|
254
242
|
cikis_yap(False)
|
255
243
|
except KeyboardInterrupt:
|
256
244
|
cikis_yap(True)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: KekikStream
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.6
|
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=
|
1
|
+
KekikStream/__init__.py,sha256=2eeeKoB1PVLyD23grIko7YDx2jbRJPk6YzSK4-LIE8k,10458
|
2
2
|
KekikStream/__main__.py,sha256=4U-NO1f0Mts5Mf_QnWhWqRbTsRBy2y2VPlpHyaqG9_I,137
|
3
3
|
KekikStream/requirements.txt,sha256=gS_TUUQx5A7FUmRGxj2dQedxheD7qA6AswdUb2y_Ub8,70
|
4
4
|
KekikStream/CLI/__init__.py,sha256=U6oLq_O7u5y2eHhBnmfhZNns_EqHHJXJmzl8jvZFUNY,230
|
@@ -48,9 +48,9 @@ KekikStream/Plugins/JetFilmizle.py,sha256=DPdvTEns8r2MI9pHY8d9EEsUZmlQU7N2C9yr8o
|
|
48
48
|
KekikStream/Plugins/SezonlukDizi.py,sha256=5BZVzQ2eQtymHxO0bzjA2ho4FFNahPFQly4hoHuH8lo,4441
|
49
49
|
KekikStream/Plugins/SineWix.py,sha256=ZtcIwPW0ONGkSjT7Ye8b71RWdHZMUZefX-JTWu6uGSs,4854
|
50
50
|
KekikStream/Plugins/UgurFilm.py,sha256=yYXee5uxwNnPqFJZ6s6cRkmUyqS3Vv8x-iesPalc4j4,2930
|
51
|
-
KekikStream-0.3.
|
52
|
-
KekikStream-0.3.
|
53
|
-
KekikStream-0.3.
|
54
|
-
KekikStream-0.3.
|
55
|
-
KekikStream-0.3.
|
56
|
-
KekikStream-0.3.
|
51
|
+
KekikStream-0.3.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
52
|
+
KekikStream-0.3.6.dist-info/METADATA,sha256=bEpxnxF4AbzzSAwo8BWWo1xQ2AV9Ubk1QDefzNImYbg,3987
|
53
|
+
KekikStream-0.3.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
54
|
+
KekikStream-0.3.6.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
|
55
|
+
KekikStream-0.3.6.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
|
56
|
+
KekikStream-0.3.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|