question

krishna prasad srinivasan avatar image
krishna prasad srinivasan asked

Cloud Drive acess using Python

I'm trying to build a PC/MAC command line application basically to do a sync to cloud drive. but I need some help 1) I understand that I need to use "Login with Amazon" , I'm using python and on a command line, how do I enable this? 2) is there any plan to support this in "Boto" ~ Krishna
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

earnol avatar image
earnol answered
Well. I'm doing the same, just with perl. Right now it seems one needs to get to login via browser using "Authorization Code Grant" and then refresh access token indefinitely. The only problem right now it https requirement for me.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

krishna prasad srinivasan avatar image
krishna prasad srinivasan answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

earnol avatar image
earnol answered
It already works for me :) http://pastebin.com/EQcqF1Kn Please see code snippet. Refresh code for now stored in file and can be updated indefinitely. The core is supported by line: use base qw(Net::Server::HTTP); 10.0.0.214 is my NAS.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

earnol avatar image
earnol answered
Upon request i can provide full source code i have by now, but it is dirty and not yet ready, so do not expect much. PS: I'm working over FUSE ACD module built with API, contrary to https://github.com/handyman5/acd_fuse with is build around web browser emulation. PPS: For some reason i cannot edit my own messages?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick avatar image
Nick answered
Yes, you need to use "Authorization Code Grant" from getting started. For desktop app you need to set redirect url to http://localhost:port and you need to run a simple web server to get code (I use BaseHTTPServer). Essentially your app should: 1) Generate [1] url and open it in browser 2) Start server to 'listen' on localhost:port 3) User grants access -> parse url to get 'code' 4) Stop server 5) Exchange code for access and refresh tokens. The issue I'm currently facing is Nodes API download doesn't seem to support files larger than 10 GB (just as Amazon's web client). Would be nice to get it documented or (better) fixed. [1]: https://www.amazon.com/ap/oa?client_id=your_client_id&scope=clouddrive%3Aread%20clouddrive%3Awrite&response_type=code&redirect_uri=http://localhost:port
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

earnol avatar image
earnol answered
Actually, you do not need server. I've just used Selenium ( http://docs.seleniumhq.org/download/) for authorization without server. Works fine. However usage of server seems to be more convenient solution. Right now, i'm thinking into use of portable browser with server with embedded CA certificate i've used to sign localhost. Works fine too.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lyrrad0 avatar image
lyrrad0 answered
> > The issue I'm currently facing is Nodes API download > doesn't seem to support files larger than 10 GB (just > as Amazon's web client). Would be nice to get it > documented or (better) fixed. > Yeah, I'm having the same problem. There's also some strange errors when uploading files over 10GB, but those files at least are able to finish their uploads. I sent them an email about the download problems. Hopefully they're able to resolve this.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jiasheng Zhuang avatar image
Jiasheng Zhuang answered
Check my work: https://github.com/cnbeining/Amazon-Cloud-Drive-Python-SDK Which would give you an idea about what to do. 1. You jump to the OAuth login screen of Amazon, then use any HTTPS site to retrieve the code. Cannot retrieve? Ask them to input by themselves. 2. I do not want to go with that, so I've make my own version.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.