BLOG

The Retoucher's Guide to Bulk Downloading Specific Files from Dropbox


You know the drill. A client sends a link to a massive Dropbox folder with thousands of RAW files. You only need to download a specific list of brackets and selects, but the Dropbox interface forces you to either download everything or clickety-click-click your way into a coma. It’s a tedious, time-wasting workflow that gets in the way of the real work.


There’s a better way. By creating a simple "app" in Dropbox and using a small Python script, you can create a powerful tool that reads a plain text list of files and downloads them for you automatically. No more manual clicking.


This guide will walk you through the entire process on macOS, from initial setup to running the script.



Part 1: The Setup – Creating Your Dropbox "App"


First, we need a way for our script to securely connect to your Dropbox account. We do this by creating a private "app" in Dropbox's developer console. This app will generate a unique "Access Token"—think of it as a secret password that only your script can use, granting it permission to perform specific actions.


  1. Navigate to the App Console. Go to the Dropbox App Console.


  1. Create a New App. Click the blue Create app button.


  1. Configure the App. Set the options as follows:


  • Choose an API: Select Scoped access.


  • Choose the type of access: Select Full Dropbox. This is crucial if your files are in regular folders (e.g., /Client Work/Project X/).


  • Name your app: Give it a memorable name, like Downloadr 5000 S Pro Max. Click Create App.


  1. Set Permissions (The Most Important Step). You are now on the app's settings page. Click on the Permissions tab. You must give the app permission to do things. Check the boxes for:


  • files.metadata.read (Lets the script see file information)


  • files.content.read (Lets the script actually download files)


Click Submit at the bottom to save these changes. If you get permission errors later, it's almost always because of this step.


  1. Generate Your Access Token. Go back to the Settings tab. Scroll down to the "Generate access token" section and click Generate. A long string of characters will appear (starting with sl.). This is your secret key. Copy this token and keep it handy. Do not share it publicly.



Part 2: The Code & The File List


Next, we'll set up the script and the list of files it needs to download.


  1. Create a Project Folder. On your Mac (e.g., on your Desktop), create a new folder to hold your files. You can name it whatever you want, I'll go with ProjectAcorn because it sounds cool.


  2. Create the Python Script. Open a plain text editor (like TextEdit or VS Code). Copy and paste the complete code block below into it. Save this file as dropbox_downloader.py inside our ProjectAcorn folder.

import dropbox
import os

# --- Configuration ---
DROPBOX_ACCESS_TOKEN = "PASTE_YOUR_ACCESS_TOKEN_HERE"
FILE_LIST_PATH = "files_to_download.txt"
DOWNLOAD_LOCATION = "path/to/your/download/folder"
# ---------------------

def download_files_from_list(access_token, file_list_path, download_location):
    """
    Downloads files from a list in a Dropbox folder.
    """
    dbx = dropbox.Dropbox(access_token)

    try:
        with open(file_list_path, 'r') as f:
            files_to_download = [line.strip() for line in f.readlines()]
    except FileNotFoundError:
        print(f"Error: The file list '{file_list_path}' was not found.")
        return

    if not os.path.exists(download_location):
        os.makedirs(download_location)

    for file_path in files_to_download:
        try:
            # You need to specify the full path for both Dropbox and local destination
            local_path = os.path.join(download_location, os.path.basename(file_path))
            print(f"Downloading {file_path} to {local_path}...")
            dbx.files_download_to_file(local_path, file_path)
            print(f"Successfully downloaded {file_path}")
        except dropbox.exceptions.ApiError as err:
            print(f"*** API error: {err}")
        except Exception as e:
            print(f"*** An unexpected error occurred: {e}")

if __name__ == "__main__":
    download_files_from_list(DROPBOX_ACCESS_TOKEN, FILE_LIST_PATH, DOWNLOAD_LOCATION)
  1. Edit the Script's Configuration.


  • Replace "PASTE_YOUR_ACCESS_TOKEN_HERE" with the actual token you copied from the App Console.


  • Replace "path/to/your/download/folder" with the actual folder path on your Mac where you want the files saved (e.g., /Users/yourusername/Downloads/ProjectX_Selects).


  1. Create the File List. In the same ProjectAcorn folder, create another plain text file named files_to_download.txt. This is your list.


  • CRITICAL: This file must contain the full, complete pathname for each file, starting with a /. Do not include any headers, extra text, or blank lines.


Correct Format:

/Kevin/United/RAW/r_0000/EL9A0513.cr3

/Kevin/United/RAW/r_0000/EL9A0576.cr3

/Client Work/Project ABC/Finals/IMG_9876.tif


Part 3: Running the Script


Now for the magic.


  1. Open the Terminal. You can find it in Applications/Utilities or by searching with Spotlight.


  2. Navigate to your project folder. Type cd (with a space) into the terminal. Then, we drag the ProjectAcorn folder from Finder directly onto the terminal window. It will auto-fill the path: cd /Users/pathto/Desktop/ProjectAcorn Press Enter.


  3. Run the script. Type the following command and press Enter:


python3 dropbox_downloader.py


The script will now read your list, connect to Dropbox, and download each file into the location you specified. If it works, you'll see success messages.