KekikStream 2.3.2__py3-none-any.whl → 2.3.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.
Files changed (59) hide show
  1. KekikStream/Core/HTMLHelper.py +134 -0
  2. KekikStream/Core/Plugin/PluginBase.py +4 -1
  3. KekikStream/Core/__init__.py +2 -0
  4. KekikStream/Extractors/CloseLoad.py +12 -13
  5. KekikStream/Extractors/ContentX.py +12 -15
  6. KekikStream/Extractors/DonilasPlay.py +10 -10
  7. KekikStream/Extractors/DzenRu.py +3 -3
  8. KekikStream/Extractors/ExPlay.py +10 -10
  9. KekikStream/Extractors/Filemoon.py +11 -16
  10. KekikStream/Extractors/JetTv.py +4 -4
  11. KekikStream/Extractors/MixPlayHD.py +10 -11
  12. KekikStream/Extractors/MolyStream.py +5 -9
  13. KekikStream/Extractors/Odnoklassniki.py +4 -4
  14. KekikStream/Extractors/PeaceMakerst.py +3 -3
  15. KekikStream/Extractors/PixelDrain.py +6 -5
  16. KekikStream/Extractors/PlayerFilmIzle.py +6 -10
  17. KekikStream/Extractors/RapidVid.py +8 -7
  18. KekikStream/Extractors/SetPlay.py +10 -10
  19. KekikStream/Extractors/SetPrime.py +3 -6
  20. KekikStream/Extractors/SibNet.py +4 -5
  21. KekikStream/Extractors/Sobreatsesuyp.py +5 -5
  22. KekikStream/Extractors/TRsTX.py +5 -5
  23. KekikStream/Extractors/TurboImgz.py +3 -4
  24. KekikStream/Extractors/TurkeyPlayer.py +5 -5
  25. KekikStream/Extractors/VidHide.py +4 -7
  26. KekikStream/Extractors/VidMoly.py +24 -25
  27. KekikStream/Extractors/VidMoxy.py +8 -9
  28. KekikStream/Extractors/VidPapi.py +5 -7
  29. KekikStream/Extractors/VideoSeyred.py +3 -3
  30. KekikStream/Plugins/BelgeselX.py +40 -51
  31. KekikStream/Plugins/DiziBox.py +53 -81
  32. KekikStream/Plugins/DiziPal.py +41 -74
  33. KekikStream/Plugins/DiziYou.py +95 -88
  34. KekikStream/Plugins/Dizilla.py +51 -71
  35. KekikStream/Plugins/FilmBip.py +24 -49
  36. KekikStream/Plugins/FilmMakinesi.py +35 -52
  37. KekikStream/Plugins/FilmModu.py +27 -41
  38. KekikStream/Plugins/FullHDFilm.py +57 -62
  39. KekikStream/Plugins/FullHDFilmizlesene.py +35 -51
  40. KekikStream/Plugins/HDFilmCehennemi.py +48 -62
  41. KekikStream/Plugins/JetFilmizle.py +32 -50
  42. KekikStream/Plugins/KultFilmler.py +42 -67
  43. KekikStream/Plugins/RecTV.py +7 -4
  44. KekikStream/Plugins/RoketDizi.py +30 -50
  45. KekikStream/Plugins/SelcukFlix.py +15 -29
  46. KekikStream/Plugins/SetFilmIzle.py +41 -70
  47. KekikStream/Plugins/SezonlukDizi.py +47 -65
  48. KekikStream/Plugins/Sinefy.py +34 -50
  49. KekikStream/Plugins/SinemaCX.py +31 -55
  50. KekikStream/Plugins/Sinezy.py +27 -54
  51. KekikStream/Plugins/SuperFilmGeldi.py +25 -44
  52. KekikStream/Plugins/UgurFilm.py +23 -48
  53. {kekikstream-2.3.2.dist-info → kekikstream-2.3.4.dist-info}/METADATA +1 -1
  54. kekikstream-2.3.4.dist-info/RECORD +83 -0
  55. kekikstream-2.3.2.dist-info/RECORD +0 -82
  56. {kekikstream-2.3.2.dist-info → kekikstream-2.3.4.dist-info}/WHEEL +0 -0
  57. {kekikstream-2.3.2.dist-info → kekikstream-2.3.4.dist-info}/entry_points.txt +0 -0
  58. {kekikstream-2.3.2.dist-info → kekikstream-2.3.4.dist-info}/licenses/LICENSE +0 -0
  59. {kekikstream-2.3.2.dist-info → kekikstream-2.3.4.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,7 @@
1
1
  # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
2
 
3
- from KekikStream.Core import PluginBase, MainPageResult, SearchResult, SeriesInfo, Episode, MovieInfo, ExtractResult
4
- from selectolax.parser import HTMLParser
5
- import re, json, urllib.parse
3
+ from KekikStream.Core import PluginBase, MainPageResult, SearchResult, SeriesInfo, Episode, MovieInfo, ExtractResult, HTMLHelper
4
+ import json, urllib.parse
6
5
 
7
6
  class Sinefy(PluginBase):
8
7
  name = "Sinefy"
@@ -44,17 +43,13 @@ class Sinefy(PluginBase):
44
43
  full_url = f"{url}&page={page}"
45
44
 
46
45
  resp = await self.httpx.get(full_url)
47
- sel = HTMLParser(resp.text)
46
+ sel = HTMLHelper(resp.text)
48
47
 
49
48
  results = []
50
- for item in sel.css("div.poster-with-subject, div.dark-segment div.poster-md.poster"):
51
- h2_el = item.css_first("h2")
52
- link_el = item.css_first("a")
53
- img_el = item.css_first("img")
54
-
55
- title = h2_el.text(strip=True) if h2_el else None
56
- href = link_el.attrs.get("href") if link_el else None
57
- poster = img_el.attrs.get("data-srcset") if img_el else None
49
+ for item in sel.select("div.poster-with-subject, div.dark-segment div.poster-md.poster"):
50
+ title = sel.select_text("h2", item)
51
+ href = sel.select_attr("a", "href", item)
52
+ poster = sel.select_attr("img", "data-srcset", item)
58
53
 
59
54
  if poster:
60
55
  poster = poster.split(",")[0].split(" ")[0]
@@ -76,13 +71,10 @@ class Sinefy(PluginBase):
76
71
 
77
72
  try:
78
73
  resp = await self.httpx.get(self.main_url)
79
- sel = HTMLParser(resp.text)
80
-
81
- cke_el = sel.css_first("input[name='cKey']")
82
- cval_el = sel.css_first("input[name='cValue']")
74
+ sel = HTMLHelper(resp.text)
83
75
 
84
- cke = cke_el.attrs.get("value") if cke_el else None
85
- cval = cval_el.attrs.get("value") if cval_el else None
76
+ cke = sel.select_attr("input[name='cKey']", "value")
77
+ cval = sel.select_attr("input[name='cValue']", "value")
86
78
 
87
79
  if cke and cval:
88
80
  c_key = cke
@@ -145,44 +137,39 @@ class Sinefy(PluginBase):
145
137
 
146
138
  async def load_item(self, url: str) -> SeriesInfo:
147
139
  resp = await self.httpx.get(url)
148
- sel = HTMLParser(resp.text)
140
+ sel = HTMLHelper(resp.text)
149
141
 
150
- title_el = sel.css_first("h1")
151
- title = title_el.text(strip=True) if title_el else None
142
+ title = sel.select_text("h1")
152
143
 
153
- img_el = sel.css_first("div.ui.items img")
154
- poster_info = img_el.attrs.get("data-srcset") if img_el else None
155
- poster = None
144
+ poster_info = sel.select_attr("div.ui.items img", "data-srcset")
145
+ poster = None
156
146
  if poster_info:
157
- # take 1x
158
147
  parts = str(poster_info).split(",")
159
148
  for p in parts:
160
149
  if "1x" in p:
161
150
  poster = p.strip().split(" ")[0]
162
151
  break
163
-
164
- desc_el = sel.css_first("p#tv-series-desc")
165
- description = desc_el.text(strip=True) if desc_el else None
166
152
 
167
- tags = [a.text(strip=True) for a in sel.css("div.item.categories a") if a.text(strip=True)]
153
+ description = sel.select_text("p#tv-series-desc")
154
+
155
+ tags = [a.text(strip=True) for a in sel.select("div.item.categories a") if a.text(strip=True)]
168
156
 
169
- rating_el = sel.css_first("span.color-imdb")
170
- rating = rating_el.text(strip=True) if rating_el else None
157
+ rating = sel.select_text("span.color-imdb")
171
158
 
172
- actors = [h5.text(strip=True) for h5 in sel.css("div.content h5") if h5.text(strip=True)]
159
+ actors = [h5.text(strip=True) for h5 in sel.select("div.content h5") if h5.text(strip=True)]
173
160
 
174
- year_el = sel.css_first("span.item.year")
175
- year = year_el.text(strip=True) if year_el else None
161
+ year = sel.select_text("span.item.year")
176
162
 
177
163
  episodes = []
178
- episodes_box = sel.css_first("section.episodes-box")
164
+ episodes_box_list = sel.select("section.episodes-box")
179
165
 
180
- if episodes_box:
166
+ if episodes_box_list:
167
+ episodes_box = episodes_box_list[0]
181
168
  # Sezon menüsünden sezon linklerini al
182
- season_menu = episodes_box.css("div.ui.vertical.fluid.tabular.menu a.item")
169
+ season_menu = sel.select("div.ui.vertical.fluid.tabular.menu a.item", episodes_box)
183
170
 
184
171
  # Sezon tab içeriklerini al
185
- season_tabs = episodes_box.css("div.ui.tab")
172
+ season_tabs = sel.select("div.ui.tab", episodes_box)
186
173
 
187
174
  # Eğer birden fazla sezon varsa, her sezon tab'ından bölümleri çek
188
175
  if season_tabs:
@@ -193,12 +180,12 @@ class Sinefy(PluginBase):
193
180
  # Menüden sezon numarasını almaya çalış
194
181
  if idx < len(season_menu):
195
182
  menu_href = season_menu[idx].attrs.get("href", "")
196
- match = re.search(r"sezon-(\d+)", menu_href)
183
+ match = sel.regex_first(r"sezon-(\d+)", menu_href)
197
184
  if match:
198
- current_season_no = int(match.group(1))
185
+ current_season_no = int(match)
199
186
 
200
187
  # Bu sezon tab'ından bölüm linklerini çek
201
- ep_links = season_tab.css("a[href*='bolum']")
188
+ ep_links = sel.select("a[href*='bolum']", season_tab)
202
189
 
203
190
  seen_urls = set()
204
191
  for ep_link in ep_links:
@@ -209,17 +196,15 @@ class Sinefy(PluginBase):
209
196
 
210
197
  # Bölüm numarasını URL'den çıkar
211
198
  ep_no = 0
212
- match_ep = re.search(r"bolum-(\d+)", href)
199
+ match_ep = sel.regex_first(r"bolum-(\d+)", href)
213
200
  if match_ep:
214
- ep_no = int(match_ep.group(1))
201
+ ep_no = int(match_ep)
215
202
 
216
203
  # Bölüm başlığını çıkar (önce title attribute, sonra text)
217
204
  name = ep_link.attrs.get("title", "")
218
205
  if not name:
219
- name_el = ep_link.css_first("div.content div.header")
220
- if name_el:
221
- name = name_el.text(strip=True)
222
- else:
206
+ name = sel.select_text("div.content div.header", ep_link)
207
+ if not name:
223
208
  name = ep_link.text(strip=True)
224
209
 
225
210
  if href and ep_no > 0:
@@ -256,10 +241,9 @@ class Sinefy(PluginBase):
256
241
 
257
242
  async def load_links(self, url: str) -> list[ExtractResult]:
258
243
  resp = await self.httpx.get(url)
259
- sel = HTMLParser(resp.text)
244
+ sel = HTMLHelper(resp.text)
260
245
 
261
- iframe_el = sel.css_first("iframe")
262
- iframe = iframe_el.attrs.get("src") if iframe_el else None
246
+ iframe = sel.select_attr("iframe", "src")
263
247
 
264
248
  if not iframe:
265
249
  return []
@@ -1,8 +1,7 @@
1
1
  # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
2
 
3
3
  from KekikStream.Core import PluginBase, MainPageResult, SearchResult, MovieInfo, Subtitle, ExtractResult
4
- from selectolax.parser import HTMLParser
5
- import re
4
+ from KekikStream.Core.HTMLHelper import HTMLHelper
6
5
 
7
6
  class SinemaCX(PluginBase):
8
7
  name = "SinemaCX"
@@ -39,23 +38,16 @@ class SinemaCX(PluginBase):
39
38
 
40
39
  async def get_main_page(self, page: int, url: str, category: str) -> list[MainPageResult]:
41
40
  istek = await self.httpx.get(url.replace("SAYFA", str(page)))
42
- secici = HTMLParser(istek.text)
41
+ secici = HTMLHelper(istek.text)
43
42
 
44
43
  results = []
45
- for veri in secici.css("div.son div.frag-k, div.icerik div.frag-k"):
46
- span_el = veri.css_first("div.yanac span")
47
- if not span_el:
48
- continue
49
-
50
- title = span_el.text(strip=True)
44
+ for veri in secici.select("div.son div.frag-k, div.icerik div.frag-k"):
45
+ title = secici.select_text("div.yanac span", veri)
51
46
  if not title:
52
47
  continue
53
48
 
54
- link_el = veri.css_first("div.yanac a")
55
- img_el = veri.css_first("a.resim img")
56
-
57
- href = link_el.attrs.get("href") if link_el else None
58
- poster = (img_el.attrs.get("data-src") or img_el.attrs.get("src")) if img_el else None
49
+ href = secici.select_attr("div.yanac a", "href", veri)
50
+ poster = secici.select_attr("a.resim img", "data-src", veri) or secici.select_attr("a.resim img", "src", veri)
59
51
 
60
52
  results.append(MainPageResult(
61
53
  category = category,
@@ -68,23 +60,16 @@ class SinemaCX(PluginBase):
68
60
 
69
61
  async def search(self, query: str) -> list[SearchResult]:
70
62
  istek = await self.httpx.get(f"{self.main_url}/?s={query}")
71
- secici = HTMLParser(istek.text)
63
+ secici = HTMLHelper(istek.text)
72
64
 
73
65
  results = []
74
- for veri in secici.css("div.icerik div.frag-k"):
75
- span_el = veri.css_first("div.yanac span")
76
- if not span_el:
77
- continue
78
-
79
- title = span_el.text(strip=True)
66
+ for veri in secici.select("div.icerik div.frag-k"):
67
+ title = secici.select_text("div.yanac span", veri)
80
68
  if not title:
81
69
  continue
82
70
 
83
- link_el = veri.css_first("div.yanac a")
84
- img_el = veri.css_first("a.resim img")
85
-
86
- href = link_el.attrs.get("href") if link_el else None
87
- poster = (img_el.attrs.get("data-src") or img_el.attrs.get("src")) if img_el else None
71
+ href = secici.select_attr("div.yanac a", "href", veri)
72
+ poster = secici.select_attr("a.resim img", "data-src", veri) or secici.select_attr("a.resim img", "src", veri)
88
73
 
89
74
  results.append(SearchResult(
90
75
  title = title,
@@ -96,29 +81,21 @@ class SinemaCX(PluginBase):
96
81
 
97
82
  async def load_item(self, url: str) -> MovieInfo:
98
83
  istek = await self.httpx.get(url)
99
- secici = HTMLParser(istek.text)
84
+ secici = HTMLHelper(istek.text)
100
85
 
101
- duration_match = re.search(r"Süre:.*?(\d+)\s*Dakika", istek.text)
86
+ duration_match = secici.regex_first(r"Süre:.*?(\d+)\s*Dakika")
102
87
 
103
- desc_el = secici.css_first("div.ackl div.scroll-liste")
104
- description = desc_el.text(strip=True) if desc_el else None
88
+ description = secici.select_text("div.ackl div.scroll-liste")
105
89
 
106
- link_el = secici.css_first("link[rel='image_src']")
107
- poster = link_el.attrs.get("href") if link_el else None
90
+ poster = secici.select_attr("link[rel='image_src']", "href")
108
91
 
109
- title_el = secici.css_first("div.f-bilgi h1")
110
- title = title_el.text(strip=True) if title_el else None
92
+ title = secici.select_text("div.f-bilgi h1")
111
93
 
112
- tags = [a.text(strip=True) for a in secici.css("div.f-bilgi div.tur a") if a.text(strip=True)]
94
+ tags = secici.select_all_text("div.f-bilgi div.tur a")
113
95
 
114
- year_el = secici.css_first("div.f-bilgi ul.detay a[href*='yapim']")
115
- year = year_el.text(strip=True) if year_el else None
96
+ year = secici.select_text("div.f-bilgi ul.detay a[href*='yapim']")
116
97
 
117
- actors = []
118
- for li in secici.css("li.oync li.oyuncu-k"):
119
- isim_el = li.css_first("span.isim")
120
- if isim_el and isim_el.text(strip=True):
121
- actors.append(isim_el.text(strip=True))
98
+ actors = secici.select_all_text("li.oync li.oyuncu-k span.isim")
122
99
 
123
100
  return MovieInfo(
124
101
  url = url,
@@ -128,14 +105,14 @@ class SinemaCX(PluginBase):
128
105
  tags = tags,
129
106
  year = year,
130
107
  actors = actors,
131
- duration = int(duration_match[1]) if duration_match else None,
108
+ duration = int(duration_match) if duration_match else None,
132
109
  )
133
110
 
134
111
  async def load_links(self, url: str) -> list[ExtractResult]:
135
112
  istek = await self.httpx.get(url)
136
- secici = HTMLParser(istek.text)
113
+ secici = HTMLHelper(istek.text)
137
114
 
138
- iframe_list = [iframe.attrs.get("data-vsrc") for iframe in secici.css("iframe") if iframe.attrs.get("data-vsrc")]
115
+ iframe_list = secici.select_all_attr("iframe", "data-vsrc")
139
116
 
140
117
  # Sadece fragman varsa /2/ sayfasından dene
141
118
  has_only_trailer = all(
@@ -146,8 +123,9 @@ class SinemaCX(PluginBase):
146
123
  if has_only_trailer:
147
124
  alt_url = url.rstrip("/") + "/2/"
148
125
  alt_istek = await self.httpx.get(alt_url)
149
- alt_sec = HTMLParser(alt_istek.text)
150
- iframe_list = [iframe.attrs.get("data-vsrc") for iframe in alt_sec.css("iframe") if iframe.attrs.get("data-vsrc")]
126
+ alt_istek = await self.httpx.get(alt_url)
127
+ alt_sec = HTMLHelper(alt_istek.text)
128
+ iframe_list = alt_sec.select_all_attr("iframe", "data-vsrc")
151
129
 
152
130
  if not iframe_list:
153
131
  return []
@@ -164,17 +142,15 @@ class SinemaCX(PluginBase):
164
142
  iframe_text = iframe_istek.text
165
143
 
166
144
  subtitles = []
167
- sub_match = re.search(r'playerjsSubtitle\s*=\s*"(.+?)"', iframe_text)
168
- if sub_match:
169
- sub_section = sub_match[1]
170
- for sub in re.finditer(r'\[(.*?)](https?://[^\s",]+)', sub_section):
171
- subtitles.append(Subtitle(name=sub[1], url=self.fix_url(sub[2])))
145
+ sub_section = HTMLHelper(iframe_text).regex_first(r'playerjsSubtitle\s*=\s*"(.+?)"')
146
+ if sub_section:
147
+ for lang, link in HTMLHelper(sub_section).regex_all(r'\[(.*?)](https?://[^\s\",]+)'):
148
+ subtitles.append(Subtitle(name=lang, url=self.fix_url(link)))
172
149
 
173
150
  # player.filmizle.in kontrolü
174
151
  if "player.filmizle.in" in iframe.lower():
175
- base_match = re.search(r"https?://([^/]+)", iframe)
176
- if base_match:
177
- base_url = base_match[1]
152
+ base_url = HTMLHelper(iframe).regex_first(r"https?://([^/]+)")
153
+ if base_url:
178
154
  vid_id = iframe.split("/")[-1]
179
155
 
180
156
  self.httpx.headers.update({"X-Requested-With": "XMLHttpRequest"})
@@ -1,8 +1,7 @@
1
1
  # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
2
 
3
- from KekikStream.Core import PluginBase, MainPageResult, SearchResult, MovieInfo, ExtractResult
4
- from selectolax.parser import HTMLParser
5
- import re, base64
3
+ from KekikStream.Core import PluginBase, MainPageResult, SearchResult, MovieInfo, ExtractResult, HTMLHelper
4
+ import base64
6
5
 
7
6
  class Sinezy(PluginBase):
8
7
  name = "Sinezy"
@@ -45,16 +44,13 @@ class Sinezy(PluginBase):
45
44
  async def get_main_page(self, page: int, url: str, category: str) -> list[MainPageResult]:
46
45
  full_url = f"{url}page/{page}/"
47
46
  resp = await self.httpx.get(full_url)
48
- sel = HTMLParser(resp.text)
47
+ secici = HTMLHelper(resp.text)
49
48
 
50
49
  results = []
51
- for item in sel.css("div.container div.content div.movie_box.move_k"):
52
- link_el = item.css_first("a")
53
- img_el = item.css_first("img")
54
-
55
- title = link_el.attrs.get("title") if link_el else None
56
- href = link_el.attrs.get("href") if link_el else None
57
- poster = img_el.attrs.get("data-src") if img_el else None
50
+ for item in secici.select("div.container div.content div.movie_box.move_k"):
51
+ title = secici.select_attr("a", "title", item)
52
+ href = secici.select_attr("a", "href", item)
53
+ poster = secici.select_attr("img", "data-src", item)
58
54
 
59
55
  if title and href:
60
56
  results.append(MainPageResult(
@@ -69,16 +65,13 @@ class Sinezy(PluginBase):
69
65
  async def search(self, query: str) -> list[SearchResult]:
70
66
  url = f"{self.main_url}/arama/?s={query}"
71
67
  resp = await self.httpx.get(url)
72
- sel = HTMLParser(resp.text)
68
+ secici = HTMLHelper(resp.text)
73
69
 
74
70
  results = []
75
- for item in sel.css("div.movie_box.move_k"):
76
- link_el = item.css_first("a")
77
- img_el = item.css_first("img")
78
-
79
- title = link_el.attrs.get("title") if link_el else None
80
- href = link_el.attrs.get("href") if link_el else None
81
- poster = img_el.attrs.get("data-src") if img_el else None
71
+ for item in secici.select("div.movie_box.move_k"):
72
+ title = secici.select_attr("a", "title", item)
73
+ href = secici.select_attr("a", "href", item)
74
+ poster = secici.select_attr("img", "data-src", item)
82
75
 
83
76
  if title and href:
84
77
  results.append(SearchResult(
@@ -91,38 +84,19 @@ class Sinezy(PluginBase):
91
84
 
92
85
  async def load_item(self, url: str) -> MovieInfo:
93
86
  resp = await self.httpx.get(url)
94
- sel = HTMLParser(resp.text)
95
-
96
- detail_el = sel.css_first("div.detail")
97
- title = detail_el.attrs.get("title") if detail_el else None
98
-
99
- poster_el = sel.css_first("div.move_k img")
100
- poster = poster_el.attrs.get("data-src") if poster_el else None
87
+ secici = HTMLHelper(resp.text)
101
88
 
102
- desc_el = sel.css_first("div.desc.yeniscroll p")
103
- description = desc_el.text(strip=True) if desc_el else None
89
+ title = secici.select_attr("div.detail", "title")
90
+ poster = secici.select_attr("div.move_k img", "data-src")
91
+ description = secici.select_text("div.desc.yeniscroll p")
92
+ rating = secici.select_text("span.info span.imdb")
104
93
 
105
- rating_el = sel.css_first("span.info span.imdb")
106
- rating = rating_el.text(strip=True) if rating_el else None
94
+ tags = secici.select_all_text("div.detail span a")
95
+ actors = secici.select_all_text("span.oyn p")
107
96
 
108
- tags = [a.text(strip=True) for a in sel.css("div.detail span a") if a.text(strip=True)]
109
- actors = [p.text(strip=True) for p in sel.css("span.oyn p") if p.text(strip=True)]
110
-
111
- year = None
112
- info_el = sel.css_first("span.info")
113
- info_text = info_el.text(strip=True) if info_el else ""
114
- if info_text:
115
- year_match = re.search(r'\b(19\d{2}|20\d{2})\b', info_text)
116
- if year_match:
117
- year = year_match.group(1)
118
-
119
- # Bulunamadıysa tüm sayfada ara
97
+ year = secici.regex_first(r"\b(19\d{2}|20\d{2})\b")
120
98
  if not year:
121
- all_text = sel.body.text() if sel.body else ""
122
- year_match = re.search(r'\b(19\d{2}|20\d{2})\b', all_text)
123
- if year_match:
124
- year = year_match.group(1)
125
-
99
+ year = secici.regex_first(r"\b(19\d{2}|20\d{2})\b", secici.html)
126
100
  return MovieInfo(
127
101
  title = title,
128
102
  url = url,
@@ -136,18 +110,17 @@ class Sinezy(PluginBase):
136
110
 
137
111
  async def load_links(self, url: str) -> list[ExtractResult]:
138
112
  resp = await self.httpx.get(url)
113
+ secici = HTMLHelper(resp.text)
139
114
 
140
- match = re.search(r"ilkpartkod\s*=\s*'([^']+)'", resp.text, re.IGNORECASE)
141
- if match:
142
- encoded = match.group(1)
115
+ encoded = secici.regex_first(r"ilkpartkod\s*=\s*'([^']+)'", secici.html)
116
+ if encoded:
143
117
  try:
144
118
  decoded = base64.b64decode(encoded).decode('utf-8')
145
- iframe_match = re.search(r'src="([^"]*)"', decoded)
119
+ decoded_sec = HTMLHelper(decoded)
120
+ iframe = decoded_sec.select_attr('iframe', 'src')
146
121
 
147
- if iframe_match:
148
- iframe = iframe_match.group(1)
122
+ if iframe:
149
123
  iframe = self.fix_url(iframe)
150
-
151
124
  data = await self.extract(iframe)
152
125
  if data:
153
126
  return [data]
@@ -1,8 +1,6 @@
1
1
  # Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
2
2
 
3
- from KekikStream.Core import PluginBase, MainPageResult, SearchResult, MovieInfo, ExtractResult
4
- from selectolax.parser import HTMLParser
5
- import re
3
+ from KekikStream.Core import PluginBase, MainPageResult, SearchResult, MovieInfo, ExtractResult, HTMLHelper
6
4
 
7
5
  class SuperFilmGeldi(PluginBase):
8
6
  name = "SuperFilmGeldi"
@@ -36,21 +34,16 @@ class SuperFilmGeldi(PluginBase):
36
34
 
37
35
  async def get_main_page(self, page: int, url: str, category: str) -> list[MainPageResult]:
38
36
  istek = await self.httpx.get(url.replace("SAYFA", str(page)))
39
- secici = HTMLParser(istek.text)
37
+ secici = HTMLHelper(istek.text)
40
38
 
41
39
  results = []
42
- for veri in secici.css("div.movie-preview-content"):
43
- link_el = veri.css_first("span.movie-title a")
44
- if not link_el:
45
- continue
46
-
47
- title_text = link_el.text(strip=True)
40
+ for veri in secici.select("div.movie-preview-content"):
41
+ title_text = secici.select_text("span.movie-title a", veri)
48
42
  if not title_text:
49
43
  continue
50
44
 
51
- img_el = veri.css_first("img")
52
- href = link_el.attrs.get("href")
53
- poster = img_el.attrs.get("src") if img_el else None
45
+ href = secici.select_attr("span.movie-title a", "href", veri)
46
+ poster = secici.select_attr("img", "src", veri)
54
47
 
55
48
  results.append(MainPageResult(
56
49
  category = category,
@@ -63,21 +56,16 @@ class SuperFilmGeldi(PluginBase):
63
56
 
64
57
  async def search(self, query: str) -> list[SearchResult]:
65
58
  istek = await self.httpx.get(f"{self.main_url}?s={query}")
66
- secici = HTMLParser(istek.text)
59
+ secici = HTMLHelper(istek.text)
67
60
 
68
61
  results = []
69
- for veri in secici.css("div.movie-preview-content"):
70
- link_el = veri.css_first("span.movie-title a")
71
- if not link_el:
72
- continue
73
-
74
- title_text = link_el.text(strip=True)
62
+ for veri in secici.select("div.movie-preview-content"):
63
+ title_text = secici.select_text("span.movie-title a", veri)
75
64
  if not title_text:
76
65
  continue
77
66
 
78
- img_el = veri.css_first("img")
79
- href = link_el.attrs.get("href")
80
- poster = img_el.attrs.get("src") if img_el else None
67
+ href = secici.select_attr("span.movie-title a", "href", veri)
68
+ poster = secici.select_attr("img", "src", veri)
81
69
 
82
70
  results.append(SearchResult(
83
71
  title = self.clean_title(title_text.split(" izle")[0]),
@@ -89,26 +77,19 @@ class SuperFilmGeldi(PluginBase):
89
77
 
90
78
  async def load_item(self, url: str) -> MovieInfo:
91
79
  istek = await self.httpx.get(url)
92
- secici = HTMLParser(istek.text)
80
+ secici = HTMLHelper(istek.text)
93
81
 
94
- title_el = secici.css_first("div.title h1")
95
- title = title_el.text(strip=True) if title_el else ""
96
- title = self.clean_title(title.split(" izle")[0]) if title else ""
82
+ title = secici.select_text("div.title h1") or ""
83
+ title = self.clean_title(title.split(" izle")[0]) if title else ""
97
84
 
98
- poster_el = secici.css_first("div.poster img")
99
- poster = poster_el.attrs.get("src") if poster_el else None
85
+ poster = secici.select_attr("div.poster img", "src")
100
86
 
101
- # year: re_first kullanılamaz, re.search kullanıyoruz
102
- year_el = secici.css_first("div.release a")
103
- year_text = year_el.text(strip=True) if year_el else ""
104
- year_match = re.search(r"(\d{4})", year_text)
105
- year = year_match.group(1) if year_match else None
87
+ year = secici.extract_year("div.release a")
106
88
 
107
- desc_el = secici.css_first("div.excerpt p")
108
- description = desc_el.text(strip=True) if desc_el else None
89
+ description = secici.select_text("div.excerpt p")
109
90
 
110
- tags = [a.text(strip=True) for a in secici.css("div.categories a") if a.text(strip=True)]
111
- actors = [a.text(strip=True) for a in secici.css("div.actor a") if a.text(strip=True)]
91
+ tags = secici.select_all_text("div.categories a")
92
+ actors = secici.select_all_text("div.actor a")
112
93
 
113
94
  return MovieInfo(
114
95
  url = url,
@@ -122,11 +103,10 @@ class SuperFilmGeldi(PluginBase):
122
103
 
123
104
  async def load_links(self, url: str) -> list[ExtractResult]:
124
105
  istek = await self.httpx.get(url)
125
- secici = HTMLParser(istek.text)
106
+ secici = HTMLHelper(istek.text)
126
107
 
127
- iframe_el = secici.css_first("div#vast iframe")
128
- iframe = iframe_el.attrs.get("src") if iframe_el else None
129
- iframe = self.fix_url(iframe) if iframe else None
108
+ iframe = secici.select_attr("div#vast iframe", "src")
109
+ iframe = self.fix_url(iframe) if iframe else None
130
110
 
131
111
  if not iframe:
132
112
  return []
@@ -136,10 +116,11 @@ class SuperFilmGeldi(PluginBase):
136
116
  # Mix player özel işleme
137
117
  if "mix" in iframe and "index.php?data=" in iframe:
138
118
  iframe_istek = await self.httpx.get(iframe, headers={"Referer": f"{self.main_url}/"})
139
- mix_point = re.search(r'videoUrl"\s*:\s*"(.*?)"\s*,\s*"videoServer', iframe_istek.text)
119
+ iframe_sec = HTMLHelper(iframe_istek.text)
120
+ mix_point = iframe_sec.regex_first(r'videoUrl"\s*:\s*"(.*?)"\s*,\s*"videoServer')
140
121
 
141
122
  if mix_point:
142
- mix_point = mix_point[1].replace("\\", "")
123
+ mix_point = mix_point.replace("\\", "")
143
124
 
144
125
  # Endpoint belirleme
145
126
  if "mixlion" in iframe: