Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
332 views
in Technique[技术] by (71.8m points)

python - Programmatically Download Content from Shared Dropbox Folder Links

I'm building an application to automatically trigger a download of a Dropbox file shared with a user (shared file/folder link). This was straight forward to implement for Dropbox links to files, as is outlined here.

Unfortunately this doesn't work for shared folders. Anyone have suggestions on how I could

  • Download the all of it's contents (maybe get a list of the files links inside it to download?)
  • or
  • Download a zip of the folder

Currently I can go to the url and do some screen-scraping to try and get the contents list, but the advantage of the solution described in the linked Dropbox blog entry for files is that no scraping is needed, so it's much more reliable and efficient.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Dropbox's support team just filled me in on the best way to do this:

Just add ?dl=1 to the end of the shared link. That'll give you a zipped version of the shared folder.

So if the link shared with a user is https://www.dropbox.com/sh/xyz/xyz-YZ (or similar, which links to a shared folder), to download a zipped version of that folder just access https://www.dropbox.com/sh/xyz/xyz-YZ?dl=1

Hope this helps someone else also.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...