更新文件: getwebdavlist.exe, webdav_simulator.arm64, getwebdavlist.py, webdav_simulator.amd64, requirements.txt 等8个文件
This commit is contained in:
BIN
get115list.exe
BIN
get115list.exe
Binary file not shown.
@ -6,15 +6,19 @@ from p115 import P115Client, P115FileSystem
|
||||
import time
|
||||
import traceback
|
||||
import os
|
||||
import re
|
||||
|
||||
count=0
|
||||
|
||||
def walk_dir(fs,f,replaceroot):
|
||||
dirlist=list()
|
||||
file_list = fs.listdir_attr()
|
||||
filetype_re=re.compile(r'\.(png|jpg|jpeg|bmp|gif|doc|nfo|flac|mp3|wma|ape|cue|wav|dst|dff|dts|ac3|eac3|txt)$')
|
||||
for file_obj in file_list:
|
||||
if not file_obj.is_directory:
|
||||
path = file_obj.path
|
||||
if filetype_re.search(path) != None or "BDMV" in path:
|
||||
continue
|
||||
paths = path.split("/")
|
||||
if replaceroot!="":
|
||||
if len(paths)>=3:
|
||||
@ -27,10 +31,10 @@ def walk_dir(fs,f,replaceroot):
|
||||
dirlist.append(file_obj.path)
|
||||
for dirItem in dirlist:
|
||||
fs.chdir(dirItem)
|
||||
global count
|
||||
count=count+1
|
||||
if count%4==0:
|
||||
time.sleep(1)
|
||||
# global count
|
||||
# count=count+1
|
||||
# if count%4==0:
|
||||
# time.sleep(1)
|
||||
walk_dir(fs,f,replaceroot)
|
||||
return
|
||||
|
||||
|
Binary file not shown.
@ -5,15 +5,19 @@ import argparse
|
||||
from webdav3.client import Client
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
|
||||
count=0
|
||||
|
||||
def walk(client, current_path="/", output_file=None, replaceroot=None):
|
||||
items=client.list(current_path)
|
||||
filetype_re=re.compile(r'\.(png|jpg|jpeg|bmp|gif|doc|nfo|flac|mp3|wma|ape|cue|wav|dst|dff|dts|ac3|eac3|txt)$')
|
||||
# print(items)
|
||||
for item in items[1:]:
|
||||
full_path = f"{current_path}/{item}".replace("//", "/")
|
||||
try:
|
||||
is_dir = client.is_dir(full_path)
|
||||
# is_dir = client.is_dir(full_path)
|
||||
is_dir = full_path.endswith("/")
|
||||
except:
|
||||
continue
|
||||
if is_dir: # 判断是否为目录
|
||||
@ -26,6 +30,8 @@ def walk(client, current_path="/", output_file=None, replaceroot=None):
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
if filetype_re.search(full_path) != None or "BDMV" in full_path:
|
||||
continue
|
||||
size = client.info(full_path).get('size', 0)
|
||||
if replaceroot!=None:
|
||||
if replaceroot=="":
|
||||
|
@ -1,3 +1,4 @@
|
||||
wsgidav
|
||||
cheroot
|
||||
requests
|
||||
cachetools
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user