Use curl to download a Dropbox folder via shared link (not public link)

前端 未结 2 1277
南笙
南笙 2021-02-01 13:04

Dropbox makes it easy to programmatically download a single file via curl (EX: curl -O https://dl.dropboxusercontent.com/s/file.ext). It is a little bit trickier fo

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-01 13:11

    It does appear to be possible with curl by using the -L option. This forces curl to follow the redirect. Additionally, it is important to specify an output name with a .zip extension, as the default will be a random alpha-numeric name with no extension. Finally, do not forget to add the ?dl=1 to the end of the link. Without it, curl will never reach the redirect page.

    curl -L -o newName.zip https://www.dropbox.com/sh/[folderLink]?dl=1
    

提交回复
热议问题