Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
言程序plus
dr_py
提交
312d6215
dr_py
项目概览
言程序plus
/
dr_py
与 Fork 源项目一致
从无法访问的项目Fork
通知
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,发现更多精彩内容 >>
提交
312d6215
编写于
9月 13, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了蓝莓影视筛选示例
上级
ec281cb0
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
64 addition
and
9 deletion
+64
-9
controllers/cms.py
controllers/cms.py
+17
-9
js/蓝莓影视.js
js/蓝莓影视.js
+0
-0
py/mxpro筛选.py
py/mxpro筛选.py
+47
-0
未找到文件。
controllers/cms.py
浏览文件 @
312d6215
...
@@ -621,6 +621,22 @@ class CMS:
...
@@ -621,6 +621,22 @@ class CMS:
t1
=
time
()
t1
=
time
()
pg
=
str
(
fypage
)
pg
=
str
(
fypage
)
url
=
self
.
url
.
replace
(
'fyclass'
,
fyclass
)
url
=
self
.
url
.
replace
(
'fyclass'
,
fyclass
)
if
self
.
filter_url
:
if
not
'fyfilter'
in
url
:
# 第一种情况,默认不写fyfilter关键字,视为直接拼接在链接后面当参数
if
not
url
.
endswith
(
'&'
)
and
not
self
.
filter_url
.
startswith
(
'&'
):
url
+=
'&'
url
+=
self
.
filter_url
else
:
# 第二种情况直接替换关键字为待拼接的结果后面渲染,适用于 ----fypage.html的情况
url
=
url
.
replace
(
'fyfilter'
,
self
.
filter_url
)
url
=
render_template_string
(
url
,
fl
=
fl
)
# fl_url = render_template_string(self.filter_url,fl=fl)
# if not 'fyfilter' in url: # 第一种情况,默认不写fyfilter关键字,视为直接拼接在链接后面当参数
# if not url.endswith('&') and not fl_url.startswith('&'):
# url += '&'
# url += fl_url
# else: # 第二种情况直接替换关键字为渲染后的结果,适用于 ----fypage.html的情况
# url = url.replace('fyfilter',fl_url)
if
url
.
find
(
'fypage'
)
>
-
1
:
if
url
.
find
(
'fypage'
)
>
-
1
:
if
'('
in
url
and
')'
in
url
:
if
'('
in
url
and
')'
in
url
:
# url_rep = url[url.find('('):url.find(')')+1]
# url_rep = url[url.find('('):url.find(')')+1]
...
@@ -639,15 +655,7 @@ class CMS:
...
@@ -639,15 +655,7 @@ class CMS:
url
=
url
.
replace
(
'fypage'
,
pg
)
url
=
url
.
replace
(
'fypage'
,
pg
)
if
fypage
==
1
and
self
.
test
(
'[\[\]]'
,
url
):
if
fypage
==
1
and
self
.
test
(
'[\[\]]'
,
url
):
url
=
url
.
split
(
'['
)[
1
].
split
(
']'
)[
0
]
url
=
url
.
split
(
'['
)[
1
].
split
(
']'
)[
0
]
if
self
.
filter_url
:
# print(url)
fl_url
=
render_template_string
(
self
.
filter_url
,
fl
=
fl
)
if
not
'fyfilter'
in
url
:
# 第一种情况,默认不写fyfilter关键字,视为直接拼接在链接后面当参数
if
not
url
.
endswith
(
'&'
)
and
not
fl_url
.
startswith
(
'&'
):
url
+=
'&'
url
+=
fl_url
else
:
# 第二种情况直接替换关键字为渲染后的结果,适用于 ----fypage.html的情况
url
=
url
.
replace
(
'fyfilter'
,
fl_url
)
print
(
url
)
p
=
self
.
一级
p
=
self
.
一级
jsp
=
jsoup
(
self
.
url
)
jsp
=
jsoup
(
self
.
url
)
videos
=
[]
videos
=
[]
...
...
js/蓝莓影视.js
浏览文件 @
312d6215
此差异已折叠。
点击以展开。
py/mxpro筛选.py
0 → 100644
浏览文件 @
312d6215
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : mxpro筛选.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/13
import
re
import
requests
from
utils.htmlParser
import
jsoup
headers
=
{
'user-agent'
:
'Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36'
}
def
getFilters
(
url
):
cate_id
=
str
(
re
.
search
(
'.*/(\d+)'
,
url
).
groups
()[
0
])
print
(
cate_id
)
jsp
=
jsoup
(
url
)
pdfh
=
jsp
.
pdfh
pdfa
=
jsp
.
pdfa
print
(
jsp
)
r
=
requests
.
get
(
url
,
headers
=
headers
)
r
.
encoding
=
r
.
apparent_encoding
html
=
r
.
text
cls_list
=
pdfa
(
html
,
'.module-class&&.module-class-items'
)
print
(
len
(
cls_list
))
ft_dict
=
{
cate_id
:[]}
for
cls
in
cls_list
:
tt
=
pdfh
(
cls
,
'.module-item-title&&Text'
)
values
=
pdfa
(
cls
,
'.module-item-box&&a'
)
# vl = [{"n":pdfh(i,'a&&Text'),"v":pdfh(i,'a&&href')} for i in values]
vl
=
[{
"n"
:
pdfh
(
i
,
'a&&Text'
),
"v"
:
re
.
search
(
'(.*?)-(.*)'
,
pdfh
(
i
,
'a&&href'
),
re
.
M
|
re
.
I
|
re
.
S
).
groups
()[
1
].
replace
(
'.html'
,
''
).
replace
(
'-'
,
''
)}
for
i
in
values
]
ft_dict
[
cate_id
].
append
({
'key'
:
tt
,
'name'
:
tt
,
'value'
:
vl
})
print
(
ft_dict
)
return
ft_dict
if
__name__
==
'__main__'
:
new_dict
=
{}
for
i
in
'20&1&2&3&4&23'
.
split
(
'&'
):
ft_dict
=
getFilters
(
f
'https://lanmeiguojiang.com/show/
{
i
}
-----------.html'
)
new_dict
.
update
(
ft_dict
)
print
(
new_dict
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录