更新文件: 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 time
|
||||||
import traceback
|
import traceback
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
|
|
||||||
def walk_dir(fs,f,replaceroot):
|
def walk_dir(fs,f,replaceroot):
|
||||||
dirlist=list()
|
dirlist=list()
|
||||||
file_list = fs.listdir_attr()
|
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:
|
for file_obj in file_list:
|
||||||
if not file_obj.is_directory:
|
if not file_obj.is_directory:
|
||||||
path = file_obj.path
|
path = file_obj.path
|
||||||
|
if filetype_re.search(path) != None or "BDMV" in path:
|
||||||
|
continue
|
||||||
paths = path.split("/")
|
paths = path.split("/")
|
||||||
if replaceroot!="":
|
if replaceroot!="":
|
||||||
if len(paths)>=3:
|
if len(paths)>=3:
|
||||||
@ -27,10 +31,10 @@ def walk_dir(fs,f,replaceroot):
|
|||||||
dirlist.append(file_obj.path)
|
dirlist.append(file_obj.path)
|
||||||
for dirItem in dirlist:
|
for dirItem in dirlist:
|
||||||
fs.chdir(dirItem)
|
fs.chdir(dirItem)
|
||||||
global count
|
# global count
|
||||||
count=count+1
|
# count=count+1
|
||||||
if count%4==0:
|
# if count%4==0:
|
||||||
time.sleep(1)
|
# time.sleep(1)
|
||||||
walk_dir(fs,f,replaceroot)
|
walk_dir(fs,f,replaceroot)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Binary file not shown.
@ -5,15 +5,19 @@ import argparse
|
|||||||
from webdav3.client import Client
|
from webdav3.client import Client
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import re
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
|
|
||||||
def walk(client, current_path="/", output_file=None, replaceroot=None):
|
def walk(client, current_path="/", output_file=None, replaceroot=None):
|
||||||
items=client.list(current_path)
|
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:]:
|
for item in items[1:]:
|
||||||
full_path = f"{current_path}/{item}".replace("//", "/")
|
full_path = f"{current_path}/{item}".replace("//", "/")
|
||||||
try:
|
try:
|
||||||
is_dir = client.is_dir(full_path)
|
# is_dir = client.is_dir(full_path)
|
||||||
|
is_dir = full_path.endswith("/")
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
if is_dir: # 判断是否为目录
|
if is_dir: # 判断是否为目录
|
||||||
@ -26,6 +30,8 @@ def walk(client, current_path="/", output_file=None, replaceroot=None):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
if filetype_re.search(full_path) != None or "BDMV" in full_path:
|
||||||
|
continue
|
||||||
size = client.info(full_path).get('size', 0)
|
size = client.info(full_path).get('size', 0)
|
||||||
if replaceroot!=None:
|
if replaceroot!=None:
|
||||||
if replaceroot=="":
|
if replaceroot=="":
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
wsgidav
|
wsgidav
|
||||||
cheroot
|
cheroot
|
||||||
requests
|
requests
|
||||||
|
cachetools
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user