webdav3.exceptions.MethodNotSupported

0 人关注

我正试图从服务器上下载一个文件。

from webdav3.client import Client
import requests, yaml, logging, os
PATH="/share/document/"
NAS="NAS/"
NAS_file="NAS.pdf"
remote=PATH+NAS
remote_path=PATH+NAS+NAS_file
local_path="./Docs/"
logging.captureWarnings(True)
doc="http://.com"
with open('config.yaml') as f:
    config = yaml.load(f, Loader=yaml.loader.SafeLoader)
options = {
 'webdav_hostname': doc,
 'webdav_login': config['login'],
 'webdav_password': config["password"],
 'webdav_override_methods': {
            'check': 'GET'
client = Client(options)
print(client.webdav.is_valid())
# client.verify = False
client.default_options['SSL_VERIFYPEER'] = False 
client.default_options['SSL_VERIFYHOST'] = False
client.download_sync(remote_path=remote_path, local_path=local_path)