Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mine929
dr_py
提交
2590e86f
dr_py
项目概览
mine929
/
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,发现更多精彩内容 >>
提交
2590e86f
编写于
9月 05, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化打印
上级
260c32f8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
7 deletion
+14
-7
app.py
app.py
+2
-1
classes/cms.py
classes/cms.py
+3
-2
readme.md
readme.md
+1
-0
utils/web.py
utils/web.py
+8
-4
未找到文件。
app.py
浏览文件 @
2590e86f
...
...
@@ -35,8 +35,9 @@ def create_flask_app(config):
print
(
'当前操作系统'
,
sys
.
platform
)
app
.
logger
.
name
=
"drLogger"
rule_list
=
getRuleLists
()
wlan_info
,
_
=
get_wlan_info
()
logger
.
info
(
rule_list
)
logger
.
info
(
f
'局域网:
{
getHost
(
1
,
5705
)
}
/index
\n
本地:
{
getHost
(
0
,
5705
)
}
/index'
)
logger
.
info
(
f
'局域网:
{
getHost
(
1
,
5705
)
}
/index
\n
本地:
{
getHost
(
0
,
5705
)
}
\n
wlan_info:
{
wlan_info
}
/index'
)
return
app
app
=
create_flask_app
(
config
)
...
...
classes/cms.py
浏览文件 @
2590e86f
...
...
@@ -466,13 +466,14 @@ class CMS:
})
except
:
pass
result
[
'list'
]
=
videos
result
[
'list'
]
=
videos
[
min
((
fypage
-
1
)
*
self
.
limit
,
len
(
videos
)
-
1
):
min
(
fypage
*
self
.
limit
,
len
(
videos
))]
result
[
'code'
]
=
1
result
[
'msg'
]
=
'数据列表'
result
[
'page'
]
=
fypage
result
[
'pagecount'
]
=
math
.
ceil
(
len
(
videos
)
/
self
.
limit
)
result
[
'limit'
]
=
self
.
limit
result
[
'total'
]
=
len
(
videos
)
result
[
'now_count'
]
=
len
(
result
[
'list'
])
return
result
except
Exception
as
e
:
logger
.
info
(
f
'首页内容获取失败:
{
e
}
'
)
...
...
@@ -703,7 +704,7 @@ class CMS:
:return:
"""
t1
=
time
()
array
=
array
[(
fypage
-
1
)
*
self
.
limit
:
min
(
self
.
limit
*
fypage
,
len
(
array
))]
array
=
array
if
len
(
array
)
<=
self
.
limit
else
array
[(
fypage
-
1
)
*
self
.
limit
:
min
(
self
.
limit
*
fypage
,
len
(
array
))]
thread_pool
=
ThreadPoolExecutor
(
min
(
self
.
limit
,
len
(
array
)))
# 定义线程池来启动多线程执行此任务
obj_list
=
[]
try
:
...
...
readme.md
浏览文件 @
2590e86f
...
...
@@ -49,6 +49,7 @@
###### 2022/09/04
-
[X] 1.内置jar修复了原本tv_box无法播放直播的问题
-
[X] 2.重新构建了三种平台的镜像 amd64,armv7,arm64
-
[X] 3.优化日志打印wlan信息
###### 2022/09/04
-
[X] 1.增加了dockerfile
-
[
X] 2.基于dockerfile构建的镜像并上传至dockerhub,小白可以一键运行.参考[搭建教程
](
./安卓本地搭建说明.md
)
...
...
utils/web.py
浏览文件 @
2590e86f
...
...
@@ -43,6 +43,13 @@ def get_host_ip_old(): # 获取局域网ip
return
real_ips
[
-
1
]
if
len
(
jyw
)
<
1
else
jyw
[
0
]
def
get_host_ip
():
# 获取局域网ip
netcard_info
,
ips
=
get_wlan_info
()
# print(netcard_info)
real_ips
=
list
(
filter
(
lambda
x
:
x
and
x
!=
'127.0.0.1'
,
ips
))
jyw
=
list
(
filter
(
lambda
x
:
str
(
x
).
startswith
(
'192.168'
),
real_ips
))
return
real_ips
[
-
1
]
if
len
(
jyw
)
<
1
else
jyw
[
0
]
def
get_wlan_info
():
info
=
psutil
.
net_if_addrs
()
# print(info)
netcard_info
=
[]
...
...
@@ -52,10 +59,7 @@ def get_host_ip(): # 获取局域网ip
if
item
[
0
]
==
2
:
netcard_info
.
append
((
k
,
item
[
1
]))
ips
.
append
(
item
[
1
])
print
(
netcard_info
)
real_ips
=
list
(
filter
(
lambda
x
:
x
and
x
!=
'127.0.0.1'
,
ips
))
jyw
=
list
(
filter
(
lambda
x
:
str
(
x
).
startswith
(
'192.168'
),
real_ips
))
return
real_ips
[
-
1
]
if
len
(
jyw
)
<
1
else
jyw
[
0
]
return
netcard_info
,
ips
def
getHost
(
mode
=
0
,
port
=
None
):
port
=
port
or
request
.
environ
.
get
(
'SERVER_PORT'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录