Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jxt000123
dr_py
提交
3c7e85a6
dr_py
项目概览
jxt000123
/
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,发现更多精彩内容 >>
提交
3c7e85a6
编写于
8月 30, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复外网免嗅配置模式异常问题
上级
7a5f2fb3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
91 addition
and
66 deletion
+91
-66
app.py
app.py
+2
-1
classes/cms.py
classes/cms.py
+80
-58
js/干饭影视.js
js/干饭影视.js
+5
-4
js/瓜皮TV.js
js/瓜皮TV.js
+2
-2
readme.md
readme.md
+1
-0
templates/config.txt
templates/config.txt
+1
-1
未找到文件。
app.py
浏览文件 @
3c7e85a6
...
...
@@ -186,7 +186,8 @@ def getRules(path='cache'):
new_rule_list
.
append
({
'name'
:
rule_list
[
i
],
'searchable'
:
rule_codes
[
i
].
searchable
or
0
,
'quickSearch'
:
rule_codes
[
i
].
quickSearch
or
0
'quickSearch'
:
rule_codes
[
i
].
quickSearch
or
0
,
'filterable'
:
rule_codes
[
i
].
filterable
or
0
,
})
# print(new_rule_list)
rules
=
{
'list'
:
new_rule_list
,
'count'
:
len
(
rule_list
)}
...
...
classes/cms.py
浏览文件 @
3c7e85a6
...
...
@@ -35,11 +35,13 @@ class CMS:
self
.
id
=
rule
.
get
(
'id'
,
self
.
title
)
self
.
lazy
=
rule
.
get
(
'lazy'
,
False
)
self
.
play_disable
=
new_conf
.
get
(
'PLAY_DISABLE'
,
False
)
self
.
lazy_mode
=
new_conf
.
get
(
'LAZYPARSE_MODE'
)
self
.
vod
=
redirect
(
url_for
(
'vod'
)).
headers
[
'Location'
]
# if not self.play_disable and self.lazy:
if
not
self
.
play_disable
:
self
.
play_parse
=
rule
.
get
(
'play_parse'
,
False
)
play_url
=
new_conf
.
get
(
'PLAY_URL'
,
getHost
(
2
))
play_url
=
getHost
(
self
.
lazy_mode
)
# play_url = new_conf.get('PLAY_URL',getHost(2))
if
not
play_url
.
startswith
(
'http'
):
play_url
=
'http://'
+
play_url
if
self
.
play_parse
:
...
...
@@ -356,11 +358,32 @@ class CMS:
for
item
in
items
:
items2
=
pdfa
(
item
,
p
[
1
])
for
item2
in
items2
:
title
=
pdfh
(
item2
,
p
[
2
])
img
=
pd
(
item2
,
p
[
3
])
desc
=
pdfh
(
item2
,
p
[
4
])
link
=
pd
(
item2
,
p
[
5
])
content
=
''
if
len
(
p
)
<
7
else
pdfh
(
item2
,
p
[
6
])
try
:
title
=
pdfh
(
item2
,
p
[
2
])
img
=
pd
(
item2
,
p
[
3
])
desc
=
pdfh
(
item2
,
p
[
4
])
link
=
pd
(
item2
,
p
[
5
])
content
=
''
if
len
(
p
)
<
7
else
pdfh
(
item2
,
p
[
6
])
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
"vod_pic"
:
img
,
"vod_remarks"
:
desc
,
"vod_content"
:
content
,
"type_id"
:
1
,
"type_name"
:
"首页推荐"
,
})
except
:
pass
else
:
items
=
pdfa
(
html
,
p
[
0
])
for
item
in
items
:
try
:
title
=
pdfh
(
item
,
p
[
1
])
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
...
...
@@ -370,23 +393,8 @@ class CMS:
"type_id"
:
1
,
"type_name"
:
"首页推荐"
,
})
else
:
items
=
pdfa
(
html
,
p
[
0
])
for
item
in
items
:
title
=
pdfh
(
item
,
p
[
1
])
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
"vod_pic"
:
img
,
"vod_remarks"
:
desc
,
"vod_content"
:
content
,
"type_id"
:
1
,
"type_name"
:
"首页推荐"
,
})
except
:
pass
result
[
'list'
]
=
videos
result
[
'code'
]
=
1
result
[
'msg'
]
=
'数据列表'
...
...
@@ -421,9 +429,6 @@ class CMS:
url
=
self
.
url
.
replace
(
'fyclass'
,
fyclass
).
replace
(
'fypage'
,
pg
)
if
fypage
==
1
and
self
.
test
(
'[\[\]]'
,
url
):
url
=
url
.
split
(
'['
)[
1
].
split
(
']'
)[
0
]
r
=
requests
.
get
(
url
,
headers
=
self
.
headers
,
timeout
=
self
.
timeout
)
r
.
encoding
=
self
.
encoding
print
(
r
.
url
)
p
=
self
.
一级
.
split
(
';'
)
# 解析
if
len
(
p
)
<
5
:
return
self
.
blank
()
...
...
@@ -435,23 +440,35 @@ class CMS:
# print(pdfh(r.text,'body a.module-poster-item.module-item:eq(1)&&Text'))
# print(pdfh(r.text,'body a.module-poster-item.module-item:eq(0)'))
# print(pdfh(r.text,'body a.module-poster-item.module-item:first'))
items
=
pdfa
(
r
.
text
,
p
[
0
])
videos
=
[]
items
=
[]
try
:
r
=
requests
.
get
(
url
,
headers
=
self
.
headers
,
timeout
=
self
.
timeout
)
r
.
encoding
=
self
.
encoding
print
(
r
.
url
)
html
=
r
.
text
items
=
pdfa
(
html
,
p
[
0
])
except
:
pass
for
item
in
items
:
# print(item)
title
=
pdfh
(
item
,
p
[
1
])
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
# sid = self.regStr(sid, "/video/(\\S+).html")
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
"vod_pic"
:
img
,
"vod_remarks"
:
desc
,
"vod_content"
:
content
,
})
try
:
title
=
pdfh
(
item
,
p
[
1
])
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
# sid = self.regStr(sid, "/video/(\\S+).html")
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
"vod_pic"
:
img
,
"vod_remarks"
:
desc
,
"vod_content"
:
content
,
})
except
:
pass
result
[
'list'
]
=
videos
result
[
'page'
]
=
fypage
result
[
'pagecount'
]
=
9999
...
...
@@ -469,10 +486,6 @@ class CMS:
url
=
detailUrl
# print(url)
try
:
r
=
requests
.
get
(
url
,
headers
=
self
.
headers
,
timeout
=
self
.
timeout
)
r
.
encoding
=
self
.
encoding
html
=
r
.
text
# print(html)
p
=
self
.
二级
# 解析
if
p
==
'*'
:
vod
=
self
.
blank_vod
()
...
...
@@ -493,6 +506,10 @@ class CMS:
pq
=
jsp
.
pq
obj
=
{}
vod_name
=
''
r
=
requests
.
get
(
url
,
headers
=
self
.
headers
,
timeout
=
self
.
timeout
)
r
.
encoding
=
self
.
encoding
html
=
r
.
text
# print(html)
if
p
.
get
(
'title'
):
p1
=
p
[
'title'
].
split
(
';'
)
vod_name
=
pdfh
(
html
,
p1
[
0
]).
replace
(
'
\n
'
,
' '
)
...
...
@@ -557,7 +574,7 @@ class CMS:
vod
[
'vod_play_url'
]
=
vod_play_url
except
Exception
as
e
:
logger
.
info
(
f
'
{
self
.
getName
()
}
获取单个详情页出错
{
e
}
'
)
print
(
vod
)
return
vod
def
detailContent
(
self
,
fypage
,
array
):
...
...
@@ -610,22 +627,27 @@ class CMS:
r
.
encoding
=
self
.
encoding
html
=
r
.
text
items
=
pdfa
(
html
,
p
[
0
])
# print(items)
videos
=
[]
for
item
in
items
:
# print(item)
title
=
pdfh
(
item
,
p
[
1
])
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
# sid = self.regStr(sid, "/video/(\\S+).html")
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
"vod_pic"
:
img
,
"vod_remarks"
:
desc
,
"vod_content"
:
content
,
})
try
:
title
=
pdfh
(
item
,
p
[
1
])
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
# sid = self.regStr(sid, "/video/(\\S+).html")
videos
.
append
({
"vod_id"
:
link
,
"vod_name"
:
title
,
"vod_pic"
:
img
,
"vod_remarks"
:
desc
,
"vod_content"
:
content
,
})
except
:
pass
# print(videos)
except
Exception
as
e
:
logger
.
info
(
f
'搜索
{
self
.
getName
()
}
发生错误:
{
e
}
'
)
result
=
{
...
...
js/干饭影视.js
浏览文件 @
3c7e85a6
...
...
@@ -4,11 +4,12 @@ var rule = {
// homeUrl:'/',
url
:
'
/vodtype/fyclass-fypage.html
'
,
headers
:{
'
User-Agent
'
:
'
MOBILE_UA
'
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
},
searchUrl
:
'
/
search/**-fypage
.html
'
,
searchable
:
1
,
quickSearch
:
1
,
searchUrl
:
'
/
vodsearch/**----------fypage---
.html
'
,
searchable
:
0
,
quickSearch
:
0
,
// class_name:'电影&网剧&剧集&动漫&综艺&记录',
// class_url:'20&1&2&3&4&23',
class_parse
:
'
.stui-header__menu li:gt(0):lt(5);a&&Text;a&&href;/(
\\
d+).html
'
,
...
...
js/瓜皮TV.js
浏览文件 @
3c7e85a6
...
...
@@ -4,8 +4,8 @@ var rule = {
// homeUrl:'/',
url
:
'
/vodshow/fyclass--------fypage---.html
'
,
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
0
,
quickSearch
:
0
,
searchable
:
1
,
quickSearch
:
1
,
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
...
...
readme.md
浏览文件 @
3c7e85a6
...
...
@@ -84,6 +84,7 @@ var rule = {
searchUrl
:
''
,
//搜索链接 可以是完整路径或者相对路径,用于分类获取和推荐获取 **代表搜索词 fypage代表页数
searchable
:
0
,
//是否启用全局搜索,
quickSearch
:
0
,
//是否启用快速搜索,
filterable
:
0
,
//是否启用筛选,
// 注意,由于猫有配置缓存,搜索配置没法热加载,修改了js不需要重启服务器
// 但是需要tv_box进设置里换源使配置重新装载
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
...
...
templates/config.txt
浏览文件 @
3c7e85a6
...
...
@@ -10,7 +10,7 @@
"api":"{{ host }}/vod?rule={{ rule.name }}",
"searchable": {{ rule.searchable }},
"quickSearch": {{ rule.quickSearch }},
"filterable":
1
"filterable":
{{ rule.filterable }}
}{% else %}
{
"key":"dr_{{ rule.name }}",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录