Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
西城十七妹
dr_py
提交
58fd0194
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,发现更多精彩内容 >>
提交
58fd0194
编写于
1月 03, 2023
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
内部聚搜优化
上级
e7dcd71e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
110 addition
and
11 deletion
+110
-11
base/config.py
base/config.py
+1
-0
controllers/service.py
controllers/service.py
+3
-3
controllers/vod.py
controllers/vod.py
+72
-1
js/version.txt
js/version.txt
+1
-1
readme.md
readme.md
+2
-0
static/css/admin.css
static/css/admin.css
+24
-5
templates/admin.html
templates/admin.html
+7
-1
未找到文件。
base/config.py
浏览文件 @
58fd0194
...
...
@@ -48,6 +48,7 @@ CATE_EXCLUDE = '首页|留言|APP|下载|资讯|新闻|动态|明星|专题|最
TAB_EXCLUDE
=
'猜你|喜欢|APP|下载|剧情|简介|排序'
# 动态线路名过滤
# {% if config.WALL_PAPER %}"wallpaper":"{{ config.WALL_PAPER }}",{% endif %}
SEARCH_TIMEOUT
=
5000
# 聚搜超时毫秒
SEARCH_LIMIT
=
24
# 聚搜限制条数
MULTI_MODE
=
0
# 多源模式
XR_MODE
=
1
# 仙人模式
JS_PROXY
=
'http://localhost:5705/admin/view/=>https://gitcode.net/qq_32394351/dr_py/-/raw/master/js/'
# 源代理
...
...
controllers/service.py
浏览文件 @
58fd0194
...
...
@@ -22,7 +22,7 @@ class storage_service(object):
def
__init__
(
self
):
conf_list
=
[
'LIVE_URL'
,
'USE_PY'
,
'JS_MODE'
,
'JS0_DISABLE'
,
'JS0_PASSWORD'
,
'PLAY_URL'
,
'PLAY_DISABLE'
,
'LAZYPARSE_MODE'
,
'WALL_PAPER_ENABLE'
,
'WALL_PAPER'
,
'UNAME'
,
'PWD'
,
'LIVE_MODE'
,
'CATE_EXCLUDE'
,
'TAB_EXCLUDE'
,
'SEARCH_TIMEOUT'
,
'MULTI_MODE'
,
'XR_MODE'
,
'JS_PROXY'
,
'ENV'
,
'ALI_TOKEN'
]
'WALL_PAPER'
,
'UNAME'
,
'PWD'
,
'LIVE_MODE'
,
'CATE_EXCLUDE'
,
'TAB_EXCLUDE'
,
'SEARCH_TIMEOUT'
,
'
SEARCH_LIMIT'
,
'
MULTI_MODE'
,
'XR_MODE'
,
'JS_PROXY'
,
'ENV'
,
'ALI_TOKEN'
]
for
conf
in
conf_list
:
if
not
self
.
hasItem
(
conf
):
print
(
f
'开始初始化
{
conf
}
'
)
...
...
@@ -32,9 +32,9 @@ class storage_service(object):
def
getStoreConf
(
self
):
# MAX_CONTENT_LENGTH 最大上传和端口ip一样是顶级配置,无法外部修改的
conf_list
=
[
'LIVE_URL'
,
'LIVE_MODE'
,
'PLAY_URL'
,
'PID_URL'
,
'USE_PY'
,
'JS_MODE'
,
'JS0_DISABLE'
,
'JS0_PASSWORD'
,
'PLAY_DISABLE'
,
'LAZYPARSE_MODE'
,
'WALL_PAPER_ENABLE'
,
'WALL_PAPER'
,
'UNAME'
,
'PWD'
,
'CATE_EXCLUDE'
,
'TAB_EXCLUDE'
,
'SEARCH_TIMEOUT'
,
'MULTI_MODE'
,
'XR_MODE'
,
'JS_PROXY'
,
'ENV'
,
'ALI_TOKEN'
]
'WALL_PAPER'
,
'UNAME'
,
'PWD'
,
'CATE_EXCLUDE'
,
'TAB_EXCLUDE'
,
'SEARCH_TIMEOUT'
,
'
SEARCH_LIMIT'
,
'
MULTI_MODE'
,
'XR_MODE'
,
'JS_PROXY'
,
'ENV'
,
'ALI_TOKEN'
]
conf_name_list
=
[
'直播地址'
,
'直播模式'
,
'远程地址'
,
'进程管理链接'
,
'启用py源'
,
'js模式'
,
'禁用js0'
,
'js0密码'
,
'禁用免嗅'
,
'免嗅模式'
,
'启用壁纸'
,
'壁纸链接'
,
'管理账号'
,
'管理密码'
,
'分类排除'
,
'线路排除'
,
'聚搜超时'
,
'多源模式'
,
'仙人模式'
,
'源代理'
,
'环境变量'
,
'阿里tk'
]
'管理密码'
,
'分类排除'
,
'线路排除'
,
'聚搜超时'
,
'
搜索条数'
,
'
多源模式'
,
'仙人模式'
,
'源代理'
,
'环境变量'
,
'阿里tk'
]
conf_lists
=
[]
for
i
in
range
(
len
(
conf_list
)):
conf
=
conf_list
[
i
]
...
...
controllers/vod.py
浏览文件 @
58fd0194
...
...
@@ -3,6 +3,7 @@
# File : vod.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
import
functools
import
json
from
flask
import
Blueprint
,
abort
,
request
,
render_template
,
render_template_string
,
jsonify
,
make_response
,
redirect
,
current_app
...
...
@@ -25,7 +26,6 @@ from quickjs import Function,Context
import
ujson
vod
=
Blueprint
(
"vod"
,
__name__
)
def
search_one_py
(
rule
,
wd
,
before
:
str
=
''
):
t1
=
time
()
if
not
before
:
...
...
@@ -153,6 +153,53 @@ def disable_exit_for_threadpool_executor():
import
concurrent.futures
atexit
.
unregister
(
concurrent
.
futures
.
thread
.
_python_exit
)
def
sort_lsg_rules
(
sites
:
list
):
"""
查询结果按order和write_date 联合排序
:param sites:
:return:
"""
def
comp
(
x
,
y
):
if
x
[
'order'
]
>
y
[
'order'
]:
return
1
elif
x
[
'order'
]
<
y
[
'order'
]:
return
-
1
else
:
if
x
[
'write_date'
]
<
y
[
'write_date'
]:
return
1
elif
x
[
'write_date'
]
>
y
[
'write_date'
]:
return
-
1
else
:
return
0
sites
.
sort
(
key
=
functools
.
cmp_to_key
(
comp
),
reverse
=
False
)
return
sites
def
sort_lsg_rules2
(
sites
:
list
,
lsg_rule_names
:
list
):
"""
查询结果按order和write_date 联合排序
:param sites:
:return:
"""
def
comp
(
x
,
y
):
try
:
x1
=
lsg_rule_names
.
index
(
x
)
except
:
x1
=
999
try
:
y1
=
lsg_rule_names
.
index
(
y
)
except
:
y1
=
999
if
x1
>=
y1
:
return
1
elif
x1
<
y1
:
return
-
1
sites
.
sort
(
key
=
functools
.
cmp_to_key
(
comp
),
reverse
=
False
)
return
sites
def
multi_search
(
wd
):
lsg
=
storage_service
()
env
=
get_env
()
...
...
@@ -173,7 +220,31 @@ def multi_search(wd):
logger
.
info
(
f
'开始聚搜
{
wd
}
,共计
{
len
(
search_sites
)
}
个规则,聚搜超时
{
timeout
}
秒'
)
logger
.
info
(
f
'不支持聚搜的规则,共计
{
len
(
nosearch_sites
)
}
个规则:
{
","
.
join
(
nosearch_sites
)
}
'
)
search_sites
=
merged_hide
(
search_sites
)
# print(len(search_sites))
# search_sites = []
lsg_rules
=
rules_service
()
lsg_rule_list
=
lsg_rules
.
query_all
()
# print(len(lsg_rule_list))
# rule_names = list(map(lambda x: x['name'], rule_list))
lsg_rule_list
=
list
(
filter
(
lambda
x
:
x
[
'name'
]
in
search_sites
,
lsg_rule_list
))
lsg_rule_names
=
list
(
map
(
lambda
x
:
x
[
'name'
],
lsg_rule_list
))
search_sites
=
sort_lsg_rules2
(
search_sites
,
lsg_rule_names
)
# print(len(lsg_rule_list))
# lsg_rule_list = sort_lsg_rules(lsg_rule_list)
# print(len(lsg_rule_list))
# print(search_sites)
SEARCH_LIMIT
=
lsg
.
getItem
(
'SEARCH_LIMIT'
,
24
)
try
:
SEARCH_LIMIT
=
int
(
SEARCH_LIMIT
)
except
:
SEARCH_LIMIT
=
0
if
SEARCH_LIMIT
<
1
:
SEARCH_LIMIT
=
0
search_sites
=
search_sites
[:
SEARCH_LIMIT
]
msearch_msg
=
f
'搜索限制条数:
{
SEARCH_LIMIT
}
/
{
len
(
search_sites
)
}
{
search_sites
}
'
logger
.
info
(
msearch_msg
)
print
(
msearch_msg
)
# search_sites = []
res
=
[]
if
len
(
search_sites
)
>
0
:
...
...
js/version.txt
浏览文件 @
58fd0194
3.9.33beta14
\ No newline at end of file
3.9.34beta1
\ No newline at end of file
readme.md
浏览文件 @
58fd0194
...
...
@@ -49,6 +49,8 @@
[
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
)
###### 2023/01/03
-
[X] 3.9.34 聚搜功能优化,设置中心增加搜索条数设置,默认24条。关联未来功能里的排序顺序进行搜索取数
###### 2022/12/26
-
[X] 3.9.33beta4 修复腾云驾雾搜索
-
[X] 3.9.33beta5 修复腾云驾雾综艺,电影的二级
...
...
static/css/admin.css
浏览文件 @
58fd0194
...
...
@@ -21,8 +21,9 @@ body{
height
:
40px
;
}
.mz
{
text-align
:
left
;
text-align
:
center
;
display
:
inline-block
;
width
:
40%
;
}
.mz
a
{
border-radius
:
50px
;
...
...
@@ -38,7 +39,7 @@ body{
.sj
{
text-align
:
center
;
width
:
4
8%
;
width
:
1
8%
;
display
:
inline-block
;
}
.sj
a
{
...
...
@@ -52,10 +53,28 @@ body{
background-color
:
#17af30
;
}
.ss
{
width
:
18%
;
text-align
:
center
;
display
:
inline-block
;
}
.ss
a
{
border-radius
:
50px
;
border-style
:
solid
;
color
:
#FFFFFF
;
text-align
:
center
;
padding
:
1px
3px
1px
3px
;
border-style
:
solid
;
border-color
:
#1379cb
;
text-decoration
:
none
;
background-color
:
#1379cb
;
}
.sc
{
text-align
:
right
;
width
:
1
5
%
;
padding-right
:
5%
;
text-align
:
center
;
width
:
1
8
%
;
/*padding-right: 5%;*/
display
:
inline-block
;
}
.sc
a
{
...
...
templates/admin.html
浏览文件 @
58fd0194
...
...
@@ -26,6 +26,11 @@
location
.
href
=
'
/vod?{% if js0_password %}pwd={{js0_password}}&{% endif %}rule=
'
+
rule
;
});
$
(
"
.view_search
"
).
click
(
function
(){
let
rule
=
this
.
getAttribute
(
'
value
'
).
trim
();
location
.
href
=
'
/vod?{% if js0_password %}pwd={{js0_password}}&{% endif %}rule=
'
+
rule
+
'
&wd=斗罗大陆
'
;
});
$
(
"
#checkUpdate
"
).
click
(
function
(){
console
.
log
(
'
开始检查升级...
'
);
$
.
get
(
"
/admin/get_ver
"
,
function
(
data
,
status
){
...
...
@@ -239,7 +244,8 @@ function getFileSize(fileObj) {
{% for rule in rules.list %}
<div
class=
"red"
>
<div
class=
"mz"
><a
class=
"view"
href=
"javascript:void(0);"
>
{{ rule.name }}
</a></div>
<div
class=
"sj"
><a
class=
"view_home"
href=
"javascript:void(0);"
value=
"{{ rule.name }}"
>
主页数据预览
</a></div>
<div
class=
"sj"
><a
class=
"view_home"
href=
"javascript:void(0);"
value=
"{{ rule.name }}"
>
主页
</a></div>
<div
class=
"ss"
><a
class=
"view_search"
href=
"javascript:void(0);"
value=
"{{ rule.name }}"
>
搜索
</a></div>
<div
class=
"sc"
><a
class=
"clear"
href=
"javascript:void(0);"
value=
"{{ rule.name }}"
>
删除
</a></div>
</div>
{% endfor %}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录