Skip to content

Instantly share code, notes, and snippets.

@gotev
Created July 1, 2016 08:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotev/cc161df966d1cc3eb0c89af171e58eeb to your computer and use it in GitHub Desktop.
Save gotev/cc161df966d1cc3eb0c89af171e58eeb to your computer and use it in GitHub Desktop.
Dropbox direct link generator
@gotev
Copy link
Author

gotev commented Jul 1, 2016

When you create a share llink from dropbox, you get something like:

https://www.dropbox.com/s/7aaa1f1dro4nj9v/yourfile.txt?dl=0

but that's not convenient if you want a direct link to the file (to be used with wget or curl for example), so using the script like this:

./dropbox-direct-link.sh https://www.dropbox.com/s/7aaa1f1dro4nj9v/yourfile.txt?dl=0

you will get:

https://dl.dropboxusercontent.com/s/7aaa1f1dro4nj9v/yourfile.txt

which is a direct link to the file. You can safely use that with curl or wget.

Installation

Inside the current directory

curl -L https://goo.gl/0N1uei -o dropbox-direct-link.sh && sudo chmod +x dropbox-direct-link.sh

then you can use it like this:

./dropbox-direct-link.sh DROPBOX_SHARE_LINK

To uninstall it:

sudo rm -rf ./dropbox-direct-link.sh

Globally

sudo curl -L https://goo.gl/0N1uei -o /usr/local/bin/dropbox-direct-link && sudo chmod +x /usr/local/bin/dropbox-direct-link

then you can use it like this:

dropbox-direct-link DROPBOX_SHARE_LINK

To uninstall it:

sudo rm -rf /usr/local/bin/dropbox-direct-link

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