|
|
|
@ -13,11 +13,9 @@ let contain = /\.mp4|\.avi|\.mkv|\.rmvb|\.flv|\.mov|\.ts|\.mp3|\.m4a|\.wma|\.fla |
|
|
|
|
|
|
|
|
|
function gethtml(api,path,password) { |
|
|
|
|
try{ |
|
|
|
|
log(api+"@"+path+"@"+password) |
|
|
|
|
path = path || ""; |
|
|
|
|
password = password || ""; |
|
|
|
|
let html = fetch(api, {body: {"path":path,"password":password},method:'POST',timeout:10000}); |
|
|
|
|
log('html'+html); |
|
|
|
|
return html; |
|
|
|
|
}catch(e){ |
|
|
|
|
log(e.message); |
|
|
|
@ -25,9 +23,11 @@ function gethtml(api,path,password) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
function getlist(data,isdir) { |
|
|
|
|
log(fileFilter); |
|
|
|
|
let list = data.filter(item => { |
|
|
|
|
return isdir ? item.is_dir : fileFilter? contain.test(item.name) || /\.srt|\.vtt|\.ass/.test(item.name) : item.is_dir==0; |
|
|
|
|
return isdir ? item.is_dir : fileFilter? (contain.test(item.name) || /\.srt|\.vtt|\.ass/.test(item.name)) : item.is_dir==0; |
|
|
|
|
}) |
|
|
|
|
log(list); |
|
|
|
|
try{
|
|
|
|
|
//if(!isdir){
|
|
|
|
|
list.sort(SortList); |
|
|
|
@ -35,7 +35,6 @@ function getlist(data,isdir) { |
|
|
|
|
}catch(e){ |
|
|
|
|
log(e.message); |
|
|
|
|
} |
|
|
|
|
log(list); |
|
|
|
|
return list || []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|