Comments (10)
Found a workaround:
(I'm using this commit because dropbox API changed)
This error seems to occur when there is an empty new folder created recently on the directory. I made an try except to simply skip the function if this error occurs:
`
def restore_file(client, path, cutoff_datetime, is_deleted, verbose=False):
try:
revisions = client.files_list_revisions(path.encode('utf8'))
except:
print('custom skip on: ', path.encode('utf8'))
return
`
also, there is another error from similar origins when get the revision_dict keys: max() don't work if it is empty. so I also changed this line:
if max(revision_dict.keys()) < cutoff_datetime:
for this:
if len(revision_dict.keys()) > 0 and max(revision_dict.keys()) < cutoff_datetime:
This worked (almost) perfectly to restore an Unity 3D project folder that was corrupted.
Hope it helps.
*Sorry for bad english...
from dropbox-restore.
Same error here
from dropbox-restore.
This helped me as well - do you want to create a Pull Request or do you want me to?
from dropbox-restore.
but it's true, this is a diff for the other (working for me too) version of restore.py.
from dropbox-restore.
Pardon my less knowledge about python. I am not sure exactly where to insert the code given by Lightclawjl. I tried inserting the code but its gave me some error message about the "except" part. Dont remember the exact error. Can anybody repost the code here merging the additional codes provided by Lightclawjl . And thanks a lot Lightclawjl for posting the resolution.
from dropbox-restore.
I tried the workaround of Lightclawjl, but it skipped many directories which were not empty, and their files are actually in the cache directory. Is there another way to correct the code?
For A3003: You should change the revisions = client.files_... line for the 4 lines of Lightclawjl, but be aware that indenting is important in python, to try and except has to be indented as revisions = client.files_... was, the 2 other lines 4 spaces more to the right.
from dropbox-restore.
Hi,
Thanks for original author and all others for work to keep this up-to-date.
I encountered both the DropBox API problem and this error so updated the script.
I don't have time to pull request right now (and haven't tested it on other platforms, etc which the original author seems to require) so here's a quick Gist of it:
https://gist.github.com/Arakade/50f47ab38d8ab0c3bb2ebf29d2795119
My attempt to restore a Unity Project got stuck in Temp so I added ability to disable recursion. I've not yet added as a command-line option so disable by hacking line 119: change "do_recurse=False" to "do_recurse=True".
HTH for future horrified individuals that find themselves here!
from dropbox-restore.
Hey Arakade,
i tried the script that you provided. i tried that by creating a test folder on dropbox and putting some files in that folder and then deleting them afterwards. Now when i try to restore the files its "Skips" the files. For example i added the files on 6th Dec. deleted them on 9th Dec. now when i run the command with date set to 8th Dec it skips the files where as it should recover the files as the files were there in the folder on 8th. Please help.
from dropbox-restore.
+1 to @A3003's comment, any thoughts @Arakade?
from dropbox-restore.
nvm @A3003 comment out the else clause on line 74 which states that if the files were created before the cut off date don't bother.
from dropbox-restore.
Related Issues (20)
- Accidentally unlinked HistoryRestore application HOT 2
- Error on first run HOT 1
- App not putting me through the OAuth 2 authorization flow again HOT 2
- Files outside the retention window are deleted locally HOT 3
- Dropbox refuses more API calls HOT 1
- when going to the authorization screen I get the following error: HOT 1
- Invalid future date check HOT 1
- the app can't accept more users HOT 1
- ImportError: No module named dropbox HOT 2
- 'can't accept more users' error HOT 1
- App in development mode HOT 4
- Internal Server Error (500 & 503) HOT 3
- Can't restore folders with extended characters (éàöè...) HOT 3
- New Dropbox API HOT 3
- Performance improvement for cherry-picking HOT 2
- Restoring folders doesn't preserve case HOT 1
- Restore files in Root Folder HOT 1
- Restoration ran well but I cannot find my restored files & folders HOT 1
- 'module' object has no attribute 'client' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropbox-restore.