I was wondering if there is a convenient way to download a full directory with an API call from a nextcloud server. Right now I can get a zip file by doing this with python’s request library:
response = requests.request(
method="get",
url=f"https://mynextcloud.de/remote.php/dav/files/{user}/{project_name}/"
f"{name_file}",
auth=(user, token),
)
print(response.status_code)
return response
If I get a 200 response I can save the zip file to a local directory. But what would be way more convenient is to not have a zip file but to put a folder with its subfolders and contents on the cloud and to download it with a single API call.
Is that possible with the WebDav API somehow and if so, how could I do this? I know there is this library https://github.com/owncloud/pyocclient but it doesn’t say anything about downloading complete dirs. Using wget like this wget wget --recursive https://cloud.heatbeat.de/remote.php/dav/files/setup_user/test/ --http-user=xxx --http-password=xxx.
downloads an index file saying This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client.
. So I guess wget and WebDav don’t work well together.
Thanks very much for the help! Appreciated!