On Wednesday, September 02, 2015 7:01:24 AM Mick wrote:
> On Wednesday 02 Sep 2015 00:04:19 Fernando Rodriguez wrote:
> > On Tuesday, September 01, 2015 11:25:08 AM Mick wrote:
> > > On Friday 28 Aug 2015 12:55:37 you wrote:
> > > > Hi All,
> > > > 
> > > > Apparently OneDrive, the Microsoft cloud storage, is using the webdav
> > > > protocol.  However, to effect authentication OneDrive uses redirection
> > > > to a different URL, which breaks Linux connections to it.  This page
> > > > explains someone's attempts using the previous MS offering of
> > > > SkyDrive:
> > > > 
> > > > http://blog.lazut.in/2012/12/skydrive-webdav-access.html
> > > > 
> > > > I've tried the suggestions using both cadaver and dolphin.  Both 
failed
> > > > to connect.  I have not used net-fs/davfs2 to mount OneDrive, but I
> > > > read in the above link that davfs2 does not handle redirects either.
> > > > 
> > > > Would you know of some trick to allow me to access onedrive from 
Linux?
> > > > Read only access will do for the use case I have in mind, which is to
> > > > browse and download some files from a customer's shared folder.
> > > > 
> > > > 
> > > > PS. I've also found 'onedrive-d' a python script/program, which does
> > > > not seem to be available in portage, or any overlays.  Do you know if
> > > > there's an ebuild somewhere for it?  However, I think that this is for
> > > > synch'ing a local fs to OneDrive - something I am not necessarily
> > > > interested in.
> > > 
> > > What?!  No-one on this list had to use OneDrive?  I can't believe it.  
:p
> > 
> > I've had to but wasn't able to :) Only for a little while I got it to work
> > with an old version of onedrive-d until it stopped working. I decided to
> > give the last usable version[1] (that's the one they're using with Ubuntu,
> > the one on the new repo says it's not usable) a try but it has python deps
> > that are not on gentoo or conflict.
> > 
> > https://github.com/xybu/onedrive-d-old/tree/future
> 
> Thank you Fernando.
> 
> So, I take it that no direct webdav based access is possible at this stage.  
I 
> was hoping that some structured URL invocation would get me there, but it 
> seems this won't be the case.  :-(
> 

There must be but I never got it to work and it's not documented so it's 
subject to change. There's documented REST API[1] I got this from Clementine's 
code:

https://login.live.com/oauth20_token.srf?client_id=0000000040111F16&client_secret=w2ClguSX0jG56cBl1CeUniypTBRjXt2Z&grant_type=refresh_token&refresh_token=

If you install clementine and login to onedrive you'll have a refresh_token on 
the config file. Append it to that url and it'll give you an access token good 
for five minutes. Then to list the contents of a folder:

https://apis.live.net/v5.0/folder.<cid>.<id>/files?access_token=<access_token>

to get a file (this will give you a direct url on the source field):

https://apis.live.net/v5.0/file.<cid>.<id>?access_token=<access_token>


Maybe you can play with the webdav urls and the access token and see if you 
can get it to work.

-- 
Fernando Rodriguez

Reply via email to