Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鼎玩网络
dr_py
提交
a66ba75e
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,发现更多精彩内容 >>
提交
a66ba75e
编写于
8月 25, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成cms搜索数据封装
上级
35c816d4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
59 addition
and
6 deletion
+59
-6
app.py
app.py
+13
-0
js/鸭奈飞.js
js/鸭奈飞.js
+2
-1
models/cms.py
models/cms.py
+43
-4
pycms.json
pycms.json
+1
-1
未找到文件。
app.py
浏览文件 @
a66ba75e
...
...
@@ -55,6 +55,19 @@ def vod():
cms
=
CMS
(
rule
)
print
(
cms
)
print
(
cms
.
title
)
wd
=
getParmas
(
'wd'
)
ac
=
getParmas
(
'ac'
)
quick
=
getParmas
(
'quick'
)
play
=
getParmas
(
'play'
)
flag
=
getParmas
(
'flag'
)
filter
=
getParmas
(
'filter'
)
t
=
getParmas
(
't'
)
pg
=
getParmas
(
'pg'
)
ext
=
getParmas
(
'ext'
)
ids
=
getParmas
(
'ids'
)
q
=
getParmas
(
'q'
)
print
(
getParmas
())
return
jsonify
({
'rule'
:
rule
,
'js_code'
:
js_code
})
if
__name__
==
'__main__'
:
...
...
js/鸭奈飞.js
浏览文件 @
a66ba75e
...
...
@@ -9,5 +9,5 @@ var rule = {
class_url
:
'
dianying&lianxuju&zongyi&dongman
'
,
一级
:
'
body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href
'
,
二级
:{
"
title
"
:
"
h1&&Text;.module-info-tag&&Text
"
,
"
img
"
:
"
.lazyload&&data-original
"
,
"
desc
"
:
"
.module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text
"
,
"
content
"
:
"
.module-info-introduction&&Text
"
,
"
tabs
"
:
"
.module-tab-item
"
,
"
lists
"
:
"
.module-play-list:eq(#id) a
"
},
搜索
:
''
,
搜索
:
'
body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text
'
,
}
\ No newline at end of file
models/cms.py
浏览文件 @
a66ba75e
...
...
@@ -8,6 +8,7 @@ import requests
from
utils.web
import
*
from
utils.config
import
config
from
utils.htmlParser
import
jsoup
from
urllib.parse
import
urljoin
class
CMS
:
def
__init__
(
self
,
rule
):
...
...
@@ -92,8 +93,8 @@ class CMS:
# params = '-'.join(urlParams)
# print(params)
# url = self.url + '/{0}.html'.format(params)
fypage
=
str
(
fypage
)
url
=
self
.
url
.
replace
(
'fyclass'
,
fyclass
).
replace
(
'fypage'
,
fypage
)
pg
=
str
(
fypage
)
url
=
self
.
url
.
replace
(
'fyclass'
,
fyclass
).
replace
(
'fypage'
,
pg
)
print
(
url
)
headers
=
{
'user-agent'
:
self
.
ua
}
r
=
requests
.
get
(
url
,
headers
=
headers
)
...
...
@@ -113,7 +114,7 @@ class CMS:
img
=
pd
(
item
,
p
[
2
])
desc
=
pdfh
(
item
,
p
[
3
])
link
=
pd
(
item
,
p
[
4
])
content
=
''
content
=
''
if
len
(
p
)
<
6
else
pdfh
(
item
,
p
[
5
])
# sid = self.regStr(sid, "/video/(\\S+).html")
videos
.
append
({
"vod_id"
:
link
,
...
...
@@ -218,6 +219,43 @@ class CMS:
}
return
result
def
searchContent
(
self
,
key
,
fypage
=
1
,
quick
=
1
):
pg
=
str
(
fypage
)
url
=
self
.
searchUrl
.
replace
(
'**'
,
key
).
replace
(
'fypage'
,
pg
)
if
not
str
(
url
).
startswith
(
'http'
):
url
=
urljoin
(
self
.
url
,
url
)
print
(
url
)
headers
=
{
'user-agent'
:
self
.
ua
}
r
=
requests
.
get
(
url
,
headers
=
headers
)
html
=
r
.
text
p
=
self
.
搜索
.
split
(
';'
)
# 解析
jsp
=
jsoup
(
self
.
url
)
pdfh
=
jsp
.
pdfh
pdfa
=
jsp
.
pdfa
pd
=
jsp
.
pd
pq
=
jsp
.
pq
items
=
pdfa
(
html
,
p
[
0
])
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
,
})
result
=
{
'list'
:
videos
}
return
result
if
__name__
==
'__main__'
:
from
utils
import
parser
js_path
=
f
'js/鸭奈飞.js'
...
...
@@ -227,4 +265,5 @@ if __name__ == '__main__':
print
(
cms
.
title
)
# print(cms.homeContent())
# cms.categoryContent('dianying',1)
print
(
cms
.
detailContent
([
'67391'
]))
\ No newline at end of file
# print(cms.detailContent(['67391']))
print
(
cms
.
searchContent
(
'斗罗大陆'
))
\ No newline at end of file
pycms.json
浏览文件 @
a66ba75e
...
...
@@ -2,7 +2,7 @@
"key"
:
"dr_yanaifei"
,
"name"
:
"鸭奈飞"
,
"type"
:
4
,
"api"
:
"http://1
27.0.0.1
:9000/vod?rule=鸭奈飞"
,
"api"
:
"http://1
92.168.10.99
:9000/vod?rule=鸭奈飞"
,
"searchable"
:
1
,
"quickSearch"
:
1
,
"filterable"
:
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录