KekikStream 1.4.7__py3-none-any.whl → 1.5.0__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/Extractor/ExtractorModels.py +2 -2
- KekikStream/Extractors/CloseLoad.py +4 -3
- KekikStream/Extractors/ContentX.py +2 -0
- KekikStream/Extractors/MailRu.py +2 -2
- KekikStream/Extractors/MixPlayHD.py +1 -0
- KekikStream/Extractors/Odnoklassniki.py +1 -0
- KekikStream/Extractors/PeaceMakerst.py +1 -0
- KekikStream/Extractors/PixelDrain.py +1 -0
- KekikStream/Extractors/RapidVid.py +1 -0
- KekikStream/Extractors/SibNet.py +1 -0
- KekikStream/Extractors/Sobreatsesuyp.py +1 -0
- KekikStream/Extractors/TRsTX.py +1 -0
- KekikStream/Extractors/TauVideo.py +1 -0
- KekikStream/Extractors/TurboImgz.py +1 -0
- KekikStream/Extractors/VidMoly.py +1 -0
- KekikStream/Extractors/VidMoxy.py +1 -0
- KekikStream/Extractors/VideoSeyred.py +1 -0
- KekikStream/Plugins/DiziYou.py +1 -0
- KekikStream/Plugins/HDFilmCehennemi.py +6 -4
- KekikStream/Plugins/RecTV.py +4 -2
- KekikStream/Plugins/Shorten.py +1 -0
- KekikStream/Plugins/SineWix.py +2 -0
- {kekikstream-1.4.7.dist-info → kekikstream-1.5.0.dist-info}/METADATA +1 -1
- {kekikstream-1.4.7.dist-info → kekikstream-1.5.0.dist-info}/RECORD +28 -29
- KekikStream/Helpers/Unpack.py +0 -75
- {kekikstream-1.4.7.dist-info → kekikstream-1.5.0.dist-info}/LICENSE +0 -0
- {kekikstream-1.4.7.dist-info → kekikstream-1.5.0.dist-info}/WHEEL +0 -0
- {kekikstream-1.4.7.dist-info → kekikstream-1.5.0.dist-info}/entry_points.txt +0 -0
- {kekikstream-1.4.7.dist-info → kekikstream-1.5.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
# Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
|
2
2
|
|
3
|
-
from KekikStream.Core
|
4
|
-
from
|
3
|
+
from KekikStream.Core import ExtractorBase, ExtractResult
|
4
|
+
from Kekik.Sifreleme import Packer
|
5
5
|
import re, base64
|
6
6
|
|
7
7
|
def get_m3u_link(data: str) -> str:
|
@@ -35,12 +35,13 @@ class CloseLoadExtractor(ExtractorBase):
|
|
35
35
|
istek.raise_for_status()
|
36
36
|
|
37
37
|
eval_func = re.compile(r'\s*(eval\(function[\s\S].*)\s*').findall(istek.text)[0]
|
38
|
-
m3u_link = get_m3u_link(extract_data(unpack(eval_func)))
|
38
|
+
m3u_link = get_m3u_link(extract_data(Packer.unpack(eval_func)))
|
39
39
|
|
40
40
|
await self.close()
|
41
41
|
return ExtractResult(
|
42
42
|
name = self.name,
|
43
43
|
url = m3u_link,
|
44
44
|
referer = self.main_url,
|
45
|
+
headers = {},
|
45
46
|
subtitles = []
|
46
47
|
)
|
@@ -53,6 +53,7 @@ class ContentX(ExtractorBase):
|
|
53
53
|
name = self.name,
|
54
54
|
url = m3u_link,
|
55
55
|
referer = url,
|
56
|
+
headers = {},
|
56
57
|
subtitles = subtitles
|
57
58
|
)
|
58
59
|
]
|
@@ -73,6 +74,7 @@ class ContentX(ExtractorBase):
|
|
73
74
|
name = f"{self.name} Türkçe Dublaj",
|
74
75
|
url = dublaj_link,
|
75
76
|
referer = url,
|
77
|
+
headers = {},
|
76
78
|
subtitles = []
|
77
79
|
)
|
78
80
|
)
|
KekikStream/Extractors/MailRu.py
CHANGED
KekikStream/Extractors/SibNet.py
CHANGED
KekikStream/Extractors/TRsTX.py
CHANGED
KekikStream/Plugins/DiziYou.py
CHANGED
@@ -158,6 +158,7 @@ class DiziYou(PluginBase):
|
|
158
158
|
"ext_name" : f"{self.name} | {stream.get('dil')}",
|
159
159
|
"name" : f"{self.name} | {stream.get('dil')} | {item_title} - {ep_name}",
|
160
160
|
"referer" : url,
|
161
|
+
"headers" : self.media_handler.headers,
|
161
162
|
"subtitles" : subtitles
|
162
163
|
}
|
163
164
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Bu araç @keyiflerolsun tarafından | @KekikAkademi için yazılmıştır.
|
2
2
|
|
3
|
-
from KekikStream.Core
|
4
|
-
from parsel
|
5
|
-
from
|
3
|
+
from KekikStream.Core import kekik_cache, PluginBase, MainPageResult, SearchResult, MovieInfo, ExtractResult, Subtitle
|
4
|
+
from parsel import Selector
|
5
|
+
from Kekik.Sifreleme import Packer
|
6
6
|
import random, string, re, base64
|
7
7
|
|
8
8
|
class HDFilmCehennemi(PluginBase):
|
@@ -129,6 +129,7 @@ class HDFilmCehennemi(PluginBase):
|
|
129
129
|
"ext_name" : f"{self.name} | Düşük Kalite",
|
130
130
|
"name" : "Düşük Kalite",
|
131
131
|
"referer" : f"https://cehennempass.pw/download/{video_id}",
|
132
|
+
"headers" : self.media_handler.headers,
|
132
133
|
"subtitles" : []
|
133
134
|
}
|
134
135
|
|
@@ -149,6 +150,7 @@ class HDFilmCehennemi(PluginBase):
|
|
149
150
|
"ext_name" : f"{self.name} | Yüksek Kalite",
|
150
151
|
"name" : "Yüksek Kalite",
|
151
152
|
"referer" : f"https://cehennempass.pw/download/{video_id}",
|
153
|
+
"headers" : self.media_handler.headers,
|
152
154
|
"subtitles" : []
|
153
155
|
}
|
154
156
|
|
@@ -165,7 +167,7 @@ class HDFilmCehennemi(PluginBase):
|
|
165
167
|
await self.cehennempass(iframe.split("/")[-1])
|
166
168
|
return None, None
|
167
169
|
|
168
|
-
unpacked = unpack(eval_func)
|
170
|
+
unpacked = Packer.unpack(eval_func)
|
169
171
|
b64_url = re.search(r'file_link=\"(.*)\"\;', unpacked)[1]
|
170
172
|
video_url = base64.b64decode(b64_url).decode("utf-8")
|
171
173
|
|
KekikStream/Plugins/RecTV.py
CHANGED
@@ -52,8 +52,6 @@ class RecTV(PluginBase):
|
|
52
52
|
|
53
53
|
@kekik_cache(ttl=60*60)
|
54
54
|
async def search(self, query: str) -> list[SearchResult]:
|
55
|
-
self.media_handler.headers.update({"User-Agent": "googleusercontent"})
|
56
|
-
|
57
55
|
istek = await self.http2.get(f"{self.main_url}/api/search/{query}/{self.sw_key}/")
|
58
56
|
|
59
57
|
kanallar = istek.json().get("channels")
|
@@ -97,6 +95,7 @@ class RecTV(PluginBase):
|
|
97
95
|
"ext_name" : self.name,
|
98
96
|
"name" : f"{veri.get('title')} | {ep_model.season}. Sezon {ep_model.episode}. Bölüm",
|
99
97
|
"referer" : "https://twitter.com/",
|
98
|
+
"headers" : self.media_handler.headers,
|
100
99
|
"subtitles" : []
|
101
100
|
}
|
102
101
|
|
@@ -125,6 +124,8 @@ class RecTV(PluginBase):
|
|
125
124
|
|
126
125
|
@kekik_cache(ttl=15*60)
|
127
126
|
async def load_links(self, url: str) -> list[str]:
|
127
|
+
self.media_handler.headers.update({"User-Agent": "googleusercontent"})
|
128
|
+
|
128
129
|
try:
|
129
130
|
veri = loads(url)
|
130
131
|
except Exception:
|
@@ -141,6 +142,7 @@ class RecTV(PluginBase):
|
|
141
142
|
"ext_name" : self.name,
|
142
143
|
"name" : veri.get("title"),
|
143
144
|
"referer" : "https://twitter.com/",
|
145
|
+
"headers" : self.media_handler.headers,
|
144
146
|
"subtitles" : []
|
145
147
|
}
|
146
148
|
videolar.append(video_link)
|
KekikStream/Plugins/Shorten.py
CHANGED
KekikStream/Plugins/SineWix.py
CHANGED
@@ -112,6 +112,7 @@ class SineWix(PluginBase):
|
|
112
112
|
"ext_name" : self.name,
|
113
113
|
"name" : f"{title} | {ep_model.season}x{ep_model.episode}",
|
114
114
|
"referer" : self.main_url,
|
115
|
+
"headers" : self.media_handler.headers,
|
115
116
|
"subtitles" : []
|
116
117
|
}
|
117
118
|
|
@@ -145,6 +146,7 @@ class SineWix(PluginBase):
|
|
145
146
|
"ext_name" : self.name,
|
146
147
|
"name" : f"{self.name} | {title}",
|
147
148
|
"referer" : self.main_url,
|
149
|
+
"headers" : self.media_handler.headers,
|
148
150
|
"subtitles" : []
|
149
151
|
}
|
150
152
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: KekikStream
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.5.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
|
@@ -7,7 +7,7 @@ KekikStream/Core/__init__.py,sha256=ar2MZQF83ryfLfydEXcfjdwNe4Too_HT6bP-D_4TopA,
|
|
7
7
|
KekikStream/Core/Extractor/ExtractorBase.py,sha256=7dmYh5e1Za5N_pLJrTZRuwFh-CqwGc0YJOBWf5dirjc,1724
|
8
8
|
KekikStream/Core/Extractor/ExtractorLoader.py,sha256=7uxUXTAuF65KKkmbI6iRiCiUhx-IqrronB7ixhchcTU,4289
|
9
9
|
KekikStream/Core/Extractor/ExtractorManager.py,sha256=4L1H3jiTnf0kTq4W6uS7n95bBYHlKJ8_hh0og8z4erQ,1244
|
10
|
-
KekikStream/Core/Extractor/ExtractorModels.py,sha256=
|
10
|
+
KekikStream/Core/Extractor/ExtractorModels.py,sha256=vLxG99_cbWwTc-dbk8XzjCasvR0QkoKSX2R0FAY9gks,456
|
11
11
|
KekikStream/Core/Media/MediaHandler.py,sha256=_cplsR-bt7s2oohY1Ngw0UyG427yQ-Fg0NQdAUzd0ec,6964
|
12
12
|
KekikStream/Core/Media/MediaManager.py,sha256=9ItiUguOkk3wg3YY5uf3mrjfwLPCvggnP8QviX0uiuE,526
|
13
13
|
KekikStream/Core/Plugin/PluginBase.py,sha256=gXD6a0__rAVBv1hbV7qtt4Ot5Wdx15JhF02TMd2QJd0,3179
|
@@ -15,49 +15,48 @@ KekikStream/Core/Plugin/PluginLoader.py,sha256=yZxMug-OcJ5RBm4fQkoquKrZxcBU7Pvt4
|
|
15
15
|
KekikStream/Core/Plugin/PluginManager.py,sha256=CZVg1eegi8vfMfccx0DRV0Box8kXz-aoULTQLgbPbvM,893
|
16
16
|
KekikStream/Core/Plugin/PluginModels.py,sha256=ZZJUXbC0G2k0DU7Wpbf0rwjn7spywpiaLIHE7kLajhk,2533
|
17
17
|
KekikStream/Core/UI/UIManager.py,sha256=T4V_kdTTWa-UDamgLSKa__dWJuzcvRK9NuwBlzU9Bzc,1693
|
18
|
-
KekikStream/Extractors/CloseLoad.py,sha256=
|
19
|
-
KekikStream/Extractors/ContentX.py,sha256=
|
18
|
+
KekikStream/Extractors/CloseLoad.py,sha256=Uwy_LHKak2AUHKvSqJQk9SsYhZ2D21RHyCmonBIg_hI,1477
|
19
|
+
KekikStream/Extractors/ContentX.py,sha256=HfQ3g5KlL7LxB-7lxE70kIwg17NvfEk6wEUtzo-7-nM,3044
|
20
20
|
KekikStream/Extractors/FourCX.py,sha256=4FrMj1IZBBpN_g1P6S3A-8eUu7QFwlt4fJXzJ7vfe0Q,221
|
21
21
|
KekikStream/Extractors/FourPichive.py,sha256=iq3BCUbih1UVF4y4BIWO--0hX5jP2nxqesNx3MGP3kQ,234
|
22
22
|
KekikStream/Extractors/FourPlayRu.py,sha256=wq1ylxKpsO_IBoYr_ALzB2dVrQpJ-jY9lf2zPhcAZX8,228
|
23
23
|
KekikStream/Extractors/HDStreamAble.py,sha256=66n5EvIdX_or5cdnlJ_Uqmzi50n4rl9c5VCw8kBqhQk,245
|
24
24
|
KekikStream/Extractors/Hotlinger.py,sha256=NFMRgUmb6BCrJfa7Hi0VarDNYvCeVknBWEk24FKBBa0,224
|
25
|
-
KekikStream/Extractors/MailRu.py,sha256=
|
26
|
-
KekikStream/Extractors/MixPlayHD.py,sha256=
|
25
|
+
KekikStream/Extractors/MailRu.py,sha256=gqgLmlTNOQd9sk1gX7HhgJuJgymf8oFNmA7OcEqaCE0,1306
|
26
|
+
KekikStream/Extractors/MixPlayHD.py,sha256=810efcVXQ1OniIz7gGtrsjNpqFy5Z6HScxDsJNsubHA,1584
|
27
27
|
KekikStream/Extractors/MolyStream.py,sha256=aJZL1SE40gB5KeShu-TV5IWNICHCtAXY87F0wqYrw1k,604
|
28
|
-
KekikStream/Extractors/Odnoklassniki.py,sha256=
|
28
|
+
KekikStream/Extractors/Odnoklassniki.py,sha256=0NJQT3bkZQwHzAwksTCgUA6vkUJwl5F_fSNx8V_KFPs,3618
|
29
29
|
KekikStream/Extractors/OkRuHTTP.py,sha256=L-B0i_i_Vnm61GvUfd6cGIW-o_H4M-C7DO_cdw2rQPU,228
|
30
30
|
KekikStream/Extractors/OkRuSSL.py,sha256=FHJ5XZ1dO5ED3mIku3e3vnq8K0slrcr0jqhaUnHmfVk,227
|
31
|
-
KekikStream/Extractors/PeaceMakerst.py,sha256=
|
31
|
+
KekikStream/Extractors/PeaceMakerst.py,sha256=NYrVJrh32iu1T5Lnv1cjpUdzFcPgxfgSt7JM4ZoejnE,2124
|
32
32
|
KekikStream/Extractors/Pichive.py,sha256=BSVYFwL3Ax6yGoS1WkpOWtngxNyuZLoKzpPwjibpu2s,221
|
33
|
-
KekikStream/Extractors/PixelDrain.py,sha256=
|
33
|
+
KekikStream/Extractors/PixelDrain.py,sha256=bIhFu8jqXqpFv0XYiJ9MlfOMQehDCRRMV50dbM4B5Wo,1019
|
34
34
|
KekikStream/Extractors/PlayRu.py,sha256=DQMZyCSJwLkrh-gfDD8T1DvUFNBAKUXpByeCAWuK6YY,215
|
35
|
-
KekikStream/Extractors/RapidVid.py,sha256=
|
36
|
-
KekikStream/Extractors/SibNet.py,sha256=
|
37
|
-
KekikStream/Extractors/Sobreatsesuyp.py,sha256=
|
38
|
-
KekikStream/Extractors/TRsTX.py,sha256=
|
39
|
-
KekikStream/Extractors/TauVideo.py,sha256=
|
40
|
-
KekikStream/Extractors/TurboImgz.py,sha256=
|
41
|
-
KekikStream/Extractors/VidMoly.py,sha256=
|
35
|
+
KekikStream/Extractors/RapidVid.py,sha256=tlHwk-UE5RXT2Yzm3V7o6coMik66XKcgcbyYPZsWqyY,2395
|
36
|
+
KekikStream/Extractors/SibNet.py,sha256=Qx8mtQVbRH6Chg-Bhs_nhd_idxddtrNtsu3Wl4bci60,904
|
37
|
+
KekikStream/Extractors/Sobreatsesuyp.py,sha256=JY3TjuKi95fNenKXustqmYa_9jFoW8Vo6OOMQfFhXEw,2036
|
38
|
+
KekikStream/Extractors/TRsTX.py,sha256=ui7EPM9S9z2nhNsy1S7KORSOsgaCpqP0tuGl1xN5f9E,2188
|
39
|
+
KekikStream/Extractors/TauVideo.py,sha256=9qF9N1a7bYkCAjMbUpso1JPw0m28Gq_gNSchpwgyUcU,1148
|
40
|
+
KekikStream/Extractors/TurboImgz.py,sha256=KYAtCQ33egsR1x6t08UFyF9ps6loCrRV5WZBFR5U-YA,856
|
41
|
+
KekikStream/Extractors/VidMoly.py,sha256=2bg7pUp0IVn2VpaOVdf2xHgjoPbIIUgUEiw2V3kEOdU,3554
|
42
42
|
KekikStream/Extractors/VidMolyMe.py,sha256=ogLiFUJVqFbhtzQrZ1gSB9me85DiHvntjWtSvidYVS8,218
|
43
|
-
KekikStream/Extractors/VidMoxy.py,sha256=
|
44
|
-
KekikStream/Extractors/VideoSeyred.py,sha256=
|
45
|
-
KekikStream/Helpers/Unpack.py,sha256=iS-r6k-NHlBleWsVwv_QXLaEMbJRBUXDKqVE6NkWEIk,2235
|
43
|
+
KekikStream/Extractors/VidMoxy.py,sha256=Ii1CQNkUk7lDV0tCLkJf1Bu_jLan30AGNrsAQlNmP4c,1826
|
44
|
+
KekikStream/Extractors/VideoSeyred.py,sha256=HHzS8Ew1yJgWmyzi64dJkPD5bGP6Ku00EoSdZ7ncgaA,2009
|
46
45
|
KekikStream/Plugins/DiziBox.py,sha256=Vk7ujbMTORimFNXA7BTZkQnXs-6WBfI7iIJxFYRJaH0,9326
|
47
|
-
KekikStream/Plugins/DiziYou.py,sha256=
|
46
|
+
KekikStream/Plugins/DiziYou.py,sha256=YmuCvbee-xh6Eu_KFTMYrESS6cnTEBcND9vItFmBS7M,8069
|
48
47
|
KekikStream/Plugins/Dizilla.py,sha256=E3HehhcnZBDVJzroRa7jlFzj3ixdx9-LT7YnWKmcX3Q,6899
|
49
48
|
KekikStream/Plugins/FilmMakinesi.py,sha256=J4v35Ln3RehWPai3I-9nWrasRLx3hN3IgrWVpt5b_HE,5712
|
50
49
|
KekikStream/Plugins/FullHDFilmizlesene.py,sha256=AO9Il0PE77JUvg1AN4Vxl95pTrCBbOjclqFGWuzo7cY,6271
|
51
|
-
KekikStream/Plugins/HDFilmCehennemi.py,sha256=
|
50
|
+
KekikStream/Plugins/HDFilmCehennemi.py,sha256=2A-qqgsohm4uWBsxCl8TI4CNWaL7RNjRP8ehGZp-SIk,10032
|
52
51
|
KekikStream/Plugins/JetFilmizle.py,sha256=P6m8PfsG1PRRMQb1wmCGb9j4-N53xITq9JmKvwwny0I,5586
|
53
|
-
KekikStream/Plugins/RecTV.py,sha256=
|
52
|
+
KekikStream/Plugins/RecTV.py,sha256=8wUh-vGOCg-kWHrQjOp9nJV9hRPHHLq0PmM_lMoD4NM,7394
|
54
53
|
KekikStream/Plugins/SezonlukDizi.py,sha256=IvmOB6qCEHBy41BS4KFBjsTegmzEF6l-2l_CvamYrW8,6099
|
55
|
-
KekikStream/Plugins/Shorten.py,sha256=
|
56
|
-
KekikStream/Plugins/SineWix.py,sha256=
|
54
|
+
KekikStream/Plugins/Shorten.py,sha256=xh15NEJRNR982zy7SHzvTbs9Ml4niTh2psAAN3X6dcY,9006
|
55
|
+
KekikStream/Plugins/SineWix.py,sha256=RhV4C5e3QCkT8CkCOSMNwP84dFpbTnP7LnC_67pfgQo,7336
|
57
56
|
KekikStream/Plugins/UgurFilm.py,sha256=tChGgiAeQeVUqHqrVXDz_eMIyghOHqKuHJb0pCQqs1M,4724
|
58
|
-
kekikstream-1.
|
59
|
-
kekikstream-1.
|
60
|
-
kekikstream-1.
|
61
|
-
kekikstream-1.
|
62
|
-
kekikstream-1.
|
63
|
-
kekikstream-1.
|
57
|
+
kekikstream-1.5.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
58
|
+
kekikstream-1.5.0.dist-info/METADATA,sha256=CMQMfbELk1jd_uzn5s_wDSMTLg5B1Q85Xq9h6D1vQGc,4973
|
59
|
+
kekikstream-1.5.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
60
|
+
kekikstream-1.5.0.dist-info/entry_points.txt,sha256=dFwdiTx8djyehI0Gsz-rZwjAfZzUzoBSrmzRu9ubjJc,50
|
61
|
+
kekikstream-1.5.0.dist-info/top_level.txt,sha256=DNmGJDXl27Drdfobrak8KYLmocW_uznVYFJOzcjUgmY,12
|
62
|
+
kekikstream-1.5.0.dist-info/RECORD,,
|
KekikStream/Helpers/Unpack.py
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
# ! https://github.com/keyiflerolsun/Kekik-cloudstream/blob/master/FilmMakinesi/src/main/kotlin/com/keyiflerolsun/CloseLoadUnpacker.kt
|
2
|
-
|
3
|
-
import re
|
4
|
-
|
5
|
-
packed_extract_regex = re.compile(
|
6
|
-
r"\}\('(.*)',\s*(\d+),\s*(\d+),\s*'(.*?)'\.split\('\|'\)",
|
7
|
-
re.IGNORECASE | re.MULTILINE
|
8
|
-
)
|
9
|
-
|
10
|
-
unpack_replace_regex = re.compile(
|
11
|
-
r"\b\w+\b",
|
12
|
-
re.IGNORECASE | re.MULTILINE
|
13
|
-
)
|
14
|
-
|
15
|
-
class Unbaser:
|
16
|
-
ALPHABET = {
|
17
|
-
52: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP",
|
18
|
-
54: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR",
|
19
|
-
62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
20
|
-
95: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
|
21
|
-
}
|
22
|
-
|
23
|
-
def __init__(self, base: int):
|
24
|
-
self.base = base
|
25
|
-
|
26
|
-
if base > 62:
|
27
|
-
self.selector = 95
|
28
|
-
elif base > 54:
|
29
|
-
self.selector = 62
|
30
|
-
elif base > 52:
|
31
|
-
self.selector = 54
|
32
|
-
else:
|
33
|
-
self.selector = 52
|
34
|
-
|
35
|
-
self.dict = {char: idx for idx, char in enumerate(Unbaser.ALPHABET[self.selector])}
|
36
|
-
|
37
|
-
def unbase(self, value: str) -> int:
|
38
|
-
if 2 <= self.base <= 36:
|
39
|
-
try:
|
40
|
-
return int(value, self.base)
|
41
|
-
except ValueError:
|
42
|
-
return 0
|
43
|
-
else:
|
44
|
-
result = 0
|
45
|
-
|
46
|
-
for index, c in enumerate(reversed(value)):
|
47
|
-
digit = self.dict.get(c, 0)
|
48
|
-
result += digit * (self.base ** index)
|
49
|
-
|
50
|
-
return result
|
51
|
-
|
52
|
-
def unpack(script_block: str) -> str:
|
53
|
-
match = packed_extract_regex.search(script_block)
|
54
|
-
if not match:
|
55
|
-
raise ValueError("Packed script not found")
|
56
|
-
|
57
|
-
payload, radix_str, count_str, symtab_str = match.groups()
|
58
|
-
|
59
|
-
radix = int(radix_str)
|
60
|
-
count = int(count_str)
|
61
|
-
symtab = symtab_str.split('|')
|
62
|
-
|
63
|
-
if len(symtab) != count:
|
64
|
-
raise ValueError("there is an error in the packed script")
|
65
|
-
|
66
|
-
unbaser = Unbaser(radix)
|
67
|
-
|
68
|
-
def replacer(match_obj):
|
69
|
-
word = match_obj.group(0)
|
70
|
-
index = unbaser.unbase(word)
|
71
|
-
replacement = symtab[index] if index < len(symtab) else word
|
72
|
-
|
73
|
-
return replacement or word
|
74
|
-
|
75
|
-
return unpack_replace_regex.sub(replacer, payload)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|