Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianxiawei
dr_py
提交
ada41745
dr_py
项目概览
tianxiawei
/
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,发现更多精彩内容 >>
提交
ada41745
编写于
9月 02, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加养端源
上级
e0357095
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
1 deletion
+33
-1
classes/cms.py
classes/cms.py
+7
-1
js/养端.js
js/养端.js
+17
-0
models/rules.db
models/rules.db
+0
-0
utils/web.py
utils/web.py
+9
-0
未找到文件。
classes/cms.py
浏览文件 @
ada41745
...
@@ -74,7 +74,10 @@ class CMS:
...
@@ -74,7 +74,10 @@ class CMS:
url
=
rule
.
get
(
'url'
,
''
)
url
=
rule
.
get
(
'url'
,
''
)
detailUrl
=
rule
.
get
(
'detailUrl'
,
''
)
detailUrl
=
rule
.
get
(
'detailUrl'
,
''
)
searchUrl
=
rule
.
get
(
'searchUrl'
,
''
)
searchUrl
=
rule
.
get
(
'searchUrl'
,
''
)
headers
=
rule
.
get
(
'headers'
,{})
default_headers
=
getHeaders
(
host
)
self_headers
=
rule
.
get
(
'headers'
,{})
default_headers
.
update
(
self_headers
)
headers
=
default_headers
cookie
=
self
.
getCookie
()
cookie
=
self
.
getCookie
()
# print(f'{self.title}cookie:{cookie}')
# print(f'{self.title}cookie:{cookie}')
if
cookie
:
if
cookie
:
...
@@ -97,6 +100,7 @@ class CMS:
...
@@ -97,6 +100,7 @@ class CMS:
headers
[
'User-Agent'
]
=
UA
headers
[
'User-Agent'
]
=
UA
if
not
'referer'
in
lower_keys
:
if
not
'referer'
in
lower_keys
:
headers
[
'Referer'
]
=
host
headers
[
'Referer'
]
=
host
# print(headers)
self
.
headers
=
headers
self
.
headers
=
headers
self
.
host
=
host
self
.
host
=
host
self
.
homeUrl
=
urljoin
(
host
,
homeUrl
)
if
host
and
homeUrl
else
homeUrl
self
.
homeUrl
=
urljoin
(
host
,
homeUrl
)
if
host
and
homeUrl
else
homeUrl
...
@@ -331,6 +335,7 @@ class CMS:
...
@@ -331,6 +335,7 @@ class CMS:
'type_id'
:
class_urls
[
i
]
'type_id'
:
class_urls
[
i
]
})
})
# print(self.url)
# print(self.url)
print
(
self
.
headers
)
has_cache
=
False
has_cache
=
False
if
self
.
homeUrl
.
startswith
(
'http'
):
if
self
.
homeUrl
.
startswith
(
'http'
):
# print(self.homeUrl)
# print(self.homeUrl)
...
@@ -504,6 +509,7 @@ class CMS:
...
@@ -504,6 +509,7 @@ class CMS:
r
.
encoding
=
self
.
encoding
r
.
encoding
=
self
.
encoding
print
(
r
.
url
)
print
(
r
.
url
)
html
=
r
.
text
html
=
r
.
text
# print(html)
items
=
pdfa
(
html
,
p
[
0
])
items
=
pdfa
(
html
,
p
[
0
])
except
:
except
:
pass
pass
...
...
js/养端.js
0 → 100644
浏览文件 @
ada41745
var
rule
=
{
title
:
'
养端
'
,
host
:
'
https://aaq48.com:33666
'
,
homeUrl
:
'
/home/index.html
'
,
url
:
'
/home/vodlist/38/fyclass-fypage.html
'
,
headers
:{
'
User-Agent
'
:
'
MOBILE_UA
'
},
timeout
:
5000
,
class_parse
:
'
.menu&&dl&ⅆa&&Text;a&&href;.*/(.*?)-
'
,
limit
:
5
,
play_parse
:
true
,
lazy
:
''
,
一级
:
'
.channel-list&&dl;h3&&Text;img&&data-original;font&&Text;a&&href
'
,
二级
:
'
*
'
,
}
\ No newline at end of file
models/rules.db
浏览文件 @
ada41745
无法预览此类型文件
utils/web.py
浏览文件 @
ada41745
...
@@ -87,3 +87,12 @@ def verfy_token(token=''):
...
@@ -87,3 +87,12 @@ def verfy_token(token=''):
if
token
!=
ctoken
:
if
token
!=
ctoken
:
return
False
return
False
return
True
return
True
def
getHeaders
(
url
):
headers
=
{}
if
url
:
headers
.
setdefault
(
"Referer"
,
url
)
headers
.
setdefault
(
"User-Agent"
,
PC_UA
)
headers
.
setdefault
(
"Accept"
,
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
)
headers
.
setdefault
(
"Accept-Language"
,
"zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
)
return
headers
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录