KekikStream 0.0.8__tar.gz → 0.1.0__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 (37) hide show
  1. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/MediaHandler.py +7 -1
  2. kekikstream-0.1.0/KekikStream/Core/PluginModels.py +68 -0
  3. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/__init__.py +2 -2
  4. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Extractors/VidMoxy.py +19 -2
  5. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Managers/UIManager.py +3 -0
  6. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Plugins/SineWix.py +43 -6
  7. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/__init__.py +17 -4
  8. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream.egg-info/PKG-INFO +1 -1
  9. {kekikstream-0.0.8 → kekikstream-0.1.0}/PKG-INFO +1 -1
  10. {kekikstream-0.0.8 → kekikstream-0.1.0}/setup.py +1 -1
  11. kekikstream-0.0.8/KekikStream/Core/PluginModels.py +0 -36
  12. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/CLI/__init__.py +0 -0
  13. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/ExtractorBase.py +0 -0
  14. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/ExtractorLoader.py +0 -0
  15. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/ExtractorModels.py +0 -0
  16. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/PluginBase.py +0 -0
  17. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Core/PluginLoader.py +0 -0
  18. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Extractors/CloseLoad.py +0 -0
  19. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Extractors/MailRu.py +0 -0
  20. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Managers/ExtractorManager.py +0 -0
  21. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Managers/MediaManager.py +0 -0
  22. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Managers/PluginManager.py +0 -0
  23. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Managers/__init__.py +0 -0
  24. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Plugins/FilmMakinesi.py +0 -0
  25. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Plugins/FullHDFilmizlesene.py +0 -0
  26. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/Plugins/UgurFilm.py +0 -0
  27. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/__main__.py +0 -0
  28. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream/requirements.txt +0 -0
  29. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream.egg-info/SOURCES.txt +0 -0
  30. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream.egg-info/dependency_links.txt +0 -0
  31. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream.egg-info/entry_points.txt +0 -0
  32. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream.egg-info/requires.txt +0 -0
  33. {kekikstream-0.0.8 → kekikstream-0.1.0}/KekikStream.egg-info/top_level.txt +0 -0
  34. {kekikstream-0.0.8 → kekikstream-0.1.0}/LICENSE +0 -0
  35. {kekikstream-0.0.8 → kekikstream-0.1.0}/MANIFEST.in +0 -0
  36. {kekikstream-0.0.8 → kekikstream-0.1.0}/README.md +0 -0
  37. {kekikstream-0.0.8 → kekikstream-0.1.0}/setup.cfg +0 -0
@@ -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:
@@ -0,0 +1,68 @@
1
+ # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
+
3
+ from pydantic import BaseModel, field_validator
4
+ from typing import List, Optional
5
+
6
+
7
+ class SearchResult(BaseModel):
8
+ """Arama sonucunda dönecek veri modeli."""
9
+ title : str
10
+ url : str
11
+ poster : Optional[str] = None
12
+
13
+
14
+ class MovieInfo(BaseModel):
15
+ """Bir medya öğesinin bilgilerini tutan model."""
16
+ url : str
17
+ poster : Optional[str] = None
18
+ title : Optional[str] = None
19
+ description : Optional[str] = None
20
+ tags : Optional[str] = None
21
+ rating : Optional[str] = None
22
+ year : Optional[str] = None
23
+ actors : Optional[str] = None
24
+ duration : Optional[int] = None
25
+
26
+ @field_validator("tags", mode="before")
27
+ @classmethod
28
+ def convert_tags(cls, value):
29
+ return ", ".join(value) if isinstance(value, list) else value
30
+
31
+ @field_validator("actors", mode="before")
32
+ @classmethod
33
+ def convert_actors(cls, value):
34
+ return ", ".join(value) if isinstance(value, list) else value
35
+
36
+ @field_validator("rating", mode="before")
37
+ @classmethod
38
+ def ensure_string(cls, value):
39
+ return str(value) if value is not None else value
40
+
41
+
42
+ class Episode(BaseModel):
43
+ season : Optional[int] = None
44
+ episode : Optional[int] = None
45
+ title : Optional[str] = None
46
+ url : Optional[str] = None
47
+
48
+
49
+ class SeriesInfo(BaseModel):
50
+ url : Optional[str] = None
51
+ poster : Optional[str] = None
52
+ title : Optional[str] = None
53
+ description : Optional[str] = None
54
+ tags : Optional[str] = None
55
+ rating : Optional[float] = None
56
+ year : Optional[str] = None
57
+ actors : Optional[str] = None
58
+ episodes : Optional[List[Episode]] = None
59
+
60
+ @field_validator("tags", mode="before")
61
+ @classmethod
62
+ def convert_tags(cls, value):
63
+ return ", ".join(value) if isinstance(value, list) else value
64
+
65
+ @field_validator("actors", mode="before")
66
+ @classmethod
67
+ def convert_actors(cls, value):
68
+ return ", ".join(value) if isinstance(value, list) else value
@@ -2,8 +2,8 @@
2
2
 
