Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lsj315820
dr_py
提交
0757eebb
dr_py
项目概览
lsj315820
/
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,发现更多精彩内容 >>
提交
0757eebb
编写于
9月 10, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加py源开关
上级
05c8832d
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
116 addition
and
9 deletion
+116
-9
base/config.py
base/config.py
+1
-0
controllers/admin.py
controllers/admin.py
+24
-1
controllers/home.py
controllers/home.py
+9
-3
controllers/service.py
controllers/service.py
+4
-0
js/version.txt
js/version.txt
+1
-1
models/rules.db
models/rules.db
+0
-0
readme.md
readme.md
+2
-1
templates/admin.html
templates/admin.html
+16
-0
templates/config.txt
templates/config.txt
+2
-0
txt/pycms0.json
txt/pycms0.json
+19
-1
txt/pycms1.json
txt/pycms1.json
+19
-1
txt/pycms2.json
txt/pycms2.json
+19
-1
未找到文件。
base/config.py
浏览文件 @
0757eebb
...
...
@@ -31,6 +31,7 @@ RETRY_CNT = 3 # 验证码重试次数
OCR_API
=
'http://dm.mudery.com:10000'
# 验证码识别接口,传参数data
UNAME
=
'admin'
# 管理员账号
PWD
=
'drpy'
# 管理员密码
USE_PY
=
0
# 开启py源
MAX_CONTENT_LENGTH
=
1
*
1024
*
1024
/
100
# 100 kB
LIVE_MODE
=
0
# 0 本地 1外网
LIVE_URL
=
'https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/zb.txt'
# 初始化外网直播地址(后续在管理界面改)
...
...
controllers/admin.py
浏览文件 @
0757eebb
...
...
@@ -33,11 +33,13 @@ admin = Blueprint("admin", __name__)
def
admin_index
():
# 管理员界面
lsg
=
storage_service
()
live_url
=
lsg
.
getItem
(
'LIVE_URL'
)
use_py
=
lsg
.
getItem
(
'USE_PY'
)
print
(
f
'live_url:'
,
live_url
)
if
not
verfy_token
():
return
render_template
(
'login.html'
)
live_url
=
lsg
.
getItem
(
'LIVE_URL'
)
return
render_template
(
'admin.html'
,
rules
=
getRules
(
'js'
),
ver
=
getLocalVer
(),
live_url
=
live_url
)
return
render_template
(
'admin.html'
,
pystate
=
use_py
,
rules
=
getRules
(
'js'
),
ver
=
getLocalVer
(),
live_url
=
live_url
)
@
admin
.
route
(
"/view/<name>"
,
methods
=
[
'GET'
])
def
admin_view_rule
(
name
):
...
...
@@ -115,6 +117,27 @@ def admin_write_live_url():
msg
=
f
'已修改的配置记录id为:
{
id
}
'
return
R
.
success
(
msg
)
@
admin
.
route
(
'/change_use_py'
)
def
admin_change_use_py
():
if
not
verfy_token
():
return
R
.
failed
(
'请登录后再试'
)
lsg
=
storage_service
()
use_py
=
lsg
.
getItem
(
'USE_PY'
)
new_use_py
=
''
if
use_py
else
'1'
state
=
'开启'
if
new_use_py
else
'关闭'
id
=
lsg
.
setItem
(
'USE_PY'
,
new_use_py
)
msg
=
f
'已修改的配置记录id为:
{
id
}
,结果为
{
state
}
'
return
R
.
success
(
msg
)
# @admin.route('/get_use_py')
# def admin_get_use_py():
# if not verfy_token():
# return R.failed('请登录后再试')
# lsg = storage_service()
# use_py = lsg.getItem('USE_PY')
# state = 1 if use_py else 0
# return R.success(state)
@
admin
.
route
(
'/upload'
,
methods
=
[
'GET'
,
'POST'
])
def
upload_file
():
if
not
verfy_token
():
...
...
controllers/home.py
浏览文件 @
0757eebb
...
...
@@ -180,8 +180,11 @@ def config_render(mode):
except
Exception
as
e
:
logger
.
info
(
f
'用户自定义配置加载失败:
{
e
}
'
)
jxs
=
getJxs
()
pys
=
getPys
()
print
(
pys
)
lsg
=
storage_service
()
use_py
=
lsg
.
getItem
(
'USE_PY'
)
# pys = getPys() if cfg.get('USE_PY') else []
pys
=
getPys
()
if
use_py
else
[]
# print(pys)
alists
=
getAlist
()
alists_str
=
json
.
dumps
(
alists
,
ensure_ascii
=
False
)
live_url
=
get_live_url
(
new_conf
,
mode
)
...
...
@@ -201,7 +204,10 @@ def config_gen():
os
.
makedirs
(
'txt'
,
exist_ok
=
True
)
new_conf
=
cfg
jxs
=
getJxs
()
pys
=
getPys
()
# pys = getPys() if cfg.get('USE_PY') else []
lsg
=
storage_service
()
use_py
=
lsg
.
getItem
(
'USE_PY'
)
pys
=
getPys
()
if
use_py
else
False
alists
=
getAlist
()
alists_str
=
json
.
dumps
(
alists
,
ensure_ascii
=
False
)
set_local
=
render_template
(
'config.txt'
,
pys
=
pys
,
rules
=
getRules
(
'js'
),
alists
=
alists
,
alists_str
=
alists_str
,
live_url
=
get_live_url
(
new_conf
,
0
),
mode
=
0
,
host
=
getHost
(
0
),
jxs
=
jxs
)
...
...
controllers/service.py
浏览文件 @
0757eebb
...
...
@@ -21,6 +21,10 @@ class storage_service(object):
print
(
'开始初始化lsg'
)
self
.
setItem
(
'LIVE_URL'
,
cfg
.
get
(
'LIVE_URL'
))
# if not self.getItem('USE_PY'):
# print('开始初始化USE_PY')
# self.setItem('USE_PY', '1' if cfg.get('USE_PY') else '')
@
classmethod
def
getItem
(
self
,
key
,
value
=
''
):
return
Storage
.
getItem
(
key
,
value
)
...
...
js/version.txt
浏览文件 @
0757eebb
3.4.5
\ No newline at end of file
3.4.7
\ No newline at end of file
models/rules.db
浏览文件 @
0757eebb
无法预览此类型文件
readme.md
浏览文件 @
0757eebb
...
...
@@ -48,7 +48,8 @@
[
获取本地设备信息
](
https://m.jb51.net/article/140716.htm
)
###### 2022/09/10
-
[X] 1.升级至3.4.4.增加小强迷源,增加二级重定向属性(提供重定向后的源码,让代码重新取重定向过后的线路和播放列表)
-
[X] 1.升级至3.4.5.增加兔小贝儿歌源,优化json:细节处理以及详情页拼接细节
-
[X] 2.升级至3.4.5.增加兔小贝儿歌源,优化json:细节处理以及详情页拼接细节
-
[X] 3.升级至3.4.7 后台管理增加了py源开关
###### 2022/09/09
-
[X] 1.增加西瓜源,修复一级不支持lazy的bug
-
[X] 2.兄弟们dockerhub没法push镜像不知道咋回事,3.4.1的镜像自己用docker目录下的文件build吧
...
...
templates/admin.html
浏览文件 @
0757eebb
...
...
@@ -164,6 +164,20 @@
}
});
$
(
'
#use_py
'
).
click
(
function
(){
$
.
get
(
"
/admin/change_use_py
"
,
function
(
data
,
status
){
console
.
log
(
data
);
if
(
data
.
code
===
200
){
alert
(
data
.
msg
);
location
.
reload
();
}
else
{
alert
(
data
.
msg
);
console
.
log
(
'
升级失败了...
'
);
return
false
}
});
});
});
function
getFileSize
(
fileObj
)
{
$
(
'
#file_size
'
).
text
(
'
文件大小为:
'
+
fileObj
.
files
[
0
].
size
/
1024
+
'
kb
'
);
...
...
@@ -184,6 +198,8 @@ function getFileSize(fileObj) {
id=
"write_lives"
>
修改直播源
</a></button>
<button
type=
"button"
class=
"yongyin4"
><a
href=
"javascript:void(0);"
class=
"funcbtn"
id=
"update_lives"
>
同步直播源
</a></button>
<button
type=
"button"
class=
"yongyin3"
><a
href=
"javascript:void(0);"
class=
"funcbtn"
id=
"use_py"
>
已{% if pystate=='1' %}启用{% else %}关闭{% endif %}py源
</a></button>
<button
type=
"button"
class=
"yongyin1"
><a
href=
"javascript:void(0);"
class=
"funcbtn"
id=
"force_update"
>
强制升级
</a></button>
<input
id=
"live_url"
value=
"{{live_url}}"
style=
"display: none"
>
...
...
templates/config.txt
浏览文件 @
0757eebb
...
...
@@ -24,6 +24,7 @@
"quickSearch": {{ rule.quickSearch }},
"filterable": {{ rule.filterable }}
}{% endif %}{% if loop.last==False %},{% endif %}{% endfor %}
{% if pys %}
,{% for py in pys %}{
"key":"{{ py.name }}",
"name":"{{ py.name }}(Pyramid)",
...
...
@@ -34,6 +35,7 @@
"filterable": {{ py.filterable }},
"ext": "{{ host }}/txt/py/{{ py.name }}.py"
}{% if loop.last==False %},{% endif %}{% endfor %}
{% endif %}
],
"parses": [{
"name": "🌐Ⓤ",
...
...
txt/pycms0.json
浏览文件 @
0757eebb
{
"wallpaper"
:
"http://localhost:5705/pics"
,
"dr_count"
:
28
,
"dr_count"
:
30
,
"mode"
:
0
,
"spider"
:
"http://localhost:5705/liveslib"
,
"drives"
:
[
...
...
@@ -204,6 +204,15 @@
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_兔小贝"
,
"name"
:
"兔小贝(道长)"
,
"type"
:
1
,
"api"
:
"http://localhost:5705/vod?rule=兔小贝"
,
"searchable"
:
1
,
"quickSearch"
:
0
,
"filterable"
:
0
},
{
"key"
:
"dr_养端"
,
"name"
:
"养端(道长)"
,
...
...
@@ -267,6 +276,15 @@
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_小强迷"
,
"name"
:
"小强迷(道长)"
,
"type"
:
1
,
"api"
:
"http://localhost:5705/vod?rule=小强迷"
,
"searchable"
:
1
,
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_小猫咪"
,
"name"
:
"小猫咪(道长)"
,
...
...
txt/pycms1.json
浏览文件 @
0757eebb
{
"wallpaper"
:
"http://192.168.3.224:5705/pics"
,
"dr_count"
:
28
,
"dr_count"
:
30
,
"mode"
:
1
,
"spider"
:
"http://192.168.3.224:5705/liveslib"
,
"drives"
:
[
...
...
@@ -204,6 +204,15 @@
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_兔小贝"
,
"name"
:
"兔小贝(道长)"
,
"type"
:
1
,
"api"
:
"http://192.168.3.224:5705/vod?rule=兔小贝"
,
"searchable"
:
1
,
"quickSearch"
:
0
,
"filterable"
:
0
},
{
"key"
:
"dr_养端"
,
"name"
:
"养端(道长)"
,
...
...
@@ -267,6 +276,15 @@
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_小强迷"
,
"name"
:
"小强迷(道长)"
,
"type"
:
1
,
"api"
:
"http://192.168.3.224:5705/vod?rule=小强迷"
,
"searchable"
:
1
,
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_小猫咪"
,
"name"
:
"小猫咪(道长)"
,
...
...
txt/pycms2.json
浏览文件 @
0757eebb
{
"wallpaper"
:
"http://cms.nokia.press/pics"
,
"dr_count"
:
28
,
"dr_count"
:
30
,
"mode"
:
1
,
"spider"
:
"http://cms.nokia.press/liveslib"
,
"drives"
:
[
...
...
@@ -204,6 +204,15 @@
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_兔小贝"
,
"name"
:
"兔小贝(道长)"
,
"type"
:
1
,
"api"
:
"http://cms.nokia.press/vod?rule=兔小贝"
,
"searchable"
:
1
,
"quickSearch"
:
0
,
"filterable"
:
0
},
{
"key"
:
"dr_养端"
,
"name"
:
"养端(道长)"
,
...
...
@@ -267,6 +276,15 @@
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_小强迷"
,
"name"
:
"小强迷(道长)"
,
"type"
:
1
,
"api"
:
"http://cms.nokia.press/vod?rule=小强迷"
,
"searchable"
:
1
,
"quickSearch"
:
1
,
"filterable"
:
0
},
{
"key"
:
"dr_小猫咪"
,
"name"
:
"小猫咪(道长)"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录