Wednesday, 11 September 2013

Use Webdav on Linux to get a file from SkyDrive *without* mounting

Use Webdav on Linux to get a file from SkyDrive *without* mounting

I want to download a file from SkyDrive programmatically using Python on
Linux.
I can't use the API as it's a OneNote file and the API can't be used to
download these.
My understanding is that SD supports Webdav and there are plenty of
examples where people have mounted an SD folder using davfs2 but I just
want to be able to grab a specific file without mounting.
I can use the API to get the document owner's cid so don't need to jump
through any windows based hoops but my - probably lame, have not really
researched webdav - efforts to download the file always resort in an
error.
For example using easywebdav:
import easywebdav
webdav = easywebdav.connect("d.docs.live.net/mycid")
webdav.download('me/skydrive/Documents/Getting\ Started', '/tmp/foo')
#this gives the 302 error mentioned in the comments at the end of the the
'jumping through windows hoops' link I posted above.
Is there any workaround for the redirection problem I've seen mentioned?
Do I have this wrong and when accessing files on a webdav share it makes
sense, and indeed it's essential, to mount it as a file system?

No comments:

Post a Comment