更新文件: getwebdavlist.exe, webdav_simulator.arm64, getwebdavlist.py, webdav_simulator.amd64, requirements.txt 等8个文件
This commit is contained in:
@ -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=="":
|
||||
|
Reference in New Issue
Block a user