3
3
  from .PluginBase import PluginBase
4
4
  from .PluginLoader import PluginLoader
5
- from .PluginModels import SearchResult, MovieInfo
5
+ from .PluginModels import SearchResult, MovieInfo, Episode, SeriesInfo
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
  )
@@ -26,6 +26,9 @@ class UIManager:
26
26
  table.add_column(style="magenta")
27
27
 
28
28
  for key, value in media_info.dict().items():
29
+ if key == "episodes":
30
+ continue
31
+
29
32
  if value:
30
33
  table.add_row(f"[bold cyan]{key.capitalize()}[/bold cyan]", str(value))
31
34
 
@@ -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 PluginBase, SearchResult, MovieInfo
3
+ from KekikStream.Core import PluginBase, SearchResult, MovieInfo, Episode, SeriesInfo
4
4
  from KekikStream.Core.ExtractorModels import ExtractResult, Subtitle
5
5
 
6
6
  class SineWix(PluginBase):
@@ -16,24 +16,24 @@ class SineWix(PluginBase):
16
16
  url = f"?type={veri.get('type')}&id={veri.get('id')}",
17
17
  poster = self.fix_url(veri.get("poster_path")),
18
18
  )
19
- for veri in istek.json().get("search") if veri.get("type") == "movie"
19
+ for veri in istek.json().get("search")
20
20
  ]
21
21
 
22
22
  async def load_item(self, url: str) -> MovieInfo:
23
23
  item_type = url.split("?type=")[-1].split("&id=")[0]
24
24
  item_id = url.split("&id=")[-1]
25
25
 
26
+ istek = await self.oturum.get(f"{self.main_url}/sinewix/{item_type}/{item_id}")
27
+ veri = istek.json()
28
+
26
29
  match item_type:
27
30
  case "movie":
28
- istek = await self.oturum.get(f"{self.main_url}/sinewix/movie/{item_id}")
29
- veri = istek.json()
30
-
31
31
  org_title = veri.get("title")
32
32
  alt_title = veri.get("original_name") or ""
33
33
  title = f"{org_title} - {alt_title}" if (alt_title and org_title != alt_title) else org_title
34
34
 
35
35
  return MovieInfo(
36
- url = self.fix_url(f"{self.main_url}/sinewix/movie/{item_id}"),
36
+ url = self.fix_url(f"{self.main_url}/sinewix/{item_type}/{item_id}"),
37
37
  poster = self.fix_url(veri.get("poster_path")),
38
38
  title = title,
39
39
  description = veri.get("overview"),
@@ -42,8 +42,45 @@ class SineWix(PluginBase):
42
42
  year = veri.get("release_date"),
43
43
  actors = [actor.get("name") for actor in veri.get("casterslist")],
44
44
  )
45
+ case _:
46
+ org_title = veri.get("name")
47
+ alt_title = veri.get("original_name") or ""
48
+ title = f"{org_title} - {alt_title}" if (alt_title and org_title != alt_title) else org_title
49
+
50
+ episodes = []
51
+ for season in veri.get("seasons"):
52
+ for episode in season.get("episodes"):
53
+ ep_model = Episode(
54
+ season = season.get("season_number"),
55
+ episode = episode.get("episode_number"),
56
+ title = episode.get("name"),
57
+ url = self.fix_url(episode.get("videos")[0].get("link")),
58
+ )
59
+
60
+ episodes.append(ep_model)
61
+
62
+ self._data[ep_model.url] = {
63
+ "name" : f"{ep_model.season}. Sezon {ep_model.episode}. Bölüm - {ep_model.title}",
64
+ "referer" : self.main_url,
65
+ "subtitles" : []
66
+ }
67
+
68
+ return SeriesInfo(
69
+ url = self.fix_url(f"{self.main_url}/sinewix/{item_type}/{item_id}"),
70
+ poster = self.fix_url(veri.get("poster_path")),
71
+ title = title,
72
+ description = veri.get("overview"),
73
+ tags = [genre.get("name") for genre in veri.get("genres")],
74
+ rating = veri.get("vote_average"),
75
+ year = veri.get("first_air_date"),
76
+ actors = [actor.get("name") for actor in veri.get("casterslist")],
77
+ episodes = episodes,
78
+ )
45
79
 
46
80
  async def load_links(self, url: str) -> list[str]:
81
+ if not url.startswith(self.main_url):
82
+ return [url]
83
+
47
84
  istek = await self.oturum.get(url)
48
85
  veri = istek.json()
49
86
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  from .CLI import konsol, cikis_yap, hata_yakala
4
4
  from .Managers import PluginManager, ExtractorManager, UIManager, MediaManager
5
- from .Core import PluginBase, ExtractorBase
5
+ from .Core import PluginBase, ExtractorBase, SeriesInfo
6
6
  from asyncio import run
7
7
 
8
8
  class KekikStream:
@@ -68,12 +68,25 @@ 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(media_info.url)
72
- await self.show_options(links)
71
+ if isinstance(media_info, SeriesInfo):
72
+ selected_episode = await self.ui_manager.select_from_list(
73
+ message="Bir bölüm seçin:",
74
+ choices=[
75
+ {"name": f"{episode.season}. Sezon {episode.episode}. Bölüm - {episode.title}", "value": episode.url}
76
+ for episode in media_info.episodes
77
+ ]
78
+ )
79
+ if selected_episode:
80
+ links = await self.current_plugin.load_links(selected_episode)
81
+ await self.show_options(links)
82
+ else:
83
+ links = await self.current_plugin.load_links(media_info.url)
84
+ await self.show_options(links)
73
85
 
74
86
  async def show_options(self, links):
75
87
  mapping = self.extractor_manager.map_links_to_extractors(links)
76
- if not mapping and (not hasattr(self.current_plugin, "play") and not callable(self.current_plugin.play)):
88
+ has_play_method = hasattr(self.current_plugin, "play") and callable(getattr(self.current_plugin, "play", None))
89
+ if not mapping and not has_play_method:
77
90
  konsol.print("[bold red]Hiçbir Extractor bulunamadı![/bold red]")
78
91
  konsol.print(links)
79
92
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: KekikStream
3
- Version: 0.0.8
3
+ Version: 0.1.0
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.0.8
3
+ Version: 0.1.0
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.0.8",
9
+ version = "0.1.0",
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,36 +0,0 @@
1
- # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
-
3
- from pydantic import BaseModel, validator
4
- from typing import Optional
5
-
6
-
7
- class SearchResult(BaseModel):
8
- """Arama sonucunda dönecek veri modeli."""
9
- title : str
10
- url : str
11
- poster : Optional[str] = None
12
-
13
-
14
- class MovieInfo(BaseModel):
15
- """Bir medya öğesinin bilgilerini tutan model."""
16
- url : str
17
- poster : Optional[str] = None
18
- title : Optional[str] = None
19
- description : Optional[str] = None
20
- tags : Optional[str] = None
21
- rating : Optional[str] = None
22
- year : Optional[str] = None
23
- actors : Optional[str] = None
24
- duration : Optional[int] = None
25
-
26
- @validator("tags", pre=True)
27
- def convert_tags(cls, value):
28
- return ", ".join(value) if isinstance(value, list) else value
29
-
30
- @validator("actors", pre=True)
31
- def convert_actors(cls, 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
File without changes
File without changes
File without changes
File without changes