Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jxt000123
dr_py
提交
fea19c75
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,发现更多精彩内容 >>
提交
fea19c75
编写于
8月 30, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了对源是否启用搜索的独立配置
上级
8e47c7b3
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
101 addition
and
34 deletion
+101
-34
app.py
app.py
+33
-5
classes/cms.py
classes/cms.py
+1
-1
config.py
config.py
+4
-2
js/555影视.js
js/555影视.js
+2
-0
js/cokemv.js
js/cokemv.js
+2
-0
js/喵喵.js
js/喵喵.js
+2
-0
js/夜空.js
js/夜空.js
+5
-2
js/干饭影视.js
js/干饭影视.js
+2
-0
js/模板.js
js/模板.js
+2
-0
js/瓜皮TV.js
js/瓜皮TV.js
+2
-0
js/看视界.js
js/看视界.js
+5
-2
js/莫扎兔.js
js/莫扎兔.js
+2
-0
js/蓝莓影视.js
js/蓝莓影视.js
+3
-1
js/鸭奈飞.js
js/鸭奈飞.js
+2
-0
readme.md
readme.md
+8
-0
templates/config.txt
templates/config.txt
+11
-11
templates/index.html
templates/index.html
+11
-7
utils/web.py
utils/web.py
+4
-3
未找到文件。
app.py
浏览文件 @
fea19c75
...
...
@@ -5,6 +5,7 @@
# Date : 2022/8/25
import
random
import
js2py
from
flask_sqlalchemy
import
SQLAlchemy
import
config
# import settings
...
...
@@ -34,7 +35,7 @@ db = SQLAlchemy(app)
rule_list
=
getRuleLists
()
logger
.
info
(
rule_list
)
logger
.
info
(
f
'
http://
{
getHost
(
1
,
5705
)
}
/index
\n
http://localhost:5705
/index'
)
logger
.
info
(
f
'
局域网:
{
getHost
(
1
,
5705
)
}
/index
\n
本地:
{
getHost
(
0
,
5705
)
}
/index'
)
from
models
import
*
from
gevent.pywsgi
import
WSGIServer
...
...
@@ -69,9 +70,13 @@ def forbidden(): # put application's code here
@
app
.
route
(
'/index'
)
def
index
():
# put application's code here
# logger.info("进入了首页")
manager
=
getHost
(
1
).
split
(
':'
)[
0
]
+
':9001'
manager2
=
getHost
(
0
).
split
(
':'
)[
0
]
+
':9001'
return
render_template
(
'index.html'
,
getHost
=
getHost
,
manager
=
manager
,
manager2
=
manager2
,
is_linux
=
is_linux
())
sup_port
=
app
.
config
.
get
(
'SUP_PORT'
,
9001
)
manager0
=
':'
.
join
(
getHost
(
0
).
split
(
':'
)[
0
:
2
])
+
f
':
{
sup_port
}
'
manager1
=
':'
.
join
(
getHost
(
1
).
split
(
':'
)[
0
:
2
])
+
f
':
{
sup_port
}
'
manager2
=
':'
.
join
(
getHost
(
2
).
split
(
':'
)[
0
:
2
])
+
f
':
{
sup_port
}
'
# print(manager2)
# print(manager2)
return
render_template
(
'index.html'
,
getHost
=
getHost
,
manager0
=
manager0
,
manager1
=
manager1
,
manager2
=
manager2
,
is_linux
=
is_linux
())
@
app
.
route
(
'/vod'
)
def
vod
():
...
...
@@ -155,6 +160,7 @@ def clear():
return
jsonify
(
error
.
success
(
'成功删除文件:'
+
cache_path
))
def
getRules
(
path
=
'cache'
):
t1
=
time
()
base_path
=
path
+
'/'
# 当前文件所在目录
# print(base_path)
os
.
makedirs
(
base_path
,
exist_ok
=
True
)
...
...
@@ -162,7 +168,29 @@ def getRules(path='cache'):
file_name
=
list
(
filter
(
lambda
x
:
str
(
x
).
endswith
(
'.js'
)
and
str
(
x
).
find
(
'模板'
)
<
0
,
file_name
))
# print(file_name)
rule_list
=
[
file
.
replace
(
'.js'
,
''
)
for
file
in
file_name
]
rules
=
{
'list'
:
rule_list
,
'count'
:
len
(
rule_list
)}
js_path
=
[
f
'
{
path
}
/
{
rule
}
.js'
for
rule
in
rule_list
]
with
open
(
'js/模板.js'
,
encoding
=
'utf-8'
)
as
f
:
before
=
f
.
read
()
rule_codes
=
[]
for
js
in
js_path
:
with
open
(
js
,
encoding
=
'utf-8'
)
as
f
:
rule_codes
.
append
(
js2py
.
eval_js
(
before
+
f
.
read
()))
# print(rule_codes)
# print(type(rule_codes[0]),rule_codes[0])
# print(rule_codes[0].title)
# print(rule_codes[0].searchable)
# print(rule_codes[0].quickSearch)
new_rule_list
=
[]
for
i
in
range
(
len
(
rule_list
)):
new_rule_list
.
append
({
'name'
:
rule_list
[
i
],
'searchable'
:
rule_codes
[
i
].
searchable
or
0
,
'quickSearch'
:
rule_codes
[
i
].
quickSearch
or
0
})
# print(new_rule_list)
rules
=
{
'list'
:
new_rule_list
,
'count'
:
len
(
rule_list
)}
logger
.
info
(
f
'自动配置装载耗时:
{
get_interval
(
t1
)
}
毫秒'
)
return
rules
def
getPics
(
path
=
'images'
):
...
...
classes/cms.py
浏览文件 @
fea19c75
...
...
@@ -39,7 +39,7 @@ class CMS:
# 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
(
1
))
play_url
=
new_conf
.
get
(
'PLAY_URL'
,
getHost
(
2
))
if
not
play_url
.
startswith
(
'http'
):
play_url
=
'http://'
+
play_url
if
self
.
play_parse
:
...
...
config.py
浏览文件 @
fea19c75
...
...
@@ -17,9 +17,11 @@ SQLALCHEMY_DATABASE_URI = DB_URI
SQLALCHEMY_TRACK_MODIFICATIONS
=
False
SQLALCHEMY_ECHO
=
False
# 打印sql语句
JSON_AS_ASCII
=
False
# jsonify返回的中文正常显示
# PLAY_URL = 'http://localhost:5705' # 匹配远程解析服务器链接
#
PLAY_URL = PLAY_URL.rstrip('/')
PLAY_URL
=
'http://cms.nokia.press'
# 匹配远程解析服务器链接 远程接口主页地址,后面不能有/
PLAY_URL
=
PLAY_URL
.
rstrip
(
'/'
)
PLAY_DISABLE
=
False
# 全局禁用播放解析
LAZYPARSE_MODE
=
1
# 播放解析模式(0 本地 1 局域网 2远程 仅在全局禁用为False的时候生效)
WALL_PAPER_ENABLE
=
True
# 启用自定义壁纸
WALL_PAPER
=
"https://picsum.photos/1280/720/?blur=10"
# 自定义壁纸,可注释
SUP_PORT
=
9001
# supervisord 服务端口
# {% if config.WALL_PAPER %}"wallpaper":"{{ config.WALL_PAPER }}",{% endif %}
\ No newline at end of file
js/555影视.js
浏览文件 @
fea19c75
...
...
@@ -4,6 +4,8 @@ var rule = {
// homeUrl:'/',
url
:
'
/vodshow/fyclass--------fypage---.html
'
,
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
1
,
quickSearch
:
1
,
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
...
...
js/cokemv.js
浏览文件 @
fea19c75
...
...
@@ -4,6 +4,8 @@ var rule = {
// homeUrl:'/',
url
:
'
/vodshow/fyclass--------fypage---.html
'
,
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
0
,
quickSearch
:
0
,
headers
:{
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
showBtn=true;PHPSESSID=58nhbq5r54jivukrk4o27dn7m6
"
...
...
js/喵喵.js
浏览文件 @
fea19c75
...
...
@@ -4,6 +4,8 @@ var rule = {
// homeUrl:'/',
url
:
'
/t/fyclass/fypage.html
'
,
searchUrl
:
'
/s/**/fypage.html
'
,
searchable
:
1
,
quickSearch
:
1
,
headers
:{
'
User-Agent
'
:
'
UC_UA
'
},
...
...
js/夜空.js
浏览文件 @
fea19c75
...
...
@@ -2,6 +2,8 @@ var rule = Object.assign(muban.mxpro,{
title
:
'
夜空
'
,
host
:
'
https://www.yekong.cc
'
,
url
:
'
/pianku-fyclass--------fypage---/
'
,
searchUrl
:
'
/search-**----------fypage---/
'
,
class_parse
:
'
.navbar-items li:gt(1):lt(7);a&&Text;a&&href;.*v/(.*?)/
'
,
searchUrl
:
'
/search-**----------fypage---/
'
,
searchable
:
0
,
quickSearch
:
0
,
class_parse
:
'
.navbar-items li:gt(1):lt(7);a&&Text;a&&href;.*v/(.*?)/
'
,
});
\ No newline at end of file
js/干饭影视.js
浏览文件 @
fea19c75
...
...
@@ -7,6 +7,8 @@ var rule = {
'
User-Agent
'
:
'
MOBILE_UA
'
},
searchUrl
:
'
/search/**-fypage.html
'
,
searchable
:
1
,
quickSearch
:
1
,
// 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/模板.js
浏览文件 @
fea19c75
...
...
@@ -17,6 +17,8 @@ var muban = {
// homeUrl:'/',
url
:
'
/vodshow/fyclass--------fypage---.html
'
,
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
0
,
//是否启用全局搜索,
quickSearch
:
0
,
//是否启用快速搜索,
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
...
...
js/瓜皮TV.js
浏览文件 @
fea19c75
...
...
@@ -4,6 +4,8 @@ var rule = {
// homeUrl:'/',
url
:
'
/vodshow/fyclass--------fypage---.html
'
,
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
0
,
quickSearch
:
0
,
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
...
...
js/看视界.js
浏览文件 @
fea19c75
...
...
@@ -2,6 +2,8 @@ var rule = Object.assign(muban.mxpro,{
title
:
'
看视界
'
,
host
:
'
https://www.1080kan.cc
'
,
url
:
'
/show/fyclass--------fypage---.html
'
,
searchUrl
:
'
/search/**-------------.html
'
,
class_parse
:
'
.navbar-items li:gt(1):lt(6);a&&Text;a&&href;.*/(.*?).html
'
,
searchUrl
:
'
/search/**-------------.html
'
,
searchable
:
0
,
quickSearch
:
0
,
class_parse
:
'
.navbar-items li:gt(1):lt(6);a&&Text;a&&href;.*/(.*?).html
'
,
});
\ No newline at end of file
js/莫扎兔.js
浏览文件 @
fea19c75
...
...
@@ -4,6 +4,8 @@ var rule = {
// homeUrl:'/',
url
:
'
/index.php/vod/show/id/fyclass/page/fypage.html
'
,
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
0
,
quickSearch
:
0
,
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
...
...
js/蓝莓影视.js
浏览文件 @
fea19c75
var
rule
=
{
title
:
'
蓝莓影视
1
'
,
title
:
'
蓝莓影视
'
,
host
:
'
https://lanmeiguojiang.com
'
,
// homeUrl:'/',
url
:
'
/show/fyclass--------fypage---.html
'
,
...
...
@@ -7,6 +7,8 @@ var rule = {
'
User-Agent
'
:
'
MOBILE_UA
'
},
searchUrl
:
'
/search/**-fypage.html
'
,
searchable
:
1
,
quickSearch
:
1
,
// class_name:'电影&网剧&剧集&动漫&综艺&记录',
// class_url:'20&1&2&3&4&23',
class_parse
:
'
.navbar-items li:gt(1):lt(8);a&&Text;a&&href;/(
\\
d+).html
'
,
...
...
js/鸭奈飞.js
浏览文件 @
fea19c75
...
...
@@ -5,6 +5,8 @@ var rule = {
url
:
'
/vodshow/fyclass--------fypage---.html
'
,
detailUrl
:
'
https://yanetflix.com/voddetail/fyid.html
'
,
//非必填
searchUrl
:
'
/vodsearch/**----------fypage---.html
'
,
searchable
:
0
,
quickSearch
:
0
,
// class_name:'电影&连续剧&综艺&动漫',
// class_url:'dianying&lianxuju&zongyi&dongman',
class_parse
:
'
.navbar-items li:gt(1):lt(6);a&&Text;a&&href;.*/(.*?).html
'
,
...
...
readme.md
浏览文件 @
fea19c75
...
...
@@ -6,6 +6,9 @@
-
[X] 3.增加视界的加密库
-
[X] 4.增加蓝莓影视免嗅探
-
[X] 5.增加免嗅耗时毫秒数统计
-
[X] 6.增加自动装载配置
-
[X] 7.增加js里单独设置某个源是否可搜索
-
[X] 8.增加外网免嗅(自定义config.py里面改)
###### 2022/08/29
-
[X] 1.更换js引擎,速度更快性能更好
-
[X] 2.新版js支持与python互动,后期可能支持js免嗅(lazy:'js:xxx')
...
...
@@ -60,6 +63,7 @@
[
远程服务配置地址
](
http://cms.nokia.press/config/2
)
### 配置相关
直接复制对应的三种地址就行了,不需要生成本地文件(下面教程不要了)
本地地址 clan://localhost/pycms_local.json
推荐把文件放到 /storage/emulated/0/PlutoPlayer/pycms_local.json
并且pluto要自己切换路径为PlutoPlayer
...
...
@@ -78,6 +82,10 @@ var rule = {
url
:
'
/fyclass/fypage.html[/fyclass/]
'
,
//网站的分类页面链接
detailUrl
:
'
https://yanetflix.com/voddetail/fyid.html
'
,
//非必填,二级详情拼接链接,感觉没啥卵用
searchUrl
:
''
,
//搜索链接 可以是完整路径或者相对路径,用于分类获取和推荐获取 **代表搜索词 fypage代表页数
searchable
:
0
,
//是否启用全局搜索,
quickSearch
:
0
,
//是否启用快速搜索,
// 注意,由于猫有配置缓存,搜索配置没法热加载,修改了js不需要重启服务器
// 但是需要tv_box进设置里换源使配置重新装载
headers
:{
//网站的请求头,完整支持所有的,常带ua和cookies
'
User-Agent
'
:
'
MOBILE_UA
'
,
"
Cookie
"
:
"
searchneed=ok
"
...
...
templates/config.txt
浏览文件 @
fea19c75
{
{% if config.WALL_PAPER_ENABLE %}"wallpaper":"
http://
{{ host }}/pics",{% endif %}
{% if config.WALL_PAPER_ENABLE %}"wallpaper":"{{ host }}/pics",{% endif %}
"dr_count": {{rules.list|length}},
"mode": {{ mode }},
"sites": [{% for rule in rules.list %}{% if mode == 0 %}
{
"key":"dr_{{ rule }}",
"name":"{{ rule }}(道长)",
"key":"dr_{{ rule
.name
}}",
"name":"{{ rule
.name
}}(道长)",
"type":1,
"api":"
http://{{ host }}/vod?rule={{ rul
e }}",
"searchable":
1
,
"quickSearch":
1
,
"api":"
{{ host }}/vod?rule={{ rule.nam
e }}",
"searchable":
{{ rule.searchable }}
,
"quickSearch":
{{ rule.quickSearch }}
,
"filterable": 1
}{% else %}
{
"key":"dr_{{ rule }}",
"name":"{{ rule }}(道长)",
"key":"dr_{{ rule
.name
}}",
"name":"{{ rule
.name
}}(道长)",
"type":1,
"api":"
http://{{ host }}/vod?rule={{ rul
e }}",
"searchable":
1
,
"quickSearch":
1
,
"api":"
{{ host }}/vod?rule={{ rule.nam
e }}",
"searchable":
{{ rule.searchable }}
,
"quickSearch":
{{ rule.quickSearch }}
,
"filterable": 1
}{% endif %}{% if loop.last==False %},{% endif %}{% endfor %}],
"parses": [{
...
...
templates/index.html
浏览文件 @
fea19c75
...
...
@@ -66,32 +66,36 @@ a {
<a
href=
"/raw"
>
缓存文件列表-查看
</a>
</div>
<div
class=
"btn"
>
<a
href=
"
http://
{{ getHost(0) }}/config/0"
>
本地配置地址
</a>
<a
href=
"{{ getHost(0) }}/config/0"
>
本地配置地址
</a>
</div>
{% if is_linux %}
<div
class=
"btn"
>
<a
href=
"
http://{{ manager2
}}"
target=
"_blank"
>
本地在线进程管理[linux]
</a>
<a
href=
"
{{ manager0
}}"
target=
"_blank"
>
本地在线进程管理[linux]
</a>
</div>
{% endif %}
<!--<a href="{{ getHost(1) }}">局域网:{{ getHost(1) }}</a>-->
<a
class=
"jyw"
href=
"https://picsum.photos/1280/720/?blur=10"
>
局域网:{{ getHost(1) }}
</a>
{% if '192.168' in getHost(1) %}
<div
class=
"btn"
>
<a
href=
"
http://
{{ getHost(1) }}/config/1"
>
局域网配置地址
</a>
<a
href=
"{{ getHost(1) }}/config/1"
>
局域网配置地址
</a>
</div>
{% if is_linux %}
<div
class=
"btn"
>
<a
href=
"
http://{{ manager
}}"
target=
"_blank"
>
局域网在线进程管理[linux]
</a>
<a
href=
"
{{ manager1
}}"
target=
"_blank"
>
局域网在线进程管理[linux]
</a>
</div>
{% endif %}
<div
class=
"btn"
>
<a
href=
"
http://
{{ getHost(1) }}/pics"
target=
"_blank"
>
局域网随机图片
</a>
<a
href=
"{{ getHost(1) }}/pics"
target=
"_blank"
>
局域网随机图片
</a>
</div>
{% endif %}
<div
class=
"btn"
>
<a
href=
"
http://
{{ getHost(2) }}/config/2"
>
远程配置地址
</a>
<a
href=
"{{ getHost(2) }}/config/2"
>
远程配置地址
</a>
</div>
{% if is_linux %}
<div
class=
"btn"
>
<a
href=
"{{ manager2 }}"
target=
"_blank"
>
远程在线进程管理[linux]
</a>
</div>
{% endif %}
<div
class=
"btn"
>
<a
href=
"javascript:void(0);"
id=
"gen_config"
>
生成配置文件
</a>
</div>
...
...
utils/web.py
浏览文件 @
fea19c75
...
...
@@ -18,6 +18,7 @@ headers = {
'user-agent'
:
UA
,
}
from
time
import
time
import
config
as
settings
def
get_host_ip2
():
# 获取局域网ip
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
...
...
@@ -47,13 +48,13 @@ def getHost(mode=0,port=None):
# print(ip)
# mode 为0是本地,1是局域网 2是线上
if
mode
==
0
:
host
=
f
'localhost:
{
port
}
'
host
=
f
'
http://
localhost:
{
port
}
'
elif
mode
==
1
:
REAL_IP
=
get_host_ip
()
ip
=
REAL_IP
host
=
f
'
{
ip
}
:
{
port
}
'
host
=
f
'
http://
{
ip
}
:
{
port
}
'
else
:
host
=
'cms.nokia.press'
host
=
get_conf
(
settings
).
get
(
'PLAY_URL'
,
'http://cms.nokia.press'
)
return
host
def
get_conf
(
obj
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录