0

I've never used WebDav before, but I downloaded Cyberduck and used it to connect to an internal work drive and download an entire directory to my desktop. However, for reasons I can't yet identify, I run into random errors where some files don't download. I believe this is related to the network, not Cyberduck.

The problem I'm having is that Cyberduck doesn't keep a record of the errors and doesn't seem to have very robust error and exception processing.

I'd like to run the same process through a python program so I can make a record of errors.

However, the libraries I've tried I can't connect. I'm sure the problem is user error.

I've tried easywebdav and webdavclient3, but I can't seem to replicate a connection.

For easywebdav I've tried to mimic the info I input for Cyberduck (see image below) like so:

import easywebdav

webdav = easywebdav.connect(host='drive.corp.amazon.com', 
                            username='username', 
                            port=443, 
                            protocol='https', 
                            password='password')

print(webdav.ls())

But that doesn't work.

And I've tried changing the host argument to https://username@drive.corp.amazon.com/mnt/... but no luck there either. Any idea what I'm doing wrong?

Cyberduck Entry

Hofbr
  • 868
  • 9
  • 31

1 Answers1

1

It seems Cyberduck is configured for using NTLM authentication, but requests by default use Basic authentication.

For connecting to WebDAV server with NTLM authentication you can use 3rd party library which implements it, for example requests-ntlm:

from webdav3.client import Client
from requests_ntlm import HttpNtlmAuth

options = {
 'webdav_hostname': "https://webdav.server.ru"
}

client = Client(options)
# Configure authentication method 
client.session.auth = HttpNtlmAuth('domain\\username','password')
  • Thanks Evgeny. Really appreciate the engineer behind webdav3 weighing in. I tried the solution recommended above, but I'm getting an error still. webdav3.exceptions.NoConnection: No connection with https://drive.corp.amazon.com This may be a dumb question, but what should I be typing in the "domain\\username"? Do I replace the "domain" string with the actual domain? Say drive.corp.amazon.com in this instance? – Hofbr Jul 29 '20 at 04:55
  • I think for the average person experiencing a similar problem, this would work. I've used your requests_ntlm in other solutions at my workplace, and its worked well where basic authentication fails. Their doesn't appear to be an obvious, python level solution to the problem I'm facing. Something about the internal work application I'm using just simply has a lot of problems. – Hofbr Aug 24 '20 at 01:58