pythonselenium-webdriverdropboxdropbox-api

How to retrieve all files from dropbox version history?


I have a script that uploads data to Dropbox every hour. Unfortunately, I made a mistake and the script has been overwriting the existing file with each new upload. Consequently, I only have one data file in my Dropbox, which is continuously replaced with a new version.

Fortunately, I've discovered that Dropbox maintains a version history for all changes to this file. As the script has been uploading new data every hour, there have been 24 new entries per day, accumulating to thousands over the past six months.

I'm looking for a more efficient solution to retrieve these past versions. Is there a way to download all these versions using a script or some online tool, instead of manually downloading each one from the Dropbox interface?

I try to use python with selenium but because I am using college account so it need duo Two-Factor Authentication when login which is tricky.

I think dropbox API may be helpful but I didn't find any useful information in its documents.


Solution

  • As Nick mentioned in the comments, the Dropbox API does offer the ability to list file revisions using /2/files/list_revisions, however that only supports listing up to 100 revisions unfortunately. I'll pass this along as a feature request for support for listing any number of revisions, but I can't promise if or when that might be implemented.

    For reference, to download the file content for a particular revision, you would use /2/files/download and pass the rev: value in the path parameter.

    By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints.