Download Folder including Subfolder via wget from Dropbox link to Unix Server

后端 未结 4 1981
悲哀的现实
悲哀的现实 2021-02-05 10:10

I have a dropbox link like https://www.dropbox.com/sh/w4366ttcz6/AAB4kSz3adZ which opens the ususal dropbox site with folders and files. Is there any chance to download the com

4条回答
  •  再見小時候
    2021-02-05 11:03

    Currently, you're probably better off creating an app that you don't publish, which can either access all your files, or just a dedicated app folder (safer). Click the generate API token button about halfway down the app's settings page, and store it securely! You can then use the dedicated download or zip download API calls to get your files from anywhere like so:

    curl -X POST https://content.dropboxapi.com/2/files/download_zip \
        --header "Authorization: Bearer $MY_DROPBOX_API_TOKEN" \
        --header 'Dropbox-API-Arg: {"path": "/path/to/directory"}' \
        > useful-name.zip
    

    Adding your token as an environment variable makes it easier & safer to type/script these operations. If you're using BASH, and you have ignorespace in your $HISTCONTROL you can just type + paste your key with a leading space so it's not saved in your history. For frequent use, save it in a file with 0600 permissions that you can source, as you would an SSH key.

     export MY_DROPBOX_API_TOKEN='...'
    

提交回复
热议问题