Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Renping11
dr_py
提交
781c61e6
dr_py
项目概览
Renping11
/
dr_py
与 Fork 源项目一致
Fork自
晚风拂柳颜 / dr_py
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
dr_py
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
781c61e6
编写于
11月 25, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了新的解析
上级
420de7a0
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
270 addition
and
10 deletion
+270
-10
controllers/cms.py
controllers/cms.py
+3
-3
controllers/home.py
controllers/home.py
+2
-2
jiexi/周星驰.js
jiexi/周星驰.js
+77
-0
libs/atob.js
libs/atob.js
+140
-0
py/php自建解析.py
py/php自建解析.py
+1
-1
readme.md
readme.md
+1
-0
utils/encode.py
utils/encode.py
+43
-1
utils/pyctx.py
utils/pyctx.py
+3
-3
未找到文件。
controllers/cms.py
浏览文件 @
781c61e6
...
...
@@ -14,7 +14,7 @@ from utils.web import *
from
utils.system
import
getHost
from
utils.config
import
playerConfig
from
utils.log
import
logger
from
utils.encode
import
base64Encode
,
baseDecode
,
fetch
,
post
,
request
,
getCryptoJS
,
getPreJs
,
buildUrl
,
getHome
from
utils.encode
import
base64Encode
,
base
64
Decode
,
fetch
,
post
,
request
,
getCryptoJS
,
getPreJs
,
buildUrl
,
getHome
from
utils.encode
import
verifyCode
,
setDetail
,
join
,
urljoin2
,
parseText
,
requireCache
from
utils.encode
import
md5
as
mmd5
from
utils.safePython
import
safePython
...
...
@@ -74,7 +74,7 @@ def md5(text):
return
mmd5
(
text
)
py_ctx
=
{
'requests'
:
requests
,
'print'
:
print
,
'base64Encode'
:
base64Encode
,
'base
Decode'
:
base
Decode
,
'requests'
:
requests
,
'print'
:
print
,
'base64Encode'
:
base64Encode
,
'base
64Decode'
:
base64
Decode
,
'log'
:
logger
.
info
,
'fetch'
:
fetch
,
'post'
:
post
,
'request'
:
request
,
'getCryptoJS'
:
getCryptoJS
,
'buildUrl'
:
buildUrl
,
'getHome'
:
getHome
,
'setDetail'
:
setDetail
,
'join'
:
join
,
'urljoin2'
:
urljoin2
,
'PC_UA'
:
PC_UA
,
'MOBILE_UA'
:
MOBILE_UA
,
'UC_UA'
:
UC_UA
,
'UA'
:
UA
,
'IOS_UA'
:
IOS_UA
,
...
...
@@ -1351,7 +1351,7 @@ class CMS:
# print(play_url)
if
play_url
.
find
(
'http'
)
==
-
1
:
# 字符串看起来被编码的
try
:
play_url
=
baseDecode
(
play_url
)
# 自动base64解码
play_url
=
base
64
Decode
(
play_url
)
# 自动base64解码
except
:
pass
# print(unquote(play_url))
...
...
controllers/home.py
浏览文件 @
781c61e6
...
...
@@ -14,7 +14,7 @@ from controllers.classes import getClasses,getClassInfo
from
utils.files
import
getPics
,
custom_merge
,
getAlist
,
get_live_url
,
get_multi_rules
,
getCustonDict
from
js.rules
import
getRules
,
getPys
from
utils.encode
import
parseText
,
base64Encode
,
baseDecode
from
utils.encode
import
parseText
,
base64Encode
,
base
64
Decode
from
base.R
import
R
from
utils.system
import
getHost
,
is_linux
from
utils.cfg
import
cfg
...
...
@@ -168,7 +168,7 @@ def get_lives():
live_text
=
f
.
read
()
if
len
(
live_text
)
>
100
and
live_text
.
find
(
'http'
)
<
0
:
try
:
live_text
=
baseDecode
(
live_text
)
live_text
=
base
64
Decode
(
live_text
)
logger
.
info
(
f
'
{
path
}
base64解码完毕'
)
except
:
pass
...
...
jiexi/周星驰.js
0 → 100644
浏览文件 @
781c61e6
// 星驰免嗅
// let jxUrl = 'https://vip.swuii.top/player/?url=';
let
jxUrl
=
'
https://vip.swuii.top/player/analysis.php?v=
'
;
fetch_params
.
headers
.
Referer
=
jxUrl
;
try
{
let
html
=
request
(
jxUrl
+
vipUrl
);
eval
(
html
.
match
(
/var config = {
[\s\S]
*
?
}/
)[
0
]);
url
=
config
.
url
;
_0x4909f4
=
url
;
let
_0xc6d095
=
''
;
log
(
url
);
eval
(
getCryptoJS
());
var
_0x4909f4
=
atob
(
_0x4909f4
);
log
(
_0x4909f4
);
// log(_0x4909f4.length);
var
_0x3e9518
=
_0x4909f4
.
length
;
// log(_0x4909f4);
var
_0x2c3abf
=
[];
var
_0x1c7cc5
=
[];
var
_0xfc0e29
=
"
202205051426239465
"
;
var
_0x1a1b75
=
_0xfc0e29
.
length
;
var
_0x320253
=
{
"
EmMtr
"
:
function
(
_0xcb360
,
_0x190522
)
{
return
_0xcb360
<
_0x190522
;
},
"
INrFk
"
:
function
(
_0x118889
,
_0x267e98
)
{
return
_0x118889
%
_0x267e98
;
},
"
YJmqv
"
:
function
(
_0x31bf52
,
_0x2fd6b6
)
{
return
_0x31bf52
%
_0x2fd6b6
;
},
"
IVJrP
"
:
function
(
_0x43c04f
,
_0x1fa873
)
{
return
_0x43c04f
%
_0x1fa873
;
},
"
aTggn
"
:
function
(
_0x13bd41
,
_0x2f040c
)
{
return
_0x13bd41
+
_0x2f040c
;
},
"
txtvd
"
:
function
(
_0x450d4d
,
_0x107d6d
)
{
return
_0x450d4d
%
_0x107d6d
;
},
"
EpjZa
"
:
function
(
_0x54d0f7
,
_0x37f36f
)
{
return
_0x54d0f7
^
_0x37f36f
;
},
"
WgDgB
"
:
function
(
_0x166316
,
_0x170b36
)
{
return
_0x166316
<
_0x170b36
;
},
"
vwjta
"
:
function
(
_0x13d5f4
,
_0x4d75ba
)
{
return
_0x13d5f4
+
_0x4d75ba
;
}};
for
(
i
=
0
;
_0x320253
[
"
EmMtr
"
](
i
,
256
);
i
++
)
{
_0x2c3abf
[
i
]
=
_0xfc0e29
[
_0x320253
[
"
YJmqv
"
](
i
,
_0x1a1b75
)][
"
charCodeAt
"
]();
_0x1c7cc5
[
i
]
=
i
;
}
// log(_0x1c7cc5);
for
(
j
=
i
=
0
;
_0x320253
[
"
EmMtr
"
](
i
,
256
);
i
++
)
{
j
=
_0x320253
[
"
INrFk
"
](
_0x320253
[
"
vwjta
"
](
j
,
_0x1c7cc5
[
i
])
+
_0x2c3abf
[
i
],
256
);
tmp
=
_0x1c7cc5
[
i
];
_0x1c7cc5
[
i
]
=
_0x1c7cc5
[
j
];
_0x1c7cc5
[
j
]
=
tmp
;
}
// log(_0x2c3abf);
// log(_0x1c7cc5);
for
(
a
=
j
=
i
=
0
;
_0x320253
[
"
WgDgB
"
](
i
,
_0x3e9518
);
i
++
)
{
a
=
_0x320253
[
"
IVJrP
"
](
a
+
1
,
256
);
j
=
_0x320253
[
"
aTggn
"
](
j
,
_0x1c7cc5
[
a
])
%
256
;
tmp
=
_0x1c7cc5
[
a
];
_0x1c7cc5
[
a
]
=
_0x1c7cc5
[
j
];
_0x1c7cc5
[
j
]
=
tmp
;
k
=
_0x1c7cc5
[
_0x320253
[
"
txtvd
"
](
_0x320253
[
"
aTggn
"
](
_0x1c7cc5
[
a
],
_0x1c7cc5
[
j
]),
256
)];
_0xc6d095
+=
String
[
"
fromCharCode
"
](
_0x320253
[
"
EpjZa
"
](
_0x4909f4
[
i
][
"
charCodeAt
"
](),
k
));
// log(_0x4909f4[i]);
}
// log(_0x1c7cc5);
log
(
_0xc6d095
);
url
=
unescape
(
_0xc6d095
);
if
(
/m3u8|mp4/
.
test
(
url
))
{
realUrl
=
url
;
}
else
{
realUrl
=
toast
(
vipUrl
+
'
解析失败:
'
+
url
);
}
log
(
'
解析到真实播放地址:
'
+
realUrl
);
}
catch
(
e
)
{
log
(
'
解析发生错误:
'
+
e
.
message
);
realUrl
=
vipUrl
;
}
\ No newline at end of file
libs/atob.js
0 → 100644
浏览文件 @
781c61e6
!
function
(
e
)
{
var
base64EncodeChars
=
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
"
;
var
base64DecodeChars
=
new
Array
(
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
62
,
-
1
,
-
1
,
-
1
,
63
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
);
function
base64encode
(
str
)
{
var
out
,
i
,
len
;
var
c1
,
c2
,
c3
;
len
=
str
.
length
;
i
=
0
;
out
=
""
;
while
(
i
<
len
)
{
c1
=
str
.
charCodeAt
(
i
++
)
&
0xff
;
if
(
i
==
len
)
{
out
+=
base64EncodeChars
.
charAt
(
c1
>>
2
);
out
+=
base64EncodeChars
.
charAt
((
c1
&
0x3
)
<<
4
);
out
+=
"
==
"
;
break
;
}
c2
=
str
.
charCodeAt
(
i
++
);
if
(
i
==
len
)
{
out
+=
base64EncodeChars
.
charAt
(
c1
>>
2
);
out
+=
base64EncodeChars
.
charAt
(((
c1
&
0x3
)
<<
4
)
|
((
c2
&
0xF0
)
>>
4
));
out
+=
base64EncodeChars
.
charAt
((
c2
&
0xF
)
<<
2
);
out
+=
"
=
"
;
break
;
}
c3
=
str
.
charCodeAt
(
i
++
);
out
+=
base64EncodeChars
.
charAt
(
c1
>>
2
);
out
+=
base64EncodeChars
.
charAt
(((
c1
&
0x3
)
<<
4
)
|
((
c2
&
0xF0
)
>>
4
));
out
+=
base64EncodeChars
.
charAt
(((
c2
&
0xF
)
<<
2
)
|
((
c3
&
0xC0
)
>>
6
));
out
+=
base64EncodeChars
.
charAt
(
c3
&
0x3F
);
}
return
out
;
}
function
base64decode
(
str
)
{
var
c1
,
c2
,
c3
,
c4
;
var
i
,
len
,
out
;
len
=
str
.
length
;
i
=
0
;
out
=
""
;
while
(
i
<
len
)
{
do
{
c1
=
base64DecodeChars
[
str
.
charCodeAt
(
i
++
)
&
0xff
];
}
while
(
i
<
len
&&
c1
==
-
1
);
if
(
c1
==
-
1
)
break
;
do
{
c2
=
base64DecodeChars
[
str
.
charCodeAt
(
i
++
)
&
0xff
];
}
while
(
i
<
len
&&
c2
==
-
1
);
if
(
c2
==
-
1
)
break
;
out
+=
String
.
fromCharCode
((
c1
<<
2
)
|
((
c2
&
0x30
)
>>
4
));
do
{
c3
=
str
.
charCodeAt
(
i
++
)
&
0xff
;
if
(
c3
==
61
)
return
out
;
c3
=
base64DecodeChars
[
c3
];
}
while
(
i
<
len
&&
c3
==
-
1
);
if
(
c3
==
-
1
)
break
;
out
+=
String
.
fromCharCode
(((
c2
&
0XF
)
<<
4
)
|
((
c3
&
0x3C
)
>>
2
));
do
{
c4
=
str
.
charCodeAt
(
i
++
)
&
0xff
;
if
(
c4
==
61
)
return
out
;
c4
=
base64DecodeChars
[
c4
];
}
while
(
i
<
len
&&
c4
==
-
1
);
if
(
c4
==
-
1
)
break
;
out
+=
String
.
fromCharCode
(((
c3
&
0x03
)
<<
6
)
|
c4
);
}
return
out
;
}
function
utf16to8
(
str
)
{
var
out
,
i
,
len
,
c
;
out
=
""
;
len
=
str
.
length
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
c
=
str
.
charCodeAt
(
i
);
if
((
c
>=
0x0001
)
&&
(
c
<=
0x007F
))
{
out
+=
str
.
charAt
(
i
);
}
else
if
(
c
>
0x07FF
)
{
out
+=
String
.
fromCharCode
(
0xE0
|
((
c
>>
12
)
&
0x0F
));
out
+=
String
.
fromCharCode
(
0x80
|
((
c
>>
6
)
&
0x3F
));
out
+=
String
.
fromCharCode
(
0x80
|
((
c
>>
0
)
&
0x3F
));
}
else
{
out
+=
String
.
fromCharCode
(
0xC0
|
((
c
>>
6
)
&
0x1F
));
out
+=
String
.
fromCharCode
(
0x80
|
((
c
>>
0
)
&
0x3F
));
}
}
return
out
;
}
function
utf8to16
(
str
)
{
var
out
,
i
,
len
,
c
;
var
char2
,
char3
;
out
=
""
;
len
=
str
.
length
;
i
=
0
;
while
(
i
<
len
)
{
c
=
str
.
charCodeAt
(
i
++
);
switch
(
c
>>
4
)
{
case
0
:
case
1
:
case
2
:
case
3
:
case
4
:
case
5
:
case
6
:
case
7
:
out
+=
str
.
charAt
(
i
-
1
);
break
;
case
12
:
case
13
:
char2
=
str
.
charCodeAt
(
i
++
);
out
+=
String
.
fromCharCode
(((
c
&
0x1F
)
<<
6
)
|
(
char2
&
0x3F
));
break
;
case
14
:
char2
=
str
.
charCodeAt
(
i
++
);
char3
=
str
.
charCodeAt
(
i
++
);
out
+=
String
.
fromCharCode
(((
c
&
0x0F
)
<<
12
)
|
((
char2
&
0x3F
)
<<
6
)
|
((
char3
&
0x3F
)
<<
0
));
break
;
}
}
return
out
;
}
function
CharToHex
(
str
)
{
var
out
,
i
,
len
,
c
,
h
;
out
=
""
;
len
=
str
.
length
;
i
=
0
;
while
(
i
<
len
)
{
c
=
str
.
charCodeAt
(
i
++
);
h
=
c
.
toString
(
16
);
if
(
h
.
length
<
2
)
h
=
"
0
"
+
h
;
out
+=
"
\\
x
"
+
h
+
"
"
;
if
(
i
>
0
&&
i
%
8
==
0
)
out
+=
"
\r\n
"
;
}
return
out
;
}
this
.
atob
=
base64decode
,
this
.
btoa
=
base64encode
;
}(
this
);
py/php自建解析.py
浏览文件 @
781c61e6
...
...
@@ -14,7 +14,7 @@ def gzinflate(compressed: bytes) -> bytes:
def
base64Encode
(
text
):
return
base64
.
b64encode
(
text
.
encode
(
"utf8"
)).
decode
(
"utf-8"
)
#base64编码
def
baseDecode
(
text
:
str
):
def
base
64
Decode
(
text
:
str
):
return
base64
.
b64decode
(
text
).
decode
(
"utf-8"
)
#base64解码
def
un_encode
(
a
:
str
):
...
...
readme.md
浏览文件 @
781c61e6
...
...
@@ -51,6 +51,7 @@
[
获取本地设备信息
](
https://m.jb51.net/article/140716.htm
)
###### 2022/11/25
-
[X] 优化腾云驾雾源,方便追剧
-
[X] 增加新解析
###### 2022/11/24
-
[X] 优化alist的历史记录和收藏
-
[X] 设置中心环境变量增加前端的保存校验
...
...
utils/encode.py
浏览文件 @
781c61e6
...
...
@@ -20,6 +20,7 @@ import os
from
utils.web
import
UC_UA
,
PC_UA
from
ast
import
literal_eval
from
utils.log
import
logger
import
quickjs
def
getPreJs
():
base_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)))
# 上级目
...
...
@@ -42,6 +43,44 @@ def getCryptoJS():
def
md5
(
str
):
return
hashlib
.
md5
(
str
.
encode
(
encoding
=
'UTF-8'
)).
hexdigest
()
def
getLib
(
js
):
base_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)))
# 上级目录
lib_path
=
os
.
path
.
join
(
base_path
,
f
'libs/
{
js
}
'
)
if
not
os
.
path
.
exists
(
lib_path
):
return
''
with
open
(
lib_path
,
encoding
=
'utf-8'
)
as
f
:
return
f
.
read
()
# def atob(text):
# if isinstance(text,PyJsString):
# text = parseText(str(text))
# qjs = quickjs.Context()
# print(text)
# js = getLib('atob.js')
# print(js)
# ret = qjs.eval(f'{js};atob("{text}")')
# print(ret)
def
atob
(
text
):
"""
解码
:param text:
:return:
"""
if
isinstance
(
text
,
PyJsString
):
text
=
parseText
(
str
(
text
))
return
base64
.
b64decode
(
text
.
encode
(
"utf8"
)).
decode
(
"latin1"
)
def
btoa
(
text
):
"""
编码
:param text:
:return:
"""
if
isinstance
(
text
,
PyJsString
):
text
=
parseText
(
str
(
text
))
return
base64
.
b64encode
(
text
.
encode
(
"latin1"
)).
decode
(
"utf8"
)
def
requireCache
(
lib
:
str
):
base_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)))
# 上级目
os
.
makedirs
(
os
.
path
.
join
(
base_path
,
f
'libs'
),
exist_ok
=
True
)
...
...
@@ -129,7 +168,10 @@ def base64Encode(text):
text
=
str
(
text
).
replace
(
"'"
,
""
).
replace
(
'"'
,
''
)
return
base64
.
b64encode
(
text
.
encode
(
"utf8"
)).
decode
(
"utf-8"
)
#base64编码
def
baseDecode
(
text
):
def
base64Decode
(
text
):
if
isinstance
(
text
,
PyJsString
):
text
=
parseText
(
str
(
text
))
# print(text)
return
base64
.
b64decode
(
text
).
decode
(
"utf-8"
)
#base64解码
def
parseText
(
text
:
str
):
...
...
utils/pyctx.py
浏览文件 @
781c61e6
...
...
@@ -9,7 +9,7 @@ import json
import
requests
from
utils.web
import
*
from
utils.log
import
logger
from
utils.encode
import
base64Encode
,
base
Decode
,
fetch
,
post
,
request
,
getCryptoJS
,
getPreJs
,
buildUrl
,
getHome
,
parseText
from
utils.encode
import
base64Encode
,
base
64Decode
,
fetch
,
post
,
request
,
getCryptoJS
,
getPreJs
,
buildUrl
,
getHome
,
parseText
,
atob
from
utils.encode
import
setDetail
,
join
,
urljoin2
,
parseText
,
requireCache
from
utils.encode
import
md5
as
mmd5
from
utils.parser
import
runPy
,
runJScode
,
JsObjectWrapper
,
PyJsObject
,
PyJsString
...
...
@@ -65,10 +65,10 @@ def md5(text):
return
mmd5
(
text
)
py_ctx
=
{
'requests'
:
requests
,
'print'
:
print
,
'base64Encode'
:
base64Encode
,
'base
Decode'
:
base
Decode
,
'requests'
:
requests
,
'print'
:
print
,
'base64Encode'
:
base64Encode
,
'base
64Decode'
:
base64
Decode
,
'log'
:
logger
.
info
,
'fetch'
:
fetch
,
'post'
:
post
,
'request'
:
request
,
'getCryptoJS'
:
getCryptoJS
,
'buildUrl'
:
buildUrl
,
'getHome'
:
getHome
,
'setDetail'
:
setDetail
,
'join'
:
join
,
'urljoin2'
:
urljoin2
,
'PC_UA'
:
PC_UA
,
'MOBILE_UA'
:
MOBILE_UA
,
'UC_UA'
:
UC_UA
,
'IOS_UA'
:
IOS_UA
,
'setItem'
:
setItem
,
'getItem'
:
getItem
,
'clearItem'
:
clearItem
,
'stringify'
:
stringify
,
'encodeUrl'
:
encodeUrl
,
'requireObj'
:
requireObj
,
'md5'
:
md5
'requireObj'
:
requireObj
,
'md5'
:
md5
,
'atob'
:
atob
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录