Skip to content

Instantly share code, notes, and snippets.

@stg7
Created March 28, 2017 22:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stg7/e8e129959912cb4451cce72b2784fbd6 to your computer and use it in GitHub Desktop.
Save stg7/e8e129959912cb4451cce72b2784fbd6 to your computer and use it in GitHub Desktop.
download dropbox folder if it is too large for a direct download
#!/bin/bash
# if someone send you a link to a dropbox shared folder and you don't want to install the dropbox client
# and it is not possible to download the whole folder via dropbox, than the following script could help you
# change DROPBOXURL to your link url
wget "DROPBOXURL" -O down.html
# where DROPBOX URL is something like: https://www.dropbox.com/sh/ID?dl=0
cat down.html \
| sed "s|href|\\nhref=|g" \
| grep "href=\":" \
| grep "https://www.dropbox.com" \
| sed "s|?dl=0.*|?dl=0|g" \
| sed "s|href=\": \"||g" > links.list
wget -i links.list --directory-prefix download
# all files will be stored in the directory `download`
@AminaLEM
Copy link

AminaLEM commented Aug 4, 2023

this didn't work for me

@stg7
Copy link
Author

stg7 commented Aug 4, 2023

yes, sorry, this is a piece of code 6 years old, and it will definitively not work anymore, it may be a good starting point for a new script. Unfortunately, I do not use dropbox anymore.

@AminaLEM
Copy link

AminaLEM commented Aug 4, 2023

OK, this works:
curl -L -o download.zip "DROPBOXURL"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment