You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

dlevy's avatar
dlevy
New member | Level 1
14 days ago

Slow response using Dropbox for Python

Hello,

My python code has been working well for months. Within the past 48 hours, the files_download command in the snippet below (with tokens obfuscated) has started to take about 45 seconds while previously it was instantaneous. It is the last line that is the culprit. 

import dropbox

DROPBOX_APP_KEY = "?????"
DROPBOX_APP_SECRET = "?????"
DROPBOX_REFRESH_TOKEN = "????"

dbx = dropbox.Dropbox(app_key=DROPBOX_APP_KEY,
                             app_secret=DROPBOX_APP_SECRET,
                             oauth2_refresh_token=DROPBOX_REFRESH_TOKEN)

metadata, f = dbx.files_download('/alerts.csv')

Any suggestions?

With thanks,

David

  • DB-Des's avatar
    DB-Des
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi dlevy

    Download speeds can be influenced by a variety of factors, including network conditions, server load, or local configurations.

    Sometimes resetting or retrying your connection gets you a different route and better speeds, but that is outside of our control.

    • dlevy's avatar
      dlevy
      New member | Level 1

      Thanks. The download is instantaneous when I use Windows Explorer, for example. It is only with the Python wrapper over the Dropbox app that I have issues. I've tried this on different computers, networks, etc. with the same result. 

  • DB-Des's avatar
    DB-Des
    Icon for Dropbox Engineer rankDropbox Engineer

    dlevy

    Large files, file corruption or mismanagement of file chunks could also contribute to the change in download speeds.

    It’s important to note that the Dropbox website and application may use different mechanisms and infrastructure for various pieces of functionality compared to the API. As such, comparing behavior and results between these platforms may result in inconsistencies.

    • dlevy's avatar
      dlevy
      New member | Level 1

      Thanks for letting me know about the different mechanisms. The file is tiny, just 258 bytes of text. 

      • DB-Des's avatar
        DB-Des
        Icon for Dropbox Engineer rankDropbox Engineer

        dlevy 

        I’ve been unable to replicate the issue reported on my end, but below are a few troubleshooting steps that may help identify the cause:

        • Check if any proxies, firewalls, VPNs, or similar network configurations are in use on the affected computers. These can sometimes interfere with the connection.
        • Investigate whether you can get more visibility into the issue. For example, is there an option to enable more verbose logging or detailed output in your setup? Alternatively, you could try reproducing the issue using a tool like curl to observe the raw request and response.