Skip to content

Instantly share code, notes, and snippets.

@khanlou
Created September 2, 2013 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khanlou/6413418 to your computer and use it in GitHub Desktop.
Save khanlou/6413418 to your computer and use it in GitHub Desktop.
This is a simple python script for downloading all of the files in your cloud app. Caveats: "bookmarks" can't be downloaded, so they'll be outputted in the log. All files will be downloaded into the same directory as the python script. It requires pycloudapp, which you can find here: https://github.com/originell/pycloudapp.
# requires https://github.com/originell/pycloudapp
from cloudapp.cloud import Cloud
import urllib
mycloud = Cloud()
mycloud.auth("username", "password")
current_page = 1
total_count = 0;
while True:
items = mycloud.list_items(page=current_page, per_page=20)
for item in items:
try:
urllib.urlretrieve(item["content_url"], item["name"])
except:
print item["content_url"]
total_count += len(items)
print current_page
current_page += 1
if len(items) != 20:
break
print "done"
print total_count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment