Cloudstor access to a public share via WebDAV

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...

In [24]:
# 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:

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.


In [25]:
options = {
    'webdav_hostname': '',
    'webdav_login':    'yWvV1Mno3FWp6cO',
    'webdav_password': '',
    'webdav_root': '/plus/public.php/webdav/'

Access the file

In [26]:
client = wc.Client(options)
In [27]:
In [28]:'272217-p285.jpg')
{'created': None,
 'name': None,
 'size': '274306',
 'modified': 'Sun, 19 Jul 2015 10:29:01 GMT'}