See CloudStor access via WebDAV for the beginning of this adventure. Having access data from my CloudStor account via WebDAV I was left wondering if you could do the same with something that had been publicly shared. It turns out you can, but once again, it's not obvious...
# Software setup is the same as last time
import webdav.client as wc
import random
import pandas as pd
import time
from credentials import *
A bit of googling relating to OwnCloud, WebDAV, and public shares led me to this discussion. The critical thing is that you set the webdav_login
to the value of the token in the share link, and the password to an empty string.
I uploaded a page from an ASIO file I'd harvested from the National Archives to my CloudStor account and created a public link: https://cloudstor.aarnet.edu.au/plus/s/yWvV1Mno3FWp6cO
The bit on the end is the token that you use as the login: yWvV1Mno3FWp6cO
The hostname is the same as last time, but what is the webdav_root
? This had me flummoxed for a while, but eventually I realised that you had to change the remote.php
in the standard WebDAV config to public.php
.
BINGO!
options = {
'webdav_hostname': 'https://cloudstor.aarnet.edu.au',
'webdav_login': 'yWvV1Mno3FWp6cO',
'webdav_password': '',
'webdav_root': '/plus/public.php/webdav/'
}
client = wc.Client(options)
client.list()
['272217-p285.jpg']
client.info('272217-p285.jpg')
{'created': None, 'name': None, 'size': '274306', 'modified': 'Sun, 19 Jul 2015 10:29:01 GMT'}