Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sunboy0628
dr_py
提交
d22cbde4
dr_py
项目概览
sunboy0628
/
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,发现更多精彩内容 >>
提交
d22cbde4
编写于
8月 31, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化直播源渲染速度
上级
551333f5
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
24 addition
and
9 deletion
+24
-9
app.py
app.py
+19
-5
templates/config.txt
templates/config.txt
+1
-1
txt/issue.txt
txt/issue.txt
+1
-0
txt/pycms0.json
txt/pycms0.json
+1
-1
txt/pycms1.json
txt/pycms1.json
+1
-1
txt/pycms2.json
txt/pycms2.json
+1
-1
未找到文件。
app.py
浏览文件 @
d22cbde4
...
@@ -404,13 +404,25 @@ def random_pics():
...
@@ -404,13 +404,25 @@ def random_pics():
else
:
else
:
return
redirect
(
config
.
WALL_PAPER
)
return
redirect
(
config
.
WALL_PAPER
)
def
get_live_url
(
new_conf
,
mode
):
host
=
getHost
(
mode
)
live_url
=
host
+
'/lives'
if
new_conf
.
get
(
'LIVE_MODE'
,
1
)
==
0
else
'https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/0830zb.txt'
live_url
=
base64Encode
(
live_url
)
return
live_url
@
app
.
route
(
'/config/<int:mode>'
)
@
app
.
route
(
'/config/<int:mode>'
)
def
config_render
(
mode
):
def
config_render
(
mode
):
# print(dict(app.config))
# print(dict(app.config))
if
mode
==
1
:
if
mode
==
1
:
jyw_ip
=
getHost
(
mode
)
jyw_ip
=
getHost
(
mode
)
logger
.
info
(
jyw_ip
)
logger
.
info
(
jyw_ip
)
html
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
host
=
getHost
(
mode
),
mode
=
mode
,
jxs
=
getJxs
(),
base64Encode
=
base64Encode
,
config
=
dict
(
app
.
config
))
new_conf
=
dict
(
app
.
config
)
host
=
getHost
(
mode
)
jxs
=
getJxs
()
live_url
=
get_live_url
(
new_conf
,
mode
)
# html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,base64Encode=base64Encode,config=new_conf)
html
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
host
=
host
,
mode
=
mode
,
jxs
=
jxs
,
live_url
=
live_url
,
config
=
new_conf
)
response
=
make_response
(
html
)
response
=
make_response
(
html
)
response
.
headers
[
'Content-Type'
]
=
'application/json; charset=utf-8'
response
.
headers
[
'Content-Type'
]
=
'application/json; charset=utf-8'
return
response
return
response
...
@@ -432,10 +444,12 @@ def get_lives():
...
@@ -432,10 +444,12 @@ def get_lives():
def
config_gen
():
def
config_gen
():
# 生成文件
# 生成文件
os
.
makedirs
(
'txt'
,
exist_ok
=
True
)
os
.
makedirs
(
'txt'
,
exist_ok
=
True
)
jxs
=
getJxs
()
new_conf
=
dict
(
app
.
config
)
set_local
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
base64Encode
=
base64Encode
,
mode
=
0
,
host
=
getHost
(
0
),
jxs
=
jxs
)
jxs
=
getJxs
()
set_area
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
base64Encode
=
base64Encode
,
mode
=
1
,
host
=
getHost
(
1
),
jxs
=
jxs
)
set_local
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
live_url
=
get_live_url
(
new_conf
,
0
),
mode
=
0
,
host
=
getHost
(
0
),
jxs
=
jxs
)
set_online
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
base64Encode
=
base64Encode
,
mode
=
1
,
host
=
getHost
(
2
),
jxs
=
jxs
)
print
(
set_local
)
set_area
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
live_url
=
get_live_url
(
new_conf
,
1
),
mode
=
1
,
host
=
getHost
(
1
),
jxs
=
jxs
)
set_online
=
render_template
(
'config.txt'
,
rules
=
getRules
(
'js'
),
live_url
=
get_live_url
(
new_conf
,
2
),
mode
=
1
,
host
=
getHost
(
2
),
jxs
=
jxs
)
with
open
(
'txt/pycms0.json'
,
'w+'
,
encoding
=
'utf-8'
)
as
f
:
with
open
(
'txt/pycms0.json'
,
'w+'
,
encoding
=
'utf-8'
)
as
f
:
set_dict
=
json
.
loads
(
set_local
)
set_dict
=
json
.
loads
(
set_local
)
f
.
write
(
json
.
dumps
(
set_dict
,
ensure_ascii
=
False
,
indent
=
4
))
f
.
write
(
json
.
dumps
(
set_dict
,
ensure_ascii
=
False
,
indent
=
4
))
...
...
templates/config.txt
浏览文件 @
d22cbde4
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
}{% if loop.last==False %},{% endif %}{% endfor %}
}{% if loop.last==False %},{% endif %}{% endfor %}
],
],
"flags": ["youku", "qq", "iqiyi", "qiyi", "letv", "sohu", "tudou","xigua","cntv","1905", "pptv", "mgtv", "wasu", "bilibili", "renrenmi"],
"flags": ["youku", "qq", "iqiyi", "qiyi", "letv", "sohu", "tudou","xigua","cntv","1905", "pptv", "mgtv", "wasu", "bilibili", "renrenmi"],
"lives":[{"group":"redirect","channels":[{"name":"直播","urls":["proxy://do=live&type=txt&ext={
% if config.LIVE_MODE==0 %}{{base64Encode(host+'/lives')}}{% else %}{{ base64Encode('https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/0830zb.txt')}}{% endif %
}"]}]}],
"lives":[{"group":"redirect","channels":[{"name":"直播","urls":["proxy://do=live&type=txt&ext={
{live_url}
}"]}]}],
"ijk": [{
"ijk": [{
"group": "软解码",
"group": "软解码",
"options": [{
"options": [{
...
...
txt/issue.txt
浏览文件 @
d22cbde4
...
@@ -18,5 +18,6 @@ assert subprocess.call(
...
@@ -18,5 +18,6 @@ assert subprocess.call(
下面格式原版tv_box才能用?
下面格式原版tv_box才能用?
"live","urls":["proxy://do=live&type=txt&ext=aHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8yNjg5ODIzMS9UVkJveC8tL3Jhdy9tYWluL2xpdmUvMDgzMHpiLnR4dA=="]}]}],
"live","urls":["proxy://do=live&type=txt&ext=aHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8yNjg5ODIzMS9UVkJveC8tL3Jhdy9tYWluL2xpdmUvMDgzMHpiLnR4dA=="]}]}],
"lives":[{"group":"redirect","channels":[{"name":"直播","urls":["proxy://do=live&type=txt&ext={{ base64Encode(host+'/lives') }}"]}]}],
"lives":[{"group":"redirect","channels":[{"name":"直播","urls":["proxy://do=live&type=txt&ext={{ base64Encode(host+'/lives') }}"]}]}],
"lives":[{"group":"redirect","channels":[{"name":"直播","urls":["proxy://do=live&type=txt&ext={% if config.LIVE_MODE==0 %}{{base64Encode(host+'/lives')}}{% else %}{{ base64Encode('https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/0830zb.txt')}}{% endif %}"]}]}],
txt/pycms0.json
浏览文件 @
d22cbde4
...
@@ -579,7 +579,7 @@
...
@@ -579,7 +579,7 @@
{
{
"name"
:
"直播"
,
"name"
:
"直播"
,
"urls"
:
[
"urls"
:
[
"proxy://do=live&type=txt&ext=aHR0c
DovL2xvY2FsaG9zdDo1NzA1L2xpdmVz
"
"proxy://do=live&type=txt&ext=aHR0c
HM6Ly9naXRjb2RlLm5ldC9xcV8yNjg5ODIzMS9UVkJveC8tL3Jhdy9tYWluL2xpdmUvMDgzMHpiLnR4dA==
"
]
]
}
}
]
]
...
...
txt/pycms1.json
浏览文件 @
d22cbde4
...
@@ -579,7 +579,7 @@
...
@@ -579,7 +579,7 @@
{
{
"name"
:
"直播"
,
"name"
:
"直播"
,
"urls"
:
[
"urls"
:
[
"proxy://do=live&type=txt&ext=aHR0c
DovLzE5Mi4xNjguMTAuOTk6NTcwNS9saXZlcw
=="
"proxy://do=live&type=txt&ext=aHR0c
HM6Ly9naXRjb2RlLm5ldC9xcV8yNjg5ODIzMS9UVkJveC8tL3Jhdy9tYWluL2xpdmUvMDgzMHpiLnR4dA
=="
]
]
}
}
]
]
...
...
txt/pycms2.json
浏览文件 @
d22cbde4
...
@@ -579,7 +579,7 @@
...
@@ -579,7 +579,7 @@
{
{
"name"
:
"直播"
,
"name"
:
"直播"
,
"urls"
:
[
"urls"
:
[
"proxy://do=live&type=txt&ext=aHR0c
DovL2Ntcy5ub2tpYS5wcmVzcy9saXZlcw
=="
"proxy://do=live&type=txt&ext=aHR0c
HM6Ly9naXRjb2RlLm5ldC9xcV8yNjg5ODIzMS9UVkJveC8tL3Jhdy9tYWluL2xpdmUvMDgzMHpiLnR4dA
=="
]
]
}
}
]
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录