1

I have dropbox link which is password protected. The format of the link is as follows:

www.dropbox.com/s/xyxyxyxy/

I have tried the following

wget --password "somepassword" 'www.dropbox.com/s/xyxyxyxy/' 

but i see some redirection happening and i don't see the file getting downloaded.

How do i download the contents of this folder using wget? How should i be specifying the password in wget?

1 Answer 1

0

The Dropbox shared link page takes the password interactively, not as Basic auth, so using the --password option won't work.

To download files from Dropbox shared links programmatically, you should use the Dropbox API instead. For this in particular, you would use the /2/sharing/get_shared_link_file endpoint:

https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file

Here's how you would use that with curl, for example:

curl -vX POST https://content.dropboxapi.com/2/sharing/get_shared_link_file \
    --header "Authorization: Bearer <ACCESS_TOKEN>" \
    --header "Dropbox-API-Arg: {\"url\": \"<SHARED_LINK>\",\"link_password\":\"<SHARED_LINK_PASSWORD>\"}"

Note: There's currently a known issue with this endpoint though, so it may incorrectly fail with a shared_link_access_denied error even if you supply the correct password. I'll update this answer when that's fixed.


Edit: The issue with calling /2/sharing/get_shared_link_file with a password is now fixed and should be working properly.

1
  • I was receiving shared_link_access_denied, then I realized that my app is marked as App folder permission. That means it can only access shared links of files that are inside the App folder. I moved the files to app folder, created the link and the password and it is working fine.
    – Edgar
    Commented Jun 12, 2019 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.