Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
言程序plus
dr_py
提交
74825423
dr_py
项目概览
言程序plus
/
dr_py
与 Fork 源项目一致
从无法访问的项目Fork
通知
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看板
提交
74825423
编写于
11月 24, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化alist和设置中心
上级
d0b2ba95
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
79 addition
and
22 deletion
+79
-22
base/rules.db
base/rules.db
+0
-0
js/version.txt
js/version.txt
+1
-1
libs/alist.js
libs/alist.js
+56
-18
libs/alist.min.js
libs/alist.min.js
+1
-1
readme.md
readme.md
+3
-0
templates/settings.html
templates/settings.html
+18
-2
未找到文件。
base/rules.db
浏览文件 @
74825423
无法预览此类型文件
js/version.txt
浏览文件 @
74825423
3.9.23beta9
3.9.24
\ No newline at end of file
\ No newline at end of file
libs/alist.js
浏览文件 @
74825423
...
@@ -228,12 +228,17 @@ function homeVod(params) {
...
@@ -228,12 +228,17 @@ function homeVod(params) {
}
}
function
category
(
tid
,
pg
,
filter
,
extend
)
{
function
category
(
tid
,
pg
,
filter
,
extend
)
{
let
{
drives
,
path
}
=
get_drives_path
(
tid
);
let
orid
=
tid
.
replace
(
/#all#|#search#/g
,
''
);
const
id
=
tid
.
endsWith
(
'
/
'
)
?
tid
:
tid
+
'
/
'
;
let
{
drives
,
path
}
=
get_drives_path
(
orid
);
const
id
=
orid
.
endsWith
(
'
/
'
)
?
orid
:
orid
+
'
/
'
;
const
list
=
drives
.
getPath
(
path
);
const
list
=
drives
.
getPath
(
path
);
let
subList
=
[];
let
subList
=
[];
let
vodFiles
=
[];
let
vodFiles
=
[];
let
allList
=
[];
let
allList
=
[];
let
fl
=
filter
?
extend
:{};
if
(
fl
.
show
){
showMode
=
fl
.
show
;
}
list
.
forEach
(
item
=>
{
list
.
forEach
(
item
=>
{
if
(
drives
.
is_subt
(
item
))
{
if
(
drives
.
is_subt
(
item
))
{
subList
.
push
(
item
.
name
);
subList
.
push
(
item
.
name
);
...
@@ -244,8 +249,13 @@ function category(tid, pg, filter, extend) {
...
@@ -244,8 +249,13 @@ function category(tid, pg, filter, extend) {
let
vod_time
=
drives
.
getTime
(
item
);
let
vod_time
=
drives
.
getTime
(
item
);
let
vod_size
=
get_size
(
item
.
size
);
let
vod_size
=
get_size
(
item
.
size
);
let
remark
=
vod_time
.
split
(
'
'
)[
0
].
substr
(
3
)
+
'
\t
'
+
vod_size
;
let
remark
=
vod_time
.
split
(
'
'
)[
0
].
substr
(
3
)
+
'
\t
'
+
vod_size
;
let
vod_id
=
id
+
item
.
name
+
(
drives
.
isFolder
(
item
)
?
'
/
'
:
''
);
if
(
showMode
===
'
all
'
){
vod_id
+=
'
#all#
'
;
}
print
(
vod_id
);
const
vod
=
{
const
vod
=
{
'
vod_id
'
:
id
+
item
.
name
+
(
drives
.
isFolder
(
item
)
?
'
/
'
:
''
)
,
'
vod_id
'
:
vod_id
,
'
vod_name
'
:
item
.
name
.
replaceAll
(
"
$
"
,
""
).
replaceAll
(
"
#
"
,
""
),
'
vod_name
'
:
item
.
name
.
replaceAll
(
"
$
"
,
""
).
replaceAll
(
"
#
"
,
""
),
'
vod_pic
'
:
drives
.
getPic
(
item
),
'
vod_pic
'
:
drives
.
getPic
(
item
),
'
vod_time
'
:
vod_time
,
'
vod_time
'
:
vod_time
,
...
@@ -299,7 +309,7 @@ function category(tid, pg, filter, extend) {
...
@@ -299,7 +309,7 @@ function category(tid, pg, filter, extend) {
}
}
});
});
}
}
let
fl
=
filter
?
extend
:{};
if
(
fl
.
order
){
if
(
fl
.
order
){
// print(fl.order);
// print(fl.order);
let
key
=
fl
.
order
.
split
(
'
_
'
).
slice
(
0
,
-
1
).
join
(
'
_
'
);
let
key
=
fl
.
order
.
split
(
'
_
'
).
slice
(
0
,
-
1
).
join
(
'
_
'
);
...
@@ -327,9 +337,7 @@ function category(tid, pg, filter, extend) {
...
@@ -327,9 +337,7 @@ function category(tid, pg, filter, extend) {
allList
=
sortListByName
(
allList
,
'
vod_name
'
,
'
asc
'
);
allList
=
sortListByName
(
allList
,
'
vod_name
'
,
'
asc
'
);
}
}
}
}
if
(
fl
.
show
){
showMode
=
fl
.
show
;
}
print
(
"
----category----
"
+
`tid:
${
tid
}
,detail_order:
${
detail_order
}
,showMode:
${
showMode
}
`
);
print
(
"
----category----
"
+
`tid:
${
tid
}
,detail_order:
${
detail_order
}
,showMode:
${
showMode
}
`
);
// print(allList);
// print(allList);
return
JSON
.
stringify
({
return
JSON
.
stringify
({
...
@@ -344,15 +352,23 @@ function category(tid, pg, filter, extend) {
...
@@ -344,15 +352,23 @@ function category(tid, pg, filter, extend) {
function
getAll
(
otid
,
tid
,
drives
,
path
){
function
getAll
(
otid
,
tid
,
drives
,
path
){
try
{
try
{
const
content
=
category
(
tid
,
null
,
false
,
null
);
const
content
=
category
(
tid
,
null
,
false
,
null
);
const
isFile
=
isMedia
(
otid
.
replace
(
/#all#|#search#/g
,
''
));
const
{
list
}
=
JSON
.
parse
(
content
);
const
{
list
}
=
JSON
.
parse
(
content
);
let
vod_play_url
=
[];
let
vod_play_url
=
[];
list
.
forEach
(
x
=>
{
list
.
forEach
(
x
=>
{
if
(
x
.
vod_tag
===
'
file
'
){
if
(
x
.
vod_tag
===
'
file
'
){
vod_play_url
.
push
(
`
${
x
.
vod_name
}
$
${
x
.
vod_id
.
substring
(
x
.
vod_id
.
indexOf
(
'
$
'
)
+
1
)}
`
);
let
vid
=
x
.
vod_id
.
replace
(
/#all#|#search#/g
,
''
);
vod_play_url
.
push
(
`
${
x
.
vod_name
}
$
${
vid
.
substring
(
vid
.
indexOf
(
'
$
'
)
+
1
)}
`
);
}
}
});
});
const
pl
=
path
.
split
(
"
/
"
);
const
pl
=
path
.
split
(
"
/
"
).
filter
(
it
=>
it
);
const
vod_name
=
pl
[
pl
.
length
-
2
]
||
drives
.
name
;
let
vod_name
=
pl
[
pl
.
length
-
1
]
||
drives
.
name
;
if
(
vod_name
===
drives
.
name
){
print
(
pl
);
}
if
(
otid
.
includes
(
'
#search#
'
)){
vod_name
+=
'
[搜]
'
;
}
let
vod
=
{
let
vod
=
{
// vod_id: tid,
// vod_id: tid,
vod_id
:
otid
,
vod_id
:
otid
,
...
@@ -375,24 +391,34 @@ function getAll(otid,tid,drives,path){
...
@@ -375,24 +391,34 @@ function getAll(otid,tid,drives,path){
}
}
function
detail
(
tid
)
{
function
detail
(
tid
)
{
let
isSearch
=
tid
.
endsWith
(
'
#search#
'
);
let
isSearch
=
tid
.
includes
(
'
#search#
'
);
let
isAll
=
tid
.
includes
(
'
#all#
'
);
let
otid
=
tid
;
let
otid
=
tid
;
tid
=
tid
.
replace
(
'
#search#
'
,
''
);
tid
=
tid
.
replace
(
/#all#|#search#/g
,
''
);
let
isFile
=
isMedia
(
tid
);
let
isFile
=
isMedia
(
tid
);
let
{
drives
,
path
}
=
get_drives_path
(
tid
);
let
{
drives
,
path
}
=
get_drives_path
(
tid
);
if
(
path
.
endsWith
(
"
/
"
))
{
//长按文件夹可以 加载里面全部视频到详情
if
(
path
.
endsWith
(
"
/
"
))
{
//长按文件夹可以 加载里面全部视频到详情
return
getAll
(
otid
,
tid
,
drives
,
path
);
return
getAll
(
otid
,
tid
,
drives
,
path
);
}
else
{
}
else
{
if
(
isSearch
&&!
isFile
){
if
(
isSearch
&&!
isFile
){
// 搜索结果 当前目录获取所有文件
return
getAll
(
otid
,
tid
,
drives
,
path
);
return
getAll
(
otid
,
tid
,
drives
,
path
);
}
else
if
(
showMode
===
'
all
'
){
// 不管是搜索还是分类,只要不是 搜索到的文件夹,且展示模式为全部,都获取上级目录的所有文件
}
else
if
(
isAll
){
// 上级目录获取所有文件 不管是搜索还是分类,只要不是 搜索到的文件夹,且展示模式为全部,都获取上级目录的所有文件
let
new_tid
=
tid
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
)
+
'
/
'
;
// 是文件就取上级目录
let
new_tid
;
if
(
isFile
){
new_tid
=
tid
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
)
+
'
/
'
;
}
else
{
new_tid
=
tid
;
}
print
(
`全集模式 tid:
${
tid
}
=>tid:
${
new_tid
}
`
);
print
(
`全集模式 tid:
${
tid
}
=>tid:
${
new_tid
}
`
);
let
{
drives
,
path
}
=
get_drives_path
(
new_tid
);
let
{
drives
,
path
}
=
get_drives_path
(
new_tid
);
return
getAll
(
otid
,
new_tid
,
drives
,
path
);
return
getAll
(
otid
,
new_tid
,
drives
,
path
);
}
else
{
}
else
if
(
isFile
){
// 单文件进入
let
paths
=
path
.
split
(
"
@@@
"
);
let
paths
=
path
.
split
(
"
@@@
"
);
let
vod_name
=
paths
[
0
].
substring
(
paths
[
0
].
lastIndexOf
(
"
/
"
)
+
1
);
let
vod_name
=
paths
[
0
].
substring
(
paths
[
0
].
lastIndexOf
(
"
/
"
)
+
1
);
if
(
otid
.
includes
(
'
#search#
'
)){
vod_name
+=
'
[搜]
'
;
}
let
vod
=
{
let
vod
=
{
vod_id
:
otid
,
vod_id
:
otid
,
vod_name
:
vod_name
,
vod_name
:
vod_name
,
...
@@ -408,6 +434,10 @@ function detail(tid) {
...
@@ -408,6 +434,10 @@ function detail(tid) {
return
JSON
.
stringify
({
return
JSON
.
stringify
({
'
list
'
:
[
vod
]
'
list
'
:
[
vod
]
});
});
}
else
{
return
JSON
.
stringify
({
'
list
'
:
[]
});
}
}
}
}
}
}
...
@@ -432,12 +462,13 @@ function play(flag, id, flags) {
...
@@ -432,12 +462,13 @@ function play(flag, id, flags) {
function
search
(
wd
,
quick
)
{
function
search
(
wd
,
quick
)
{
print
(
__drives
);
print
(
__drives
);
print
(
'
可搜索的alist驱动:
'
+
searchDriver
);
print
(
'
可搜索的alist驱动:
'
+
searchDriver
);
if
(
!
searchDriver
){
if
(
!
searchDriver
||!
wd
){
return
JSON
.
stringify
({
return
JSON
.
stringify
({
'
list
'
:
[]
'
list
'
:
[]
});
});
}
else
{
}
else
{
let
driver
=
__drives
[
searchDriver
];
let
driver
=
__drives
[
searchDriver
];
wd
=
wd
.
split
(
'
'
).
filter
(
it
=>
it
.
trim
()).
join
(
'
+
'
);
print
(
driver
);
print
(
driver
);
let
surl
=
driver
.
server
+
'
/search?box=
'
+
wd
+
'
&url=
'
;
let
surl
=
driver
.
server
+
'
/search?box=
'
+
wd
+
'
&url=
'
;
if
(
search_type
){
if
(
search_type
){
...
@@ -452,16 +483,23 @@ function search(wd, quick) {
...
@@ -452,16 +483,23 @@ function search(wd, quick) {
print
(
`搜索结果数:
${
lists
.
length
}
,搜索结果显示数量限制:
${
limit_search_show
}
`
);
print
(
`搜索结果数:
${
lists
.
length
}
,搜索结果显示数量限制:
${
limit_search_show
}
`
);
let
vods
=
[];
let
vods
=
[];
let
excludeReg
=
/
\.(
pdf|epub|mobi|txt|doc|lrc
)
$/
;
// 过滤后缀文件
let
excludeReg
=
/
\.(
pdf|epub|mobi|txt|doc|lrc
)
$/
;
// 过滤后缀文件
let
cnt
=
0
;
lists
.
forEach
(
it
=>
{
lists
.
forEach
(
it
=>
{
let
vhref
=
pdfh
(
it
,
'
a&&href
'
);
let
vhref
=
pdfh
(
it
,
'
a&&href
'
);
if
(
vhref
){
if
(
vhref
){
vhref
=
unescape
(
vhref
);
vhref
=
unescape
(
vhref
);
}
}
print
(
vhref
);
if
(
excludeReg
.
test
(
vhref
)){
if
(
excludeReg
.
test
(
vhref
)){
return
;
//跳过本次循环
return
;
//跳过本次循环
}
}
if
(
cnt
<
limit_search_show
){
print
(
vhref
);
}
cnt
++
;
let
vid
=
searchDriver
+
'
$
'
+
vhref
+
'
#search#
'
;
let
vid
=
searchDriver
+
'
$
'
+
vhref
+
'
#search#
'
;
if
(
showMode
===
'
all
'
){
vid
+=
'
#all#
'
;
}
vods
.
push
({
vods
.
push
({
vod_name
:
pdfh
(
it
,
'
a&&Text
'
),
vod_name
:
pdfh
(
it
,
'
a&&Text
'
),
vod_id
:
vid
,
vod_id
:
vid
,
...
...
libs/alist.min.js
浏览文件 @
74825423
此差异已折叠。
点击以展开。
readme.md
浏览文件 @
74825423
...
@@ -49,6 +49,9 @@
...
@@ -49,6 +49,9 @@
[
dockerfile教程
](
https://blog.csdn.net/qq_46158060/article/details/125718218
)
[
dockerfile教程
](
https://blog.csdn.net/qq_46158060/article/details/125718218
)
[
获取本地设备信息
](
https://blog.csdn.net/cui_yonghua/article/details/125508991
)
[
获取本地设备信息
](
https://blog.csdn.net/cui_yonghua/article/details/125508991
)
[
获取本地设备信息
](
https://m.jb51.net/article/140716.htm
)
[
获取本地设备信息
](
https://m.jb51.net/article/140716.htm
)
###### 2022/11/24
-
[X] 优化alist的历史记录和收藏
-
[X] 设置中心环境变量增加前端的保存校验
###### 2022/11/23
###### 2022/11/23
-
[X] 优化alist的名称排序算法
-
[X] 优化alist的名称排序算法
###### 2022/11/22
###### 2022/11/22
...
...
templates/settings.html
浏览文件 @
74825423
...
@@ -51,11 +51,25 @@
...
@@ -51,11 +51,25 @@
}
}
});
});
}
}
function
checkValue
(
key
,
value
){
if
(
key
===
'
ENV
'
){
try
{
JSON
.
parse
(
value
);
}
catch
(
e
)
{
layer
.
msg
(
`保存失败,变量
${
key
}
必须为json格式!`
);
return
false
;
}
}
return
true
;
}
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
"
.save_conf
"
).
click
(
function
()
{
$
(
"
.save_conf
"
).
click
(
function
()
{
let
key
=
$
(
this
).
attr
(
'
value
'
);
let
key
=
$
(
this
).
attr
(
'
value
'
);
let
value
=
$
(
`input.conf[name="
${
key
}
"]`
).
val
();
let
value
=
$
(
`input.conf[name="
${
key
}
"]`
).
val
();
saveConf
(
key
,
value
);
if
(
checkValue
(
key
,
value
)){
saveConf
(
key
,
value
);
}
});
});
$
(
'
.edit_conf
'
).
click
(
function
(){
$
(
'
.edit_conf
'
).
click
(
function
(){
let
key
=
$
(
this
).
attr
(
'
value
'
);
let
key
=
$
(
this
).
attr
(
'
value
'
);
...
@@ -67,7 +81,9 @@
...
@@ -67,7 +81,9 @@
area
:
[
'
320px
'
,
'
100px
'
]
//自定义文本域宽高
area
:
[
'
320px
'
,
'
100px
'
]
//自定义文本域宽高
},
function
(
value
,
index
,
elem
){
},
function
(
value
,
index
,
elem
){
console
.
log
(
value
);
//得到value
console
.
log
(
value
);
//得到value
saveConf
(
key
,
value
);
if
(
checkValue
(
key
,
value
)){
saveConf
(
key
,
value
);
}
layer
.
close
(
index
);
layer
.
close
(
index
);
});
});
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录