Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
peater12
dr_py
提交
344b611d
dr_py
项目概览
peater12
/
dr_py
落后 Fork 源项目 2 个版本
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,发现更多精彩内容 >>
提交
344b611d
编写于
9月 12, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决菜狗的自定义筛选
上级
098a17b3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
7 deletion
+27
-7
controllers/cms.py
controllers/cms.py
+14
-4
controllers/vod.py
controllers/vod.py
+9
-3
js/菜狗.js
js/菜狗.js
+1
-0
readme.md
readme.md
+3
-0
未找到文件。
controllers/cms.py
浏览文件 @
344b611d
...
...
@@ -19,7 +19,7 @@ from utils.parser import runPy,runJScode,JsObjectWrapper
from
utils.htmlParser
import
jsoup
from
urllib.parse
import
urljoin
from
concurrent.futures
import
ThreadPoolExecutor
# 引入线程池
from
flask
import
url_for
,
redirect
from
flask
import
url_for
,
redirect
,
render_template_string
from
easydict
import
EasyDict
as
edict
from
controllers.service
import
storage_service
...
...
@@ -51,6 +51,7 @@ class CMS:
self
.
lsg
=
storage_service
()
self
.
title
=
rule
.
get
(
'title'
,
''
)
self
.
id
=
rule
.
get
(
'id'
,
self
.
title
)
self
.
filter_url
=
rule
.
get
(
'filter_url'
,
''
)
cate_exclude
=
rule
.
get
(
'cate_exclude'
,
''
)
tab_exclude
=
rule
.
get
(
'tab_exclude'
,
''
)
self
.
lazy
=
rule
.
get
(
'lazy'
,
False
)
...
...
@@ -595,14 +596,17 @@ class CMS:
# print(result)
return
result
def
categoryContent
(
self
,
fyclass
,
fypage
):
def
categoryContent
(
self
,
fyclass
,
fypage
,
fl
=
None
):
"""
一级带分类的数据返回
:param fyclass: 分类标识
:param fypage: 页码
:param fl: 筛选
:return: cms一级数据
"""
if
fl
is
None
:
fl
=
{}
result
=
{}
# urlParams = ["", "", "", "", "", "", "", "", "", "", "", ""]
# urlParams = [""] * 12
...
...
@@ -629,11 +633,17 @@ class CMS:
exec
(
f
'cnt_pg=
{
cnt_page
}
'
,
cnt_ctx
)
cnt_pg
=
str
(
cnt_ctx
[
'cnt_pg'
])
# 计算表达式的结果
url
=
url
.
replace
(
url_rep
,
str
(
cnt_pg
)).
replace
(
'('
,
''
).
replace
(
')'
,
''
)
print
(
url
)
#
print(url)
else
:
url
=
url
.
replace
(
'fypage'
,
pg
)
if
fypage
==
1
and
self
.
test
(
'[\[\]]'
,
url
):
url
=
url
.
split
(
'['
)[
1
].
split
(
']'
)[
0
]
if
self
.
filter_url
:
fl_url
=
render_template_string
(
self
.
filter_url
,
fl
=
fl
)
if
not
url
.
endswith
(
'&'
)
and
not
fl_url
.
startswith
(
'&'
):
url
+=
'&'
url
+=
fl_url
# print(url)
p
=
self
.
一级
jsp
=
jsoup
(
self
.
url
)
videos
=
[]
...
...
controllers/vod.py
浏览文件 @
344b611d
...
...
@@ -3,6 +3,7 @@
# File : vod.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
import
json
from
flask
import
Blueprint
,
request
,
render_template
,
jsonify
,
make_response
,
redirect
from
time
import
time
...
...
@@ -23,6 +24,7 @@ def vod_home():
t0
=
time
()
rule
=
getParmas
(
'rule'
)
ext
=
getParmas
(
'ext'
)
filters
=
getParmas
(
'f'
)
if
not
ext
.
startswith
(
'http'
)
and
not
rule
:
return
R
.
failed
(
'规则字段必填'
)
rule_list
=
getRuleLists
()
...
...
@@ -90,8 +92,13 @@ def vod_home():
else
:
return
play_url
if
ac
and
t
:
# 一级
data
=
cms
.
categoryContent
(
t
,
pg
)
if
ac
and
t
:
# 一级
fl
=
{}
if
filters
and
filters
.
find
(
'{'
)
>
-
1
and
filters
.
find
(
'}'
)
>
-
1
:
fl
=
json
.
loads
(
filters
)
# print(filters,type(filters))
# print(fl,type(fl))
data
=
cms
.
categoryContent
(
t
,
pg
,
fl
)
# print(data)
return
jsonify
(
data
)
if
ac
and
ids
:
# 二级
...
...
@@ -105,7 +112,6 @@ def vod_home():
data
=
cms
.
searchContent
(
wd
)
# print(data)
return
jsonify
(
data
)
# return jsonify({'rule':rule,'js_code':js_code})
home_data
=
cms
.
homeContent
(
pg
)
return
jsonify
(
home_data
)
\ No newline at end of file
js/菜狗.js
浏览文件 @
344b611d
...
...
@@ -7,6 +7,7 @@ var rule = {
quickSearch
:
0
,
// 分类链接fypage参数支持1个()表达式
url
:
'
/napi/video/classlist?abtest=0&iploc=CN1304&spver=&listTab=fyclass&filter=&start=((fypage-1)*15)&len=15&fr=filter
'
,
filter_url
:
'
style={{fl.style}}&zone={{fl.zone}}&year={{fl.year}}&fee={{fl.fee}}&order={{fl.order}}
'
,
headers
:{
'
User-Agent
'
:
'
MOBILE_UA
'
},
...
...
readme.md
浏览文件 @
344b611d
...
...
@@ -49,6 +49,7 @@
###### 2022/09/11
-
[X] 1.升级至3.5.2.后台管理增加设置中心 (可能会存在bug)
-
[X] 2.升级至3.5.3.增加菜狗源(筛选及解析播放暂未解决)
-
[X] 3.升级至3.5.4 (此版本+pluto1.4.1以上版本支持filter,源示例:菜狗.js)
###### 2022/09/10
-
[X] 1.升级至3.4.4.增加小强迷源,增加二级重定向属性(提供重定向后的源码,让代码重新取重定向过后的线路和播放列表)
-
[X] 2.升级至3.4.5.增加兔小贝儿歌源,优化json:细节处理以及详情页拼接细节
...
...
@@ -203,6 +204,8 @@ var rule = {
quickSearch
:
0
,
//是否启用快速搜索,
filterable
:
0
,
//是否启用筛选,
filter
:{},
// 筛选条件字典
// 筛选网站传参,会自动传到分类链接下(本示例中的url参数)
filter_url
:
'
style={{fl.style}}&zone={{fl.zone}}&year={{fl.year}}&fee={{fl.fee}}&order={{fl.order}}
'
,
// 注意,由于猫有配置缓存,搜索配置没法热加载,修改了js不需要重启服务器
// 但是需要tv_box进设置里换源使配置重新装载
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录