Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pgl99
dr_py
提交
d6fb43eb
dr_py
项目概览
pgl99
/
dr_py
与 Fork 源项目一致
2023-03-02 03:36:06同步失败
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,发现更多精彩内容 >>
提交
d6fb43eb
编写于
9月 06, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
大版本升级
上级
84fe26b2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
124 addition
and
6 deletion
+124
-6
py/360二级.min.js
py/360二级.min.js
+2
-0
py/干饭.min.js
py/干饭.min.js
+2
-0
py/蓝莓.min.js
py/蓝莓.min.js
+2
-0
templates/rules_to_clear.html
templates/rules_to_clear.html
+3
-3
templates/rules_to_view.html
templates/rules_to_view.html
+3
-3
utils/files.py
utils/files.py
+54
-0
utils/system.py
utils/system.py
+58
-0
未找到文件。
py/360二级.min.js
0 → 100644
浏览文件 @
d6fb43eb
js
:
let
html
=
JSON
.
parse
(
fetch
(
input
,
fetch_params
));
let
data
=
html
.
data
;
let
tilte
=
data
.
title
;
let
img
=
data
.
cdncover
;
let
vod_type
=
data
.
moviecategory
.
join
(
"
,
"
);
let
area
=
data
.
area
.
join
(
"
,
"
);
let
director
=
data
.
director
.
join
(
"
,
"
);
let
actor
=
data
.
actor
.
join
(
"
,
"
);
let
content
=
data
.
description
;
base_vod
=
{
vod_id
:
input
,
vod_name
:
tilte
,
type_name
:
vod_type
,
vod_actor
:
actor
,
vod_director
:
director
,
vod_content
:
content
,
vod_remarks
:
area
,
vod_pic
:
urljoin2
(
input
,
img
)};
let
delta
=
200
;
let
vod_play
=
{};
let
sites
=
data
.
playlink_sites
;
for
(
let
i
in
sites
){
let
site
=
sites
[
i
];
let
playList
=
""
;
let
vodItems
=
[];
if
(
data
.
allupinfo
){
let
total
=
parseInt
(
data
.
allupinfo
[
site
]);
for
(
let
j
=
1
;
j
<
total
;
j
+=
delta
){
let
end
=
Math
.
min
(
total
,
j
+
delta
-
1
);
let
url2
=
buildUrl
(
input
,{
start
:
j
,
end
:
end
,
site
:
site
});
let
vod_data
=
JSON
.
parse
(
fetch
(
url2
),
fetch_params
).
data
;
if
(
vod_data
.
allepidetail
){
vod_data
=
vod_data
.
allepidetail
[
site
];
vod_data
.
forEach
(
function
(
item
,
index
){
vodItems
.
push
((
item
.
playlink_num
||
""
)
+
"
$
"
+
(
item
.
url
||
""
))})}
else
{
vod_data
=
vod_data
.
defaultepisode
;
vod_data
.
forEach
(
function
(
item
,
index
){
vodItems
.
push
((
item
.
period
||
""
)
+
(
item
.
name
||
""
)
+
"
$
"
+
item
.
url
||
""
)})}}}
else
{
let
item
=
data
.
playlinksdetail
[
site
];
vodItems
.
push
((
item
.
sort
||
""
)
+
"
$
"
+
(
item
.
default_url
||
""
))}
if
(
vodItems
.
length
>
0
){
playList
=
vodItems
.
join
(
"
#
"
)}
if
(
playList
.
length
<
1
){
continue
}
vod_play
[
site
]
=
playList
}
let
tabs
=
Object
.
keys
(
vod_play
);
let
playUrls
=
[];
for
(
let
id
in
tabs
){
playUrls
.
push
(
vod_play
[
tabs
[
id
]])}
if
(
tabs
.
length
>
0
){
vod_play_from
=
tabs
.
join
(
"
$$$
"
);
vod_play_url
=
playUrls
.
join
(
"
$$$
"
);
base_vod
.
vod_play_from
=
vod_play_from
;
base_vod
.
vod_play_url
=
vod_play_url
}
vod
=
base_vod
;
\ No newline at end of file
py/干饭.min.js
0 → 100644
浏览文件 @
d6fb43eb
js
:
cacheUrl
=
getParse
(
input
);
if
(
cacheUrl
){
input
=
cacheUrl
}
else
{
try
{
let
html
=
fetch
(
input
,
fetch_params
);
let
ret
=
html
.
match
(
/var player_
(
.*
?)
=
(
.*
?)
</
)[
2
];
let
url
=
JSON
.
parse
(
ret
).
url
;
if
(
url
.
length
>
10
){
real_url
=
"
https://player.buyaotou.xyz/?url=
"
+
url
;
saveParse
(
input
,
real_url
);
input
=
real_url
}}
catch
(
e
){
print
(
"
网络请求发生错误:
"
+
e
.
message
)}}
\ No newline at end of file
py/蓝莓.min.js
0 → 100644
浏览文件 @
d6fb43eb
js
:
var
MY_HOME
=
"
http://lanmeiguojiang.com:5244/d/%E8%93%9D%E8%8E%93%E4%BA%91%E7%9B%98
"
;
print
(
fetch_params
);
let
html
=
fetch
(
input
,
fetch_params
);
var
player
=
JSON
.
parse
(
html
.
match
(
/r player_.*
?
=
(
.*
?)
</
)[
1
]);
var
jsurl
=
player
.
url
;
var
from
=
player
.
from
;
if
(
player
.
encrypt
==
"
1
"
){
var
jsurl
=
unescape
(
jsurl
)}
else
if
(
player
.
encrypt
==
"
2
"
){
var
jsurl
=
unescape
(
base64Decode
(
jsurl
))}
else
{
jsurl
}
if
(
/ddzy|duoduo/
.
test
(
from
)){
let
mx
=
false
;
if
(
mx
){
let
html
=
request
(
MY_HOME
+
"
/pzwj.js
"
);
eval
(
html
);
var
jx
=
MacPlayerConfig
.
player_list
[
from
].
parse
;
print
(
"
第1次多多解析:
"
,
jx
);
eval
(
fetch
(
jx
+
jsurl
,
fetch_params
).
match
(
/var config = {
[\s\S]
*
?
}/
)[
0
]);
jx
=
jx
.
replace
(
"
?url=
"
,
""
);
eval
(
fetch
(
jx
+
"
js/decode.js
"
,
fetch_params
));
jxk
=
fetch
(
jx
+
"
js/setting.js
"
,
fetch_params
).
split
(
"
,
"
);
jx
+=
"
555tZ4pvzHE3BpiO838.php
"
;
print
(
"
第2次多多解析:
"
,
jx
);
config
.
tm
=
(
new
Date
).
getTime
();
config
.
sign
=
"
F4penExTGogdt6U8
"
;
input
=
getVideoInfo
(
JSON
.
parse
(
fetch
(
buildUrl
(
jx
,
config
),
fetch_params
)).
url
)}}
else
{
let
jxurl
=
"
https://lanmeiguojiang.com/dd/?url=
"
+
jsurl
;
input
=
maoss
(
jxurl
,
jxurl
,
"
A42EAC0C2B408472
"
)}
\ No newline at end of file
templates/rules.html
→
templates/rules
_to_clear
.html
浏览文件 @
d6fb43eb
...
...
@@ -41,7 +41,7 @@
$
(
"
.cls
"
).
click
(
function
(){
let
cls
=
this
.
innerText
.
trim
();
if
(
confirm
(
'
确认清除规则
'
+
cls
+
'
缓存的分类?
'
)){
let
code
=
$
.
ajax
({
url
:
"
/cl
earcls
/
"
+
cls
,
async
:
false
}).
responseText
;
let
code
=
$
.
ajax
({
url
:
"
/cl
s/clear
/
"
+
cls
,
async
:
false
}).
responseText
;
code
=
typeof
(
code
)
===
"
object
"
?
code
:
JSON
.
parse
(
code
);
if
(
code
.
code
===
200
){
alert
(
'
操作成功!
\n
'
+
code
.
msg
);
...
...
@@ -54,7 +54,7 @@
});
</script>
<h1>
缓存规则列表
</h1>
<h1>
缓存规则列表
-{{rules.count}}
</h1>
{% if rules.count
<
1
%}
<
h3
>
暂无已缓存的规则
</h3>
{% endif %}
...
...
@@ -79,7 +79,7 @@
{% endfor %}
<h1>
缓存分类列表
</h1>
<h1>
缓存分类列表
-{{classes|length}}
</h1>
{% if classes|length
<
1
%}
<
h3
>
暂无已缓存的分类
</h3>
{% endif %}
...
...
templates/r
a
w.html
→
templates/r
ules_to_vie
w.html
浏览文件 @
d6fb43eb
...
...
@@ -35,12 +35,12 @@
$
(
"
.cls
"
).
click
(
function
(){
// location.reload();
let
cls
=
this
.
innerText
.
trim
();
location
.
href
=
'
/cls/
'
+
cls
;
location
.
href
=
'
/cls/
get/
'
+
cls
;
});
});
</script>
<h1>
缓存规则列表
</h1>
<h1>
缓存规则列表
-{{rules.count}}
</h1>
{% if rules.count
<
1
%}
<
h3
>
暂无已缓存的规则
</h3>
{% endif %}
...
...
@@ -64,7 +64,7 @@
<!-- if条件必须有endif,否则会报错 -->
{% endfor %}
<h1>
缓存分类列表
</h1>
<h1>
缓存分类列表
-{{ classes|length }}
</h1>
{% if classes|length
<
1
%}
<
h3
>
暂无已缓存的分类
</h3>
{% endif %}
...
...
utils/files.py
0 → 100644
浏览文件 @
d6fb43eb
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : files.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
import
os
from
utils.system
import
getHost
from
utils.encode
import
base64Encode
from
controllers.service
import
storage_service
def
getPics
(
path
=
'images'
):
base_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)))
# 上级目录
img_path
=
os
.
path
.
join
(
base_path
,
f
'
{
path
}
'
)
os
.
makedirs
(
img_path
,
exist_ok
=
True
)
file_name
=
os
.
listdir
(
img_path
)
# file_name = list(filter(lambda x: str(x).endswith('.js') and str(x).find('模板') < 0, file_name))
# print(file_name)
pic_list
=
[
base_path
+
file
for
file
in
file_name
]
# pic_list = file_name
# print(type(pic_list))
return
pic_list
def
get_live_url
(
new_conf
,
mode
):
host
=
getHost
(
mode
)
lsg
=
storage_service
()
# t1 = time()
live_url
=
host
+
'/lives'
if
new_conf
.
get
(
'LIVE_MODE'
,
1
)
==
0
else
lsg
.
getItem
(
'LIVE_URL'
,
getHost
(
2
)
+
'/lives'
)
live_url
=
base64Encode
(
live_url
)
# print(f'{get_interval(t1)}毫秒')
return
live_url
def
getAlist
():
base_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)))
# 上级目录
alist_path
=
os
.
path
.
join
(
base_path
,
'js/alist.conf'
)
with
open
(
alist_path
,
encoding
=
'utf-8'
)
as
f
:
data
=
f
.
read
().
strip
()
alists
=
[]
for
i
in
data
.
split
(
'
\n
'
):
i
=
i
.
strip
()
dt
=
i
.
split
(
','
)
if
not
i
.
strip
().
startswith
(
'#'
):
obj
=
{
'name'
:
dt
[
0
],
'server'
:
dt
[
1
],
'type'
:
"alist"
,
}
if
len
(
dt
)
>
2
:
obj
.
update
({
'password'
:
dt
[
2
]
})
alists
.
append
(
obj
)
print
(
f
'共计
{
len
(
alists
)
}
条alist记录'
)
return
alists
\ No newline at end of file
utils/system.py
0 → 100644
浏览文件 @
d6fb43eb
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : system.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date : 2022/9/6
from
werkzeug.utils
import
import_string
from
base
import
config
from
flask
import
request
import
psutil
import
sys
from
easydict
import
EasyDict
as
edict
def
get_conf
(
obj
):
new_conf
=
{}
if
isinstance
(
obj
,
str
):
obj
=
import_string
(
obj
)
for
key
in
dir
(
obj
):
if
key
.
isupper
():
new_conf
[
key
]
=
getattr
(
obj
,
key
)
return
new_conf
cfg
=
edict
(
get_conf
(
config
))
def
get_wlan_info
():
info
=
psutil
.
net_if_addrs
()
# print(info)
netcard_info
=
[]
ips
=
[]
for
k
,
v
in
info
.
items
():
for
item
in
v
:
if
item
[
0
]
==
2
:
netcard_info
.
append
((
k
,
item
[
1
]))
ips
.
append
(
item
[
1
])
return
netcard_info
,
ips
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
getHost
(
mode
=
0
,
port
=
None
):
port
=
port
or
request
.
environ
.
get
(
'SERVER_PORT'
)
# mode 为0是本地,1是局域网 2是线上
if
mode
==
0
:
host
=
f
'http://localhost:
{
port
}
'
elif
mode
==
1
:
REAL_IP
=
get_host_ip
()
ip
=
REAL_IP
host
=
f
'http://
{
ip
}
:
{
port
}
'
else
:
host
=
cfg
.
get
(
'PLAY_URL'
,
'http://cms.nokia.press'
)
return
host
def
is_linux
():
return
not
'win'
in
sys
.
platform
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录