Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
renbangwen123456789
dr_py
提交
f2c8e4e7
dr_py
项目概览
renbangwen123456789
/
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,发现更多精彩内容 >>
提交
f2c8e4e7
编写于
9月 08, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了自定义文件路由
上级
e714163e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
8 deletion
+27
-8
base/custom.conf
base/custom.conf
+1
-0
base/files/custom_spider.jar
base/files/custom_spider.jar
+0
-0
controllers/home.py
controllers/home.py
+24
-7
js/version.txt
js/version.txt
+1
-1
readme.md
readme.md
+1
-0
未找到文件。
base/custom.conf
浏览文件 @
f2c8e4e7
...
...
@@ -15,5 +15,6 @@
"filterable"
:
0
}
],
"spider"
:
"{{ host }}/files/custom_spider.jar"
,
"lives"
:[{
"group"
:
"redirect"
,
"channels"
:[{
"name"
:
"我的直播"
,
"urls"
:[
"proxy://do=live&type=txt&ext=aHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8yNjg5ODIzMS9UVkJveC8tL3Jhdy9tYWluL2xpdmUvemIudHh0"
]}]}],
}
\ No newline at end of file
base/files/custom_spider.jar
0 → 100644
浏览文件 @
f2c8e4e7
文件已添加
controllers/home.py
浏览文件 @
f2c8e4e7
...
...
@@ -6,7 +6,7 @@
import
json
import
os
from
flask
import
Blueprint
,
abort
,
render_template
,
url_for
,
redirect
,
make_response
from
flask
import
Blueprint
,
abort
,
render_template
,
render_template_string
,
url_for
,
redirect
,
make_response
from
controllers.service
import
storage_service
from
controllers.classes
import
getClasses
,
getClassInfo
from
utils.web
import
getParmas
...
...
@@ -95,6 +95,23 @@ def plugin(name):
except
Exception
as
e
:
return
R
.
failed
(
f
'非法猥亵
\n
{
e
}
'
)
@
home
.
route
(
'/files/<name>'
)
def
get_files
(
name
):
base_path
=
'base/files'
os
.
makedirs
(
base_path
,
exist_ok
=
True
)
file_path
=
os
.
path
.
join
(
base_path
,
f
'
{
name
}
'
)
if
not
os
.
path
.
exists
(
file_path
):
return
R
.
failed
(
f
'
{
file_path
}
文件不存在'
)
with
open
(
file_path
,
mode
=
'rb'
)
as
f
:
file_byte
=
f
.
read
()
response
=
make_response
(
file_byte
)
filename
=
name
response
.
headers
[
'Content-Type'
]
=
'application/octet-stream'
response
.
headers
[
'Content-Disposition'
]
=
f
'attachment;filename="
{
filename
}
"'
return
response
@
home
.
route
(
'/lives'
)
def
get_lives
():
live_path
=
'js/直播.txt'
...
...
@@ -131,17 +148,17 @@ def config_render(mode):
with
open
(
customFile
,
'w+'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
'{}'
)
customConfig
=
False
try
:
with
open
(
customFile
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
customConfig
=
parseText
(
f
.
read
())
except
Exception
as
e
:
logger
.
info
(
f
'用户自定义配置加载失败:
{
e
}
'
)
if
mode
==
1
:
jyw_ip
=
getHost
(
mode
)
logger
.
info
(
jyw_ip
)
new_conf
=
cfg
host
=
getHost
(
mode
)
try
:
with
open
(
customFile
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
text
=
f
.
read
()
customConfig
=
parseText
(
render_template_string
(
text
,
host
=
host
))
except
Exception
as
e
:
logger
.
info
(
f
'用户自定义配置加载失败:
{
e
}
'
)
jxs
=
getJxs
()
alists
=
getAlist
()
alists_str
=
json
.
dumps
(
alists
,
ensure_ascii
=
False
)
...
...
js/version.txt
浏览文件 @
f2c8e4e7
3.3.1
\ No newline at end of file
3.3.2
\ No newline at end of file
readme.md
浏览文件 @
f2c8e4e7
...
...
@@ -49,6 +49,7 @@
###### 2022/09/08
-
[X] 1.升级到3.2.9,支持自动合并自定义用户配置(内置t4测试源)
-
[X] 7.升级到3.3.0,增加奇珍异兽源
-
[X] 7.升级到3.3.2,增加自定义本地文件路由: {{ host }}/files/文件名 比如 {{ host }}/files/custom_spider.jar
###### 2022/09/07
-
[X] 1.优化后台管理登录界面,升级更新脚本
-
[X] 2.增加了镜像合并脚本(三合一直接拉 hjdhnx/drpy 即可)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录