Created
July 1, 2016 08:39
-
-
Save gotev/cc161df966d1cc3eb0c89af171e58eeb to your computer and use it in GitHub Desktop.
Dropbox direct link generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOWNLOAD_STRING="$1" | |
OUT="${DOWNLOAD_STRING/www.dropbox.com/dl.dropboxusercontent.com}" | |
OUT="${OUT/?dl=0/}" | |
echo $OUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you create a share llink from dropbox, you get something like:
but that's not convenient if you want a direct link to the file (to be used with
wget
orcurl
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:
which is a direct link to the file. You can safely use that with
curl
orwget
.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:
To uninstall it:
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:
To uninstall it: