Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ForFoxpro
dr_py
提交
6ed8dedc
dr_py
项目概览
ForFoxpro
/
dr_py
落后 Fork 源项目 466 个版本
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,发现更多精彩内容 >>
提交
6ed8dedc
编写于
9月 06, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了缓存数据库
上级
f8bfb61f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
195 addition
and
97 deletion
+195
-97
app.py
app.py
+5
-1
config.py
config.py
+1
-1
js/alist.txt
js/alist.txt
+27
-0
models/__init__.py
models/__init__.py
+2
-1
models/rules.db
models/rules.db
+0
-0
models/storage.py
models/storage.py
+66
-0
static/css/admin.css
static/css/admin.css
+65
-1
static/js/common.js
static/js/common.js
+18
-0
templates/admin.html
templates/admin.html
+11
-93
未找到文件。
app.py
浏览文件 @
6ed8dedc
...
...
@@ -58,7 +58,11 @@ else:
# from geventwebsocket.handler import WebSocketHandler
RuleClass
=
rule_classes
.
init
(
db
)
PlayParse
=
play_parse
.
init
(
db
)
lsg
=
storage
.
init
(
db
)
print
(
lsg
.
setItem
(
'直播地址'
,
'https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/zb.txt'
))
t12
=
time
()
print
(
lsg
.
getItem
(
'直播地址'
,
'111'
))
print
(
get_interval
(
t12
))
def
is_linux
():
return
not
'win'
in
sys
.
platform
...
...
config.py
浏览文件 @
6ed8dedc
...
...
@@ -33,6 +33,6 @@ UNAME = 'admin' # 管理员账号
PWD
=
'drpy'
# 管理员密码
MAX_CONTENT_LENGTH
=
1
*
1024
*
1024
/
100
# 100 kB
LIVE_MODE
=
1
# 0 本地 1外网
LIVE_URL
=
'https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/
0830
zb.txt'
# 外网直播地址
LIVE_URL
=
'https://gitcode.net/qq_26898231/TVBox/-/raw/main/live/zb.txt'
# 外网直播地址
CATE_EXCLUDE
=
'首页|留言|APP|下载|资讯|新闻|动态'
# 动态分类过滤
# {% if config.WALL_PAPER %}"wallpaper":"{{ config.WALL_PAPER }}",{% endif %}
\ No newline at end of file
js/alist.txt
0 → 100644
浏览文件 @
6ed8dedc
{
"🔮嗨翻":"https://pan.hikerfans.com",
"🦀9T(Adult)":"https://drive.9t.ee",
"🐱梓澪の妙妙屋":"https://xn--i0v44m.xyz",
"🚆资源小站":"https://pan.142856.xyz",
"🌤晴园的宝藏库":"https://alist.52qy.repl.co",
"🐭米奇妙妙屋":"https://anime.mqmmw.ga",
"💂小兵组网盘影视":"https://6vv.app",
"📀小光盘":"https://alist.xiaoguanxiaocheng.life",
"🐋一只鱼":"https://alist.youte.ml",
"🌊七米蓝":"https://al.chirmyram.com",
"🌴非盘":"http://www.feifwp.top",
"🥼帅盘":"https://hi.shuaipeng.wang",
"🐉神族九帝":"https://alist.shenzjd.com",
"☃姬路白雪":"https://pan.jlbx.xyz",
"🎧听闻网盘":"https://wangpan.sangxuesheng.com",
"💾DISK":"http://124.222.140.243:8080",
"🌨云播放":"https://quanzi.laoxianghuijia.cn",
"✨星梦":"https://pan.bashroot.top",
"🌊小江":"https://dyj.me",
"💫触光":"https://pan.ichuguang.com",
"🕵好汉吧":"https://8023.haohanba.cn",
"🥗AUNEY":"http://121.227.25.116:8008",
"🎡资源小站":"https://960303.xyz/",
"🏝fenwe":"http://www.fenwe.tk:5244",
"🎢轻弹浅唱":"https://g.xiang.lol"
}
models/__init__.py
浏览文件 @
6ed8dedc
...
...
@@ -5,4 +5,5 @@
# Date : 2022/8/25
from
.
import
rule_classes
from
.
import
play_parse
\ No newline at end of file
from
.
import
play_parse
from
.
import
storage
\ No newline at end of file
models/rules.db
浏览文件 @
6ed8dedc
无法预览此类型文件
models/storage.py
0 → 100644
浏览文件 @
6ed8dedc
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : storage.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
from
functools
import
lru_cache
def
init
(
db
):
class
Storage
(
db
.
Model
):
__tablename__
=
'storage'
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
key
=
db
.
Column
(
db
.
String
(
20
),
unique
=
True
)
value
=
db
.
Column
(
db
.
UnicodeText
())
# value = db.Column(db.Text())
def
__repr__
(
self
):
return
"<Storage(key='%s', value='%s')>"
%
(
self
.
key
,
self
.
value
)
@
classmethod
def
setItem
(
self
,
key
,
value
=
None
):
res
=
db
.
session
.
query
(
self
).
filter
(
self
.
key
==
key
).
first
()
if
res
:
res
.
value
=
value
db
.
session
.
add
(
res
)
else
:
res
=
Storage
(
key
=
key
,
value
=
value
)
db
.
session
.
add
(
res
)
db
.
session
.
flush
()
try
:
db
.
session
.
commit
()
self
.
clearCache
()
return
res
.
id
except
Exception
as
e
:
print
(
f
'发生了错误:
{
e
}
'
)
return
None
@
classmethod
@
lru_cache
(
maxsize
=
200
)
def
getItem
(
self
,
key
,
value
=
''
):
res
=
db
.
session
.
query
(
self
).
filter
(
self
.
key
==
key
).
first
()
if
res
:
return
res
.
value
or
value
else
:
return
value
@
classmethod
def
clearItem
(
self
,
key
):
self
.
clearCache
()
res
=
db
.
session
.
query
(
self
).
filter
(
self
.
key
==
key
).
first
()
if
res
:
res
.
delete
()
ret
=
db
.
session
.
commit
()
self
.
clearCache
()
return
ret
else
:
return
True
@
classmethod
def
clearCache
(
self
):
self
.
getItem
.
cache_clear
()
# db.create_all()
db
.
create_all
()
return
Storage
\ No newline at end of file
static/css/admin.css
浏览文件 @
6ed8dedc
...
...
@@ -2,4 +2,68 @@
/*font-size: 18px;*/
color
:
#5dc2f1
;
}
\ No newline at end of file
}
.red
{
color
:
red
;
font-weight
:
bold
;
padding-left
:
10px
;
/*padding-top:10px;*/
margin-left
:
10px
;
width
:
360px
;
height
:
30px
;
}
.green
{
color
:
forestgreen
;
font-weight
:
bold
;
padding-left
:
10px
;
/*padding-top:10px;*/
margin-left
:
10px
;
width
:
360px
;
height
:
30px
;
}
.btn
{
color
:
#FFFFFF
;
background-color
:
#1379cb
;
}
.clear
{
/*word-spacing:2px;*/
letter-spacing
:
5px
;
margin-left
:
20px
;
width
:
120px
;
height
:
30px
;
text-align
:
center
;
border-style
:
solid
;
/*border-color: #8CD4F5;*/
border-color
:
#1379cb
;
text-decoration
:
none
;
color
:
#FFFFFF
;
background-color
:
#1379cb
;
}
.view_home
{
letter-spacing
:
5px
;
margin-left
:
20px
;
width
:
150px
;
height
:
30px
;
text-align
:
center
;
border-style
:
solid
;
/*border-color: #8CD4F5;*/
border-color
:
#17af30
;
text-decoration
:
none
;
color
:
#FFFFFF
;
background-color
:
#17af30
;
}
/*li a {*/
/* display: block !important;*/
/*}*/
.ver_title
{
font-size
:
15px
;
margin-left
:
20px
}
.ver
{
font-size
:
16px
;
margin-left
:
5px
;
color
:
#ea7d7d
;
}
a
.funcbtn
{
margin-left
:
10px
;
}
\ No newline at end of file
static/js/common.js
0 → 100644
浏览文件 @
6ed8dedc
function
copy
(
text
,
mode
){
mode
=
mode
||
0
;
if
(
mode
===
0
){
let
el
=
$
(
'
<input id="input_to_copy" style="position: absolute;top: 0;left: 0;opacity: 0;z-index: -10"/>
'
);
$
(
'
body
'
).
prepend
(
el
);
//添加到元素内部的前面
el
.
val
(
text
);
// 修改文本框的内容
el
.
select
();
//选中
console
.
log
(
'
复制的内容:
\n
'
+
text
);
document
.
execCommand
(
"
copy
"
);
// 执行浏览器复制命令
el
.
remove
();
}
else
{
let
el
=
$
(
text
);
console
.
log
(
'
复制的内容:
\n
'
+
el
.
val
());
el
.
select
();
//选中
document
.
execCommand
(
"
copy
"
);
// 执行浏览器复制命令
}
alert
(
"
复制成功
"
);
}
\ No newline at end of file
templates/admin.html
浏览文件 @
6ed8dedc
...
...
@@ -9,86 +9,17 @@
<link
rel=
"stylesheet"
media=
"screen"
href=
"/static/css/admin.css"
>
<link
rel=
"icon"
href=
"/static/img/logo.png"
type=
"image/x-icon"
>
<script
src=
"/static/js/jquery.min.js"
></script>
<script
src=
"/static/js/common.js"
></script>
</head>
<style>
.red
{
color
:
red
;
font-weight
:
bold
;
padding-left
:
10px
;
/*padding-top:10px;*/
margin-left
:
10px
;
width
:
360px
;
height
:
30px
;
}
.green
{
color
:
forestgreen
;
font-weight
:
bold
;
padding-left
:
10px
;
/*padding-top:10px;*/
margin-left
:
10px
;
width
:
360px
;
height
:
30px
;
}
.btn
{
color
:
#FFFFFF
;
background-color
:
#1379cb
;
}
.clear
{
/*word-spacing:2px;*/
letter-spacing
:
5px
;
margin-left
:
20px
;
width
:
120px
;
height
:
30px
;
text-align
:
center
;
border-style
:
solid
;
/*border-color: #8CD4F5;*/
border-color
:
#1379cb
;
text-decoration
:
none
;
color
:
#FFFFFF
;
background-color
:
#1379cb
;
}
.view_home
{
letter-spacing
:
5px
;
margin-left
:
20px
;
width
:
150px
;
height
:
30px
;
text-align
:
center
;
border-style
:
solid
;
/*border-color: #8CD4F5;*/
border-color
:
#17af30
;
text-decoration
:
none
;
color
:
#FFFFFF
;
background-color
:
#17af30
;
}
/*li a {*/
/* display: block !important;*/
/*}*/
.ver_title
{
font-size
:
15px
;
margin-left
:
20px
}
.ver
{
font-size
:
16px
;
margin-left
:
5px
;
color
:
#ea7d7d
;
}
a
.funcbtn
{
margin-left
:
10px
;
}
.wrapper
{
position
:
relative
;}
#input
{
position
:
absolute
;
top
:
0
;
left
:
0
;
opacity
:
0
;
z-index
:
-10
;}
</style>
<body>
<script>
$
(
document
).
ready
(
function
(){
$
(
"
.view
"
).
click
(
function
(){
// location.reload();
let
rule
=
this
.
innerText
.
trim
();
location
.
href
=
'
/admin/view/
'
+
rule
+
'
.js
'
;
});
$
(
"
.view_home
"
).
click
(
function
(){
// location.reload();
let
rule
=
this
.
getAttribute
(
'
value
'
).
trim
();
location
.
href
=
'
/vod?rule=
'
+
rule
;
});
...
...
@@ -128,8 +59,6 @@
});
$
(
"
.clear
"
).
click
(
function
(){
// location.reload();
// let rule = this.innerText.trim();
let
rule
=
this
.
getAttribute
(
'
value
'
).
trim
();
if
(
confirm
(
'
确认删除内置规则:
'
+
rule
+
'
?
'
)){
let
code
=
$
.
ajax
({
url
:
'
/admin/clear/
'
+
rule
+
'
.js
'
,
async
:
false
}).
responseText
;
...
...
@@ -141,12 +70,11 @@
alert
(
'
操作失败!
\n
'
+
code
.
msg
);
}
}
// location.href = '/admin/clear/'+rule;
});
$
(
'
#upload
'
).
click
(
function
(){
var
file_data
=
$
(
"
input[name='file']
"
).
prop
(
"
files
"
)[
0
];
console
.
log
(
file_data
);
//
console.log(file_data);
if
(
!
file_data
){
alert
(
'
文件必选
'
);
return
false
...
...
@@ -176,35 +104,25 @@
console
.
log
(
ret
);
alert
(
ret
.
msg
);
});
});
});
function
getFileSize
(
fileObj
)
{
$
(
'
#file_size
'
).
text
(
'
文件大小为:
'
+
fileObj
.
files
[
0
].
size
/
1024
+
'
kb
'
);
}
function
copyText
(
id
)
{
console
.
log
(
id
);
var
text
=
document
.
getElementById
(
id
).
innerText
;
var
input
=
document
.
getElementById
(
"
input
"
);
input
.
value
=
text
;
// 修改文本框的内容
console
.
log
(
text
);
input
.
select
();
// 选中文本
document
.
execCommand
(
"
copy
"
);
// 执行浏览器复制命令
alert
(
"
复制成功
"
);
function
getFileSize
(
fileObj
)
{
$
(
'
#file_size
'
).
text
(
'
文件大小为:
'
+
fileObj
.
files
[
0
].
size
/
1024
+
'
kb
'
);
}
</script>
<h2
class=
"title"
>
欢迎使用drpy管理员界面
<span
class=
"ver_title"
>
当前版本:
</span><span
class=
"ver"
>
{{ ver }}
</span></h2>
<h2
class=
"title"
>
欢迎使用drpy管理员界面
</h2>
<h3
class=
"title"
>
<span
class=
"ver_title"
>
当前版本:
</span><span
class=
"ver"
>
{{ ver }}
</span>
</h3>
<h4>
<a
href=
"/index"
class=
"funcbtn"
>
返回首页
</a>
<a
href=
"javascript:void(0);"
class=
"funcbtn"
id=
"checkUpdate"
>
检测升级
</a>
<a
href=
"javascript:copyText('update_by_self');"
class=
"funcbtn"
id=
"update_by_self"
>
cp ./tmp/dr_py-master/app.py ./app.py
</a>
<!--<a href="javascript:copyText('update_by_self');" class="funcbtn" id="update_by_self">cp ./tmp/dr_py-master/app.py ./app.py</a>-->
<a
href=
"javascript:copy('cp ./tmp/dr_py-master/app.py ./app.py');"
class=
"funcbtn"
id=
"update_by_self"
>
复制主程升级指令
</a>
<a
href=
"javascript:void(0);"
class=
"funcbtn"
id=
"update_lives"
>
同步直播源
</a>
</h4>
<p>
你可以在此页面在线上传规则文件到js目录或者删除js目录的文件
</p>
<input
id=
"input"
/>
<form
action =
"/upload"
method =
"POST"
enctype =
"multipart/form-data"
>
<!-- <input type = "file" name = "file" class="btn" accept=".js" onchange="getFileSize(this)"/>-->
<input
type =
"file"
name =
"file"
class=
"btn"
onchange=
"getFileSize(this)"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录