Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夏至溪檐
dr_py
提交
e2736dc4
dr_py
项目概览
夏至溪檐
/
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,发现更多精彩内容 >>
提交
e2736dc4
编写于
11月 26, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了搜索支持post
上级
94543b8d
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
144 addition
and
42 deletion
+144
-42
base/rules.db
base/rules.db
+0
-0
controllers/cms.py
controllers/cms.py
+40
-8
js/version.txt
js/version.txt
+1
-1
js/乐猪TV.js
js/乐猪TV.js
+4
-2
js/奇优影院.js
js/奇优影院.js
+2
-1
libs/drpy.js
libs/drpy.js
+46
-14
libs/drpy.min.js
libs/drpy.min.js
+1
-1
libs/drpy2.js
libs/drpy2.js
+46
-14
libs/drpy2.min.js
libs/drpy2.min.js
+1
-1
readme.md
readme.md
+3
-0
未找到文件。
base/rules.db
浏览文件 @
e2736dc4
无法预览此类型文件
controllers/cms.py
浏览文件 @
e2736dc4
...
...
@@ -1221,8 +1221,11 @@ class CMS:
is_js
=
isinstance
(
p
,
str
)
and
str
(
p
).
startswith
(
'js:'
)
# 是js
def
getPP
(
p
,
pn
,
pp
,
ppn
):
ps
=
pp
[
ppn
]
if
p
[
pn
]
==
'*'
and
len
(
pp
)
>
ppn
else
p
[
pn
]
return
ps
try
:
ps
=
pp
[
ppn
]
if
p
[
pn
]
==
'*'
and
len
(
pp
)
>
ppn
else
p
[
pn
]
return
ps
except
:
return
''
if
is_js
:
headers
[
'Referer'
]
=
getHome
(
url
)
py_ctx
.
update
({
...
...
@@ -1260,7 +1263,35 @@ class CMS:
pd
=
jsp
.
pj
if
is_json
else
jsp
.
pd
pq
=
jsp
.
pq
try
:
r
=
requests
.
get
(
url
,
headers
=
self
.
headers
,
timeout
=
self
.
timeout
,
verify
=
False
)
req_method
=
url
.
split
(
';'
)[
1
].
lower
()
if
len
(
url
.
split
(
';'
))
>
1
else
'get'
if
req_method
==
'post'
:
rurls
=
url
.
split
(
';'
)[
0
].
split
(
'#'
)
rurl
=
rurls
[
0
]
params
=
rurls
[
1
]
if
len
(
rurls
)
>
1
else
''
# params = quote(params)
print
(
f
'rurl:
{
rurl
}
,params:
{
params
}
'
)
new_dict
=
{}
new_tmp
=
params
.
split
(
'&'
)
# print(new_tmp)
for
i
in
new_tmp
:
new_dict
[
i
.
split
(
'='
)[
0
]]
=
i
.
split
(
'='
)[
1
]
# data = ujson.dumps(new_dict)
data
=
new_dict
# print(data)
r
=
requests
.
post
(
rurl
,
headers
=
self
.
headers
,
data
=
data
,
timeout
=
self
.
timeout
,
verify
=
False
)
elif
req_method
==
'postjson'
:
rurls
=
url
.
split
(
';'
)[
0
].
split
(
'#'
)
rurl
=
rurls
[
0
]
params
=
rurls
[
1
]
if
len
(
rurls
)
>
1
else
'{}'
headers_cp
=
self
.
headers
.
copy
()
headers_cp
.
update
({
'Content-Type'
:
'application/json'
})
try
:
params
=
ujson
.
dumps
(
params
)
except
:
params
=
'{}'
r
=
requests
.
post
(
rurl
,
headers
=
headers_cp
,
data
=
params
,
timeout
=
self
.
timeout
,
verify
=
False
)
else
:
r
=
requests
.
get
(
url
,
headers
=
self
.
headers
,
timeout
=
self
.
timeout
,
verify
=
False
)
html
=
self
.
checkHtml
(
r
)
if
is_json
:
html
=
self
.
dealJson
(
html
)
...
...
@@ -1287,29 +1318,30 @@ class CMS:
items
=
pdfa
(
html
,
p0
.
replace
(
'json:'
,
''
,
1
))
# print(len(items),items)
videos
=
[]
p1
=
getPP
(
p
,
1
,
pp
,
1
)
p2
=
getPP
(
p
,
2
,
pp
,
2
)
p3
=
getPP
(
p
,
3
,
pp
,
3
)
p4
=
getPP
(
p
,
4
,
pp
,
4
)
p5
=
getPP
(
p
,
5
,
pp
,
5
)
for
item
in
items
:
# print(item)
try
:
# title = pdfh(item, p[1])
p1
=
getPP
(
p
,
1
,
pp
,
1
)
title
=
''
.
join
([
pdfh
(
item
,
i
)
for
i
in
p1
.
split
(
'||'
)])
try
:
p2
=
getPP
(
p
,
2
,
pp
,
2
)
img
=
pd
(
item
,
p2
)
except
:
img
=
''
try
:
p3
=
getPP
(
p
,
3
,
pp
,
3
)
desc
=
pdfh
(
item
,
p3
)
except
:
desc
=
''
if
len
(
p
)
>
5
and
p
[
5
]:
p5
=
getPP
(
p
,
5
,
pp
,
5
)
content
=
pdfh
(
item
,
p5
)
else
:
content
=
''
# link = '$'.join([pd(item, p4) for p4 in p[4].split('+')])
p4
=
getPP
(
p
,
4
,
pp
,
4
)
links
=
[
pd
(
item
,
_p4
)
if
not
self
.
detailUrl
else
pdfh
(
item
,
_p4
)
for
_p4
in
p4
.
split
(
'+'
)]
link
=
'$'
.
join
(
links
)
# print(content)
...
...
js/version.txt
浏览文件 @
e2736dc4
3.9.24beta7
\ No newline at end of file
3.9.25
\ No newline at end of file
js/乐猪TV.js
浏览文件 @
e2736dc4
...
...
@@ -3,11 +3,13 @@ var rule = {
host
:
'
http://www.lezhutv.com
'
,
// homeUrl:'/',
url
:
'
/type/fyclass-fypage.html
'
,
searchUrl
:
'
/search-pg-fypage-wd-**.html
'
,
// searchUrl:'/search-pg-fypage-wd-**.html',
searchUrl
:
'
/index.php?m=vod-search#wd=**&search=;post
'
,
searchable
:
2
,
quickSearch
:
0
,
headers
:{
'
User-Agent
'
:
'
UC_UA
'
// 'User-Agent':'UC_UA'
'
User-Agent
'
:
'
MOBILE_UA
'
},
timeout
:
5000
,
class_parse
:
'
div.nav a;a&&Text;a&&href;/(
\\
d.+).html
'
,
...
...
js/奇优影院.js
浏览文件 @
e2736dc4
...
...
@@ -9,6 +9,6 @@ var rule = Object.assign(muban.首图2,{
// host:'https://www.gdjilong.com/',
url
:
'
/list/fyclass_fypage.html
'
,
searchUrl
:
'
/search.php;**
'
,
搜索
:
'
js:let url=input.split(";")[0];let d=[];let body={searchword:input.split(";")[1]};fetch_params.body=body;let html=post(url,fetch_params);let pdfa=jsp.pdfa;let pdfh=jsp.pdfh;let pd=jsp.pd;let lists=pdfa(html,"ul.stui-vodlist__media&&li");lists.forEach(function(it){d.push({title:pdfh(it,".title&&Text"),url:pd(it,"a&&href"),desc:pdfh(html,".pic-text&&Text"),pic_url:pd(html,".lazyload&&data-original")})});setResult(d);
'
,
搜索
:
'
js:let url=input.split(";")[0];let d=[];let body={searchword:input.split(";")[1]};
body="searchword="+input.split(";")[1];
fetch_params.body=body;let html=post(url,fetch_params);let pdfa=jsp.pdfa;let pdfh=jsp.pdfh;let pd=jsp.pd;let lists=pdfa(html,"ul.stui-vodlist__media&&li");lists.forEach(function(it){d.push({title:pdfh(it,".title&&Text"),url:pd(it,"a&&href"),desc:pdfh(html,".pic-text&&Text"),pic_url:pd(html,".lazyload&&data-original")})});setResult(d);
'
,
//搜索:'li.stui-vodlist__item;a&&title;a&&data-original;.pic-text&&Text;a&&href'
});
\ No newline at end of file
libs/drpy.js
浏览文件 @
e2736dc4
...
...
@@ -53,7 +53,7 @@ function pre(){
}
let
rule
=
{};
const
VERSION
=
'
3.9.20beta7
'
;
const
VERSION
=
'
drpy1 3.9.25 20221126
'
;
/** 已知问题记录
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
...
...
@@ -936,12 +936,17 @@ function request(url,obj,ocr_flag){
}
}
if
(
typeof
(
obj
.
body
)
!=
'
undefined
'
&&
obj
.
body
&&
typeof
(
obj
.
body
)
===
'
string
'
){
let
data
=
{};
obj
.
body
.
split
(
'
&
'
).
forEach
(
it
=>
{
data
[
it
.
split
(
'
=
'
)[
0
]]
=
it
.
split
(
'
=
'
)[
1
]
});
obj
.
data
=
data
;
delete
obj
.
body
// let data = {};
// obj.body.split('&').forEach(it=>{
// data[it.split('=')[0]] = it.split('=')[1]
// });
// obj.data = data;
// delete obj.body
// 传body加 "Content-Type":"application/x-www-form-urlencoded;" 即可post form
if
(
!
obj
.
headers
.
hasOwnProperty
(
'
Content-Type
'
)
&&!
obj
.
headers
.
hasOwnProperty
(
'
content-type
'
)){
// 手动指定了就不管
obj
.
headers
[
"
Content-Type
"
]
=
'
application/x-www-form-urlencoded; charset=
'
+
rule
.
encoding
;
}
}
else
if
(
typeof
(
obj
.
body
)
!=
'
undefined
'
&&
obj
.
body
&&
typeof
(
obj
.
body
)
===
'
object
'
){
obj
.
data
=
obj
.
body
;
delete
obj
.
body
...
...
@@ -955,7 +960,7 @@ function request(url,obj,ocr_flag){
}
console
.
log
(
JSON
.
stringify
(
obj
.
headers
));
// console.log('request:'+url+' obj:'+JSON.stringify(obj));
console
.
log
(
'
request:
'
+
url
);
console
.
log
(
'
request:
'
+
url
+
`|method:
${
obj
.
method
||
'
GET
'
}
|body:
${
obj
.
body
||
''
}
`
);
let
res
=
req
(
url
,
obj
);
let
html
=
res
.
content
||
''
;
// console.log(html);
...
...
@@ -1504,7 +1509,34 @@ function searchParse(searchObj) {
p0
=
p0
.
replace
(
/^
(
jsp:|json:|jq:
)
/
,
''
);
// print('1381 p0:'+p0);
try
{
let
html
=
getHtml
(
MY_URL
);
let
req_method
=
MY_URL
.
split
(
'
;
'
).
length
>
1
?
MY_URL
.
split
(
'
;
'
)[
1
].
toLowerCase
():
'
get
'
;
let
html
;
if
(
req_method
===
'
post
'
){
let
rurls
=
MY_URL
.
split
(
'
;
'
)[
0
].
split
(
'
#
'
)
let
rurl
=
rurls
[
0
]
let
params
=
rurls
.
length
>
1
?
rurls
[
1
]:
''
;
print
(
`post=》rurl:
${
rurl
}
,params:
${
params
}
`
);
// let new_dict = {};
// let new_tmp = params.split('&');
// new_tmp.forEach(i=>{
// new_dict[i.split('=')[0]] = i.split('=')[1];
// });
// html = post(rurl,{body:new_dict});
html
=
post
(
rurl
,{
body
:
params
});
}
else
if
(
req_method
===
'
postjson
'
){
let
rurls
=
MY_URL
.
split
(
'
;
'
)[
0
].
split
(
'
#
'
)
let
rurl
=
rurls
[
0
]
let
params
=
rurls
.
length
>
1
?
rurls
[
1
]:
''
;
print
(
`postjson-》rurl:
${
rurl
}
,params:
${
params
}
`
);
try
{
params
=
JSON
.
parse
(
params
);
}
catch
(
e
)
{
params
=
'
{}
'
}
html
=
post
(
rurl
,{
body
:
params
});
}
else
{
html
=
getHtml
(
MY_URL
);
}
if
(
html
)
{
if
(
/系统安全验证|输入验证码/
.
test
(
html
)){
let
cookie
=
verifyCode
(
MY_URL
);
...
...
@@ -1530,18 +1562,18 @@ function searchParse(searchObj) {
let
list
=
_pdfa
(
html
,
p0
);
// print(list.length);
// print(list);
let
p1
=
getPP
(
p
,
1
,
pp
,
1
);
let
p2
=
getPP
(
p
,
2
,
pp
,
2
);
let
p3
=
getPP
(
p
,
3
,
pp
,
3
);
let
p4
=
getPP
(
p
,
4
,
pp
,
4
);
let
p5
=
getPP
(
p
,
5
,
pp
,
5
);
list
.
forEach
(
it
=>
{
let
p1
=
getPP
(
p
,
1
,
pp
,
1
);
let
p2
=
getPP
(
p
,
2
,
pp
,
2
);
let
p3
=
getPP
(
p
,
3
,
pp
,
3
);
let
p4
=
getPP
(
p
,
4
,
pp
,
4
);
let
links
=
p4
.
split
(
'
+
'
).
map
(
_p4
=>
{
return
!
rule
.
detailUrl
?
_pd
(
it
,
_p4
,
MY_URL
):
_pdfh
(
it
,
_p4
)
});
let
link
=
links
.
join
(
'
$
'
);
let
content
;
if
(
p
.
length
>
5
&&
p
[
5
]){
let
p5
=
getPP
(
p
,
5
,
pp
,
5
);
content
=
_pdfh
(
it
,
p5
);
}
else
{
content
=
''
;
...
...
libs/drpy.min.js
浏览文件 @
e2736dc4
此差异已折叠。
点击以展开。
libs/drpy2.js
浏览文件 @
e2736dc4
...
...
@@ -31,7 +31,7 @@ function pre(){
}
let
rule
=
{};
const
VERSION
=
'
drpy2 3.9.2
1 20221117
'
;
const
VERSION
=
'
drpy2 3.9.2
5 20221126
'
;
/** 已知问题记录
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
...
...
@@ -829,12 +829,17 @@ function request(url,obj,ocr_flag){
}
}
if
(
typeof
(
obj
.
body
)
!=
'
undefined
'
&&
obj
.
body
&&
typeof
(
obj
.
body
)
===
'
string
'
){
let
data
=
{};
obj
.
body
.
split
(
'
&
'
).
forEach
(
it
=>
{
data
[
it
.
split
(
'
=
'
)[
0
]]
=
it
.
split
(
'
=
'
)[
1
]
});
obj
.
data
=
data
;
delete
obj
.
body
// let data = {};
// obj.body.split('&').forEach(it=>{
// data[it.split('=')[0]] = it.split('=')[1]
// });
// obj.data = data;
// delete obj.body
// 传body加 "Content-Type":"application/x-www-form-urlencoded;" 即可post form
if
(
!
obj
.
headers
.
hasOwnProperty
(
'
Content-Type
'
)
&&!
obj
.
headers
.
hasOwnProperty
(
'
content-type
'
)){
// 手动指定了就不管
obj
.
headers
[
"
Content-Type
"
]
=
'
application/x-www-form-urlencoded; charset=
'
+
rule
.
encoding
;
}
}
else
if
(
typeof
(
obj
.
body
)
!=
'
undefined
'
&&
obj
.
body
&&
typeof
(
obj
.
body
)
===
'
object
'
){
obj
.
data
=
obj
.
body
;
delete
obj
.
body
...
...
@@ -848,7 +853,7 @@ function request(url,obj,ocr_flag){
}
console
.
log
(
JSON
.
stringify
(
obj
.
headers
));
// console.log('request:'+url+' obj:'+JSON.stringify(obj));
console
.
log
(
'
request:
'
+
url
);
console
.
log
(
'
request:
'
+
url
+
`|method:
${
obj
.
method
||
'
GET
'
}
|body:
${
obj
.
body
||
''
}
`
);
let
res
=
req
(
url
,
obj
);
let
html
=
res
.
content
||
''
;
// console.log(html);
...
...
@@ -1395,7 +1400,34 @@ function searchParse(searchObj) {
p0
=
p0
.
replace
(
/^
(
jsp:|json:|jq:
)
/
,
''
);
// print('1381 p0:'+p0);
try
{
let
html
=
getHtml
(
MY_URL
);
let
req_method
=
MY_URL
.
split
(
'
;
'
).
length
>
1
?
MY_URL
.
split
(
'
;
'
)[
1
].
toLowerCase
():
'
get
'
;
let
html
;
if
(
req_method
===
'
post
'
){
let
rurls
=
MY_URL
.
split
(
'
;
'
)[
0
].
split
(
'
#
'
)
let
rurl
=
rurls
[
0
]
let
params
=
rurls
.
length
>
1
?
rurls
[
1
]:
''
;
print
(
`post=》rurl:
${
rurl
}
,params:
${
params
}
`
);
// let new_dict = {};
// let new_tmp = params.split('&');
// new_tmp.forEach(i=>{
// new_dict[i.split('=')[0]] = i.split('=')[1];
// });
// html = post(rurl,{body:new_dict});
html
=
post
(
rurl
,{
body
:
params
});
}
else
if
(
req_method
===
'
postjson
'
){
let
rurls
=
MY_URL
.
split
(
'
;
'
)[
0
].
split
(
'
#
'
)
let
rurl
=
rurls
[
0
]
let
params
=
rurls
.
length
>
1
?
rurls
[
1
]:
''
;
print
(
`postjson-》rurl:
${
rurl
}
,params:
${
params
}
`
);
try
{
params
=
JSON
.
parse
(
params
);
}
catch
(
e
)
{
params
=
'
{}
'
}
html
=
post
(
rurl
,{
body
:
params
});
}
else
{
html
=
getHtml
(
MY_URL
);
}
if
(
html
)
{
if
(
/系统安全验证|输入验证码/
.
test
(
html
)){
let
cookie
=
verifyCode
(
MY_URL
);
...
...
@@ -1421,18 +1453,18 @@ function searchParse(searchObj) {
let
list
=
_pdfa
(
html
,
p0
);
// print(list.length);
// print(list);
let
p1
=
getPP
(
p
,
1
,
pp
,
1
);
let
p2
=
getPP
(
p
,
2
,
pp
,
2
);
let
p3
=
getPP
(
p
,
3
,
pp
,
3
);
let
p4
=
getPP
(
p
,
4
,
pp
,
4
);
let
p5
=
getPP
(
p
,
5
,
pp
,
5
);
list
.
forEach
(
it
=>
{
let
p1
=
getPP
(
p
,
1
,
pp
,
1
);
let
p2
=
getPP
(
p
,
2
,
pp
,
2
);
let
p3
=
getPP
(
p
,
3
,
pp
,
3
);
let
p4
=
getPP
(
p
,
4
,
pp
,
4
);
let
links
=
p4
.
split
(
'
+
'
).
map
(
_p4
=>
{
return
!
rule
.
detailUrl
?
_pd
(
it
,
_p4
,
MY_URL
):
_pdfh
(
it
,
_p4
)
});
let
link
=
links
.
join
(
'
$
'
);
let
content
;
if
(
p
.
length
>
5
&&
p
[
5
]){
let
p5
=
getPP
(
p
,
5
,
pp
,
5
);
content
=
_pdfh
(
it
,
p5
);
}
else
{
content
=
''
;
...
...
libs/drpy2.min.js
浏览文件 @
e2736dc4
此差异已折叠。
点击以展开。
readme.md
浏览文件 @
e2736dc4
...
...
@@ -49,6 +49,9 @@
[
dockerfile教程
](
https://blog.csdn.net/qq_46158060/article/details/125718218
)
[
获取本地设备信息
](
https://blog.csdn.net/cui_yonghua/article/details/125508991
)
[
获取本地设备信息
](
https://m.jb51.net/article/140716.htm
)
###### 2022/11/26
-
[X] drpy系列资源接口修复,推荐为double的情况也支持第二个定位写
*
自动继承一级的第一个定位(参考乐猪TV)
-
[X] V3.9.25新特性:搜索支持post(参考乐猪TV) 格式为 搜索链接;post (搜索参数用#传递)
###### 2022/11/25
-
[X] 优化腾云驾雾源,方便追剧
-
[X] 增加新解析并修复酷云自建解析
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录