KekikStream 0.0.7__py3-none-any.whl → 0.0.9__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/Core/MediaHandler.py +7 -1
- KekikStream/Core/PluginBase.py +3 -0
- KekikStream/Core/PluginModels.py +5 -1
- KekikStream/Core/__init__.py +1 -1
- KekikStream/Extractors/VidMoxy.py +19 -2
- KekikStream/Plugins/SineWix.py +68 -0
- KekikStream/__init__.py +21 -2
- {KekikStream-0.0.7.dist-info → KekikStream-0.0.9.dist-info}/METADATA +5 -1
- {KekikStream-0.0.7.dist-info → KekikStream-0.0.9.dist-info}/RECORD +13 -12
- {KekikStream-0.0.7.dist-info → KekikStream-0.0.9.dist-info}/LICENSE +0 -0
- {KekikStream-0.0.7.dist-info → KekikStream-0.0.9.dist-info}/WHEEL +0 -0
- {KekikStream-0.0.7.dist-info → KekikStream-0.0.9.dist-info}/entry_points.txt +0 -0
- {KekikStream-0.0.7.dist-info → KekikStream-0.0.9.dist-info}/top_level.txt +0 -0
KekikStream/Core/MediaHandler.py
CHANGED
@@ -11,7 +11,7 @@ class MediaHandler:
|
|
11
11
|
|
12
12
|
def play_with_vlc(self, extract_data: ExtractResult):
|
13
13
|
try:
|
14
|
-
if "Cookie" in self.headers:
|
14
|
+
if "Cookie" in self.headers or extract_data.subtitles:
|
15
15
|
self.play_with_mpv(extract_data)
|
16
16
|
return
|
17
17
|
|
@@ -27,6 +27,9 @@ class MediaHandler:
|
|
27
27
|
if "Referer" in self.headers:
|
28
28
|
vlc_command.append(f"--http-referrer={self.headers.get('Referer')}")
|
29
29
|
|
30
|
+
for subtitle in extract_data.subtitles:
|
31
|
+
vlc_command.append(f"--sub-file={subtitle.url}")
|
32
|
+
|
30
33
|
vlc_command.append(extract_data.url)
|
31
34
|
subprocess.run(vlc_command, check=True)
|
32
35
|
except subprocess.CalledProcessError as e:
|
@@ -52,6 +55,9 @@ class MediaHandler:
|
|
52
55
|
if "Cookie" in self.headers:
|
53
56
|
mpv_command.append(f"--http-header-fields=Cookie: {self.headers.get('Cookie')}")
|
54
57
|
|
58
|
+
for subtitle in extract_data.subtitles:
|
59
|
+
mpv_command.append(f"--sub-file={subtitle.url}")
|
60
|
+
|
55
61
|
mpv_command.append(extract_data.url)
|
56
62
|
subprocess.run(mpv_command, check=True)
|
57
63
|
except subprocess.CalledProcessError as e:
|
KekikStream/Core/PluginBase.py
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
from abc import ABC, abstractmethod
|
4
4
|
from httpx import AsyncClient, Timeout
|
5
5
|
from .PluginModels import SearchResult, MovieInfo
|
6
|
+
from .MediaHandler import MediaHandler
|
6
7
|
|
7
8
|
class PluginBase(ABC):
|
8
9
|
name = "Plugin"
|
9
10
|
main_url = "https://example.com"
|
11
|
+
_data = {}
|
10
12
|
|
11
13
|
def __init__(self):
|
12
14
|
self.oturum = AsyncClient(
|
@@ -16,6 +18,7 @@ class PluginBase(ABC):
|
|
16
18
|
},
|
17
19
|
timeout = Timeout(10.0),
|
18
20
|
)
|
21
|
+
self.media_handler = MediaHandler()
|
19
22
|
|
20
23
|
@abstractmethod
|
21
24
|
async def search(self, query: str) -> list[SearchResult]:
|
KekikStream/Core/PluginModels.py
CHANGED
@@ -29,4 +29,8 @@ class MovieInfo(BaseModel):
|
|
29
29
|
|
30
30
|
@validator("actors", pre=True)
|
31
31
|
def convert_actors(cls, value):
|
32
|
-
return ", ".join(value) if isinstance(value, list) else value
|
32
|
+
return ", ".join(value) if isinstance(value, list) else value
|
33
|
+
|
34
|
+
@validator("rating", pre=True)
|
35
|
+
def ensure_string(cls, value):
|
36
|
+
return str(value) if value is not None else value
|
KekikStream/Core/__init__.py
CHANGED
@@ -5,5 +5,5 @@ from .PluginLoader import PluginLoader
|
|
5
5
|
from .PluginModels import SearchResult, MovieInfo
|
6
6
|
from .ExtractorBase import ExtractorBase
|
7
7
|
from .ExtractorLoader import ExtractorLoader
|
8
|
-
from .ExtractorModels import ExtractResult
|
8
|
+
from .ExtractorModels import ExtractResult, Subtitle
|
9
9
|
from .MediaHandler import MediaHandler
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
|
2
2
|
|
3
|
-
from KekikStream.Core import ExtractorBase, ExtractResult
|
3
|
+
from KekikStream.Core import ExtractorBase, ExtractResult, Subtitle
|
4
4
|
from Kekik.Sifreleme import Packer, HexCodec
|
5
5
|
import re
|
6
6
|
|
@@ -15,6 +15,23 @@ class VidMoxy(ExtractorBase):
|
|
15
15
|
istek = await self.oturum.get(url)
|
16
16
|
istek.raise_for_status()
|
17
17
|
|
18
|
+
subtitles = []
|
19
|
+
subtitle_matches = re.findall(r'captions","file":"([^"]+)","label":"([^"]+)"', istek.text)
|
20
|
+
seen_subtitles = set()
|
21
|
+
|
22
|
+
for sub_url, sub_lang in subtitle_matches:
|
23
|
+
if sub_url in seen_subtitles:
|
24
|
+
continue
|
25
|
+
seen_subtitles.add(sub_url)
|
26
|
+
|
27
|
+
decoded_lang = (
|
28
|
+
sub_lang.replace("\\u0131", "ı")
|
29
|
+
.replace("\\u0130", "İ")
|
30
|
+
.replace("\\u00fc", "ü")
|
31
|
+
.replace("\\u00e7", "ç")
|
32
|
+
)
|
33
|
+
subtitles.append(Subtitle(name=decoded_lang, url=sub_url.replace("\\", "")))
|
34
|
+
|
18
35
|
try:
|
19
36
|
escaped_hex = re.findall(r'file": "(.*)",', istek.text)[0]
|
20
37
|
except Exception:
|
@@ -29,5 +46,5 @@ class VidMoxy(ExtractorBase):
|
|
29
46
|
name = self.name,
|
30
47
|
url = m3u_link,
|
31
48
|
referer = self.main_url,
|
32
|
-
subtitles =
|
49
|
+
subtitles = subtitles
|
33
50
|
)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
|
2
|
+
|
3
|
+
from KekikStream.Core import PluginBase, SearchResult, MovieInfo
|
4
|
+
from KekikStream.Core.ExtractorModels import ExtractResult, Subtitle
|
5
|
+
|
6
|
+
class SineWix(PluginBase):
|
7
|
+
name = "SineWix"
|
8
|
+
main_url = "https://ythls.kekikakademi.org"
|
9
|
+
|
10
|
+
async def search(self, query: str) -> list[SearchResult]:
|
11
|
+
istek = await self.oturum.get(f"{self.main_url}/sinewix/search/{query}")
|
12
|
+
|
13
|
+
return [
|
14
|
+
SearchResult(
|
15
|
+
title = veri.get("name"),
|
16
|
+
url = f"?type={veri.get('type')}&id={veri.get('id')}",
|
17
|
+
poster = self.fix_url(veri.get("poster_path")),
|
18
|
+
)
|
19
|
+
for veri in istek.json().get("search") if veri.get("type") == "movie"
|
20
|
+
]
|
21
|
+
|
22
|
+
async def load_item(self, url: str) -> MovieInfo:
|
23
|
+
item_type = url.split("?type=")[-1].split("&id=")[0]
|
24
|
+
item_id = url.split("&id=")[-1]
|
25
|
+
|
26
|
+
match item_type:
|
27
|
+
case "movie":
|
28
|
+
istek = await self.oturum.get(f"{self.main_url}/sinewix/movie/{item_id}")
|
29
|
+
veri = istek.json()
|
30
|
+
|
31
|
+
org_title = veri.get("title")
|
32
|
+
alt_title = veri.get("original_name") or ""
|
33
|
+
title = f"{org_title} - {alt_title}" if (alt_title and org_title != alt_title) else org_title
|
34
|
+
|
35
|
+
return MovieInfo(
|
36
|
+
url = self.fix_url(f"{self.main_url}/sinewix/movie/{item_id}"),
|
37
|
+
poster = self.fix_url(veri.get("poster_path")),
|
38
|
+
title = title,
|
39
|
+
description = veri.get("overview"),
|
40
|
+
tags = [genre.get("name") for genre in veri.get("genres")],
|
41
|
+
rating = veri.get("vote_average"),
|
42
|
+
year = veri.get("release_date"),
|
43
|
+
actors = [actor.get("name") for actor in veri.get("casterslist")],
|
44
|
+
)
|
45
|
+
|
46
|
+
async def load_links(self, url: str) -> list[str]:
|
47
|
+
istek = await self.oturum.get(url)
|
48
|
+
veri = istek.json()
|
49
|
+
|
50
|
+
org_title = veri.get("title")
|
51
|
+
alt_title = veri.get("original_name") or ""
|
52
|
+
title = f"{org_title} - {alt_title}" if (alt_title and org_title != alt_title) else org_title
|
53
|
+
title = f"{self.name} | {title}"
|
54
|
+
|
55
|
+
for video in veri.get("videos"):
|
56
|
+
video_link = video.get("link").split("_blank\">")[-1]
|
57
|
+
self._data[video_link] = {
|
58
|
+
"name" : title,
|
59
|
+
"referer" : self.main_url,
|
60
|
+
"subtitles" : []
|
61
|
+
}
|
62
|
+
|
63
|
+
return list(self._data.keys())
|
64
|
+
|
65
|
+
async def play(self, name: str, url: str, referer: str, subtitles: list[Subtitle]):
|
66
|
+
extract_result = ExtractResult(name=name, url=url, referer=referer, subtitles=subtitles)
|
67
|
+
self.media_handler.title = name
|
68
|
+
self.media_handler.play_with_vlc(extract_result)
|
KekikStream/__init__.py
CHANGED
@@ -68,16 +68,26 @@ class KekikStream:
|
|
68
68
|
|
69
69
|
self.ui_manager.display_media_info(self.current_plugin.name, media_info)
|
70
70
|
|
71
|
-
links = await self.current_plugin.load_links(url)
|
71
|
+
links = await self.current_plugin.load_links(media_info.url)
|
72
72
|
await self.show_options(links)
|
73
73
|
|
74
74
|
async def show_options(self, links):
|
75
75
|
mapping = self.extractor_manager.map_links_to_extractors(links)
|
76
|
-
|
76
|
+
has_play_method = hasattr(self.current_plugin, "play") and callable(getattr(self.current_plugin, "play", None))
|
77
|
+
if not mapping and not has_play_method:
|
77
78
|
konsol.print("[bold red]Hiçbir Extractor bulunamadı![/bold red]")
|
78
79
|
konsol.print(links)
|
79
80
|
return
|
80
81
|
|
82
|
+
if not mapping:
|
83
|
+
selected_link = await self.ui_manager.select_from_list(
|
84
|
+
message = "Doğrudan bir bağlantı seçin:",
|
85
|
+
choices = [{"name": self.current_plugin.name, "value": link} for link in links]
|
86
|
+
)
|
87
|
+
if selected_link:
|
88
|
+
await self.play_media(selected_link)
|
89
|
+
return
|
90
|
+
|
81
91
|
action = await self.ui_manager.select_from_list(
|
82
92
|
message = "Ne yapmak istersiniz?",
|
83
93
|
choices = ["İzle", "Geri Git", "Ana Menü"]
|
@@ -99,6 +109,15 @@ class KekikStream:
|
|
99
109
|
await self.run()
|
100
110
|
|
101
111
|
async def play_media(self, selected_link):
|
112
|
+
if hasattr(self.current_plugin, "play") and callable(self.current_plugin.play):
|
113
|
+
await self.current_plugin.play(
|
114
|
+
name = self.current_plugin._data[selected_link]["name"],
|
115
|
+
url = selected_link,
|
116
|
+
referer = self.current_plugin._data[selected_link]["referer"],
|
117
|
+
subtitles = self.current_plugin._data[selected_link]["subtitles"]
|
118
|
+
)
|
119
|
+
return
|
120
|
+
|
102
121
|
extractor:ExtractorBase = self.extractor_manager.find_extractor(selected_link)
|
103
122
|
if not extractor:
|
104
123
|
konsol.print("[bold red]Uygun Extractor bulunamadı.[/bold red]")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: KekikStream
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9
|
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
|
@@ -66,6 +66,10 @@ KekikStream
|
|
66
66
|
|
67
67
|
**[☕️ Kahve Ismarla](https://KekikAkademi.org/Kahve)**
|
68
68
|
|
69
|
+
### 🎁 Teşekkürler
|
70
|
+
|
71
|
+
- [DeoDorqnt387/aniwatch-tr](https://github.com/DeoDorqnt387/aniwatch-tr)
|
72
|
+
|
69
73
|
## 🌐 Telif Hakkı ve Lisans
|
70
74
|
|
71
75
|
* *Copyright (C) 2024 by* [keyiflerolsun](https://github.com/keyiflerolsun) ❤️️
|
@@ -1,18 +1,18 @@
|
|
1
|
-
KekikStream/__init__.py,sha256=
|
1
|
+
KekikStream/__init__.py,sha256=8Lj6a8T8TSyHuiqQ9wM7GnLxBcLUiiVcgUMPrcXS7wc,5464
|
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=so-9S3fmNAyHtZYYUTEI1YaUHPiQhVA6U-Q0grACaRg,178
|
5
5
|
KekikStream/Core/ExtractorBase.py,sha256=SPXKZPfpzvgkJeMds-USzgpm8-qb0vgZjjLDs58NfGU,1069
|
6
6
|
KekikStream/Core/ExtractorLoader.py,sha256=JovJJr6Clk3xpbRLlh7v_XOl3FGwVXCjTZivec1FktI,2533
|
7
7
|
KekikStream/Core/ExtractorModels.py,sha256=vJeh4qd05K7nbqdCCGU29UkGQpce6jXfsCm7LuDL1G8,454
|
8
|
-
KekikStream/Core/MediaHandler.py,sha256=
|
9
|
-
KekikStream/Core/PluginBase.py,sha256=
|
8
|
+
KekikStream/Core/MediaHandler.py,sha256=Q_9LMc4Wnmv8PhMfoo2IgxpHLeikUgrqp_B_Rfs217U,3005
|
9
|
+
KekikStream/Core/PluginBase.py,sha256=CHq2ANsedSY1BQhGZgP4CumERRnOjiyopW3FMrE4J70,1474
|
10
10
|
KekikStream/Core/PluginLoader.py,sha256=POayKsWOjAuReMbp6_aWbG5lIioQzpQT3u1LQXMqUwY,2574
|
11
|
-
KekikStream/Core/PluginModels.py,sha256=
|
12
|
-
KekikStream/Core/__init__.py,sha256=
|
11
|
+
KekikStream/Core/PluginModels.py,sha256=cV24ksmdrjE2usdfZv4c68TDC5FN9j9yaLH9lcg4FCY,1127
|
12
|
+
KekikStream/Core/__init__.py,sha256=MtpPBsL4FTKWZMDtG9l7-59zry7buJZI6bTQHvcTFog,395
|
13
13
|
KekikStream/Extractors/CloseLoad.py,sha256=YmDB3YvuDaCUbQ0T_tmhnkEsC5mSdEN6GNoAR662fl8,990
|
14
14
|
KekikStream/Extractors/MailRu.py,sha256=lB3Xy912EaSEUw7Im65L5TwtIeM7OLFV1_9lan39g40,1308
|
15
|
-
KekikStream/Extractors/VidMoxy.py,sha256=
|
15
|
+
KekikStream/Extractors/VidMoxy.py,sha256=UnVrCEI4XNiONE2aLV9dGUhRqQ9ELJTnYVXyG81N11A,1800
|
16
16
|
KekikStream/Managers/ExtractorManager.py,sha256=4p5VaERx3qIIzvti9gl_khkCWYcVnzUNORmMP-OrQu0,925
|
17
17
|
KekikStream/Managers/MediaManager.py,sha256=F7mkSvAttAaMHRvnDcxnV2K1D_sK644BCSrEaAmMl_U,522
|
18
18
|
KekikStream/Managers/PluginManager.py,sha256=5O19YNCt4P7a6yVzlDvmxfZLA9SX9LxDs5bqqZ4i1rA,566
|
@@ -20,10 +20,11 @@ KekikStream/Managers/UIManager.py,sha256=81ZSGFdf1nKw1NjL-nqwgQTYAgzJqybBWXqWCNQ
|
|
20
20
|
KekikStream/Managers/__init__.py,sha256=3085I_9Sa2L_Vq6Z-QvYUYn1BapkN4sQqBo8ITZoD_4,251
|
21
21
|
KekikStream/Plugins/FilmMakinesi.py,sha256=g4LRDP5Atn97PqbgnEdm0-wjVdXaJIVk1Ru0F8B66Ws,2902
|
22
22
|
KekikStream/Plugins/FullHDFilmizlesene.py,sha256=HJzHDXHhhMpvXxiD2SjpoZEYs7dmnPymE8EXCSvLKVo,3106
|
23
|
+
KekikStream/Plugins/SineWix.py,sha256=g3uTe4IHepnAuwZjSeAf-9ModSGcpS7zKTjyY5011IA,2950
|
23
24
|
KekikStream/Plugins/UgurFilm.py,sha256=U7ryNWpjSZJWuYlMGX1Be9uuyiM3SfuI9VJcEiXedNs,2960
|
24
|
-
KekikStream-0.0.
|
25
|
-
KekikStream-0.0.
|
26
|
-
KekikStream-0.0.
|
27
|
-
KekikStream-0.0.
|
28
|
-
KekikStream-0.0.
|
29
|
-
KekikStream-0.0.
|
25
|
+
KekikStream-0.0.9.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
26
|
+
KekikStream-0.0.9.dist-info/METADATA,sha256=x-frvG98cB0QhjTjzuynN0vm61yQvjD3qbX7loqElp4,3960
|
27
|
+
KekikStream-0.0.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
28
|
+
KekikStream-0.0.9.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
|
29
|
+
KekikStream-0.0.9.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
|
30
|
+
KekikStream-0.0.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|