bernd-wechner / Degoo

CLI tool(s) for working with Degoo cloud storage
Other
143 stars 41 forks source link

No download URL #34

Open miikka75 opened 3 years ago

miikka75 commented 3 years ago

I am using Cryptomator to encrypt my files before uploading to Degoo service. Upload using degoo_put works (after making a small change in code):

index 8043121..c27976a 100644
--- a/degoo/util.py
+++ b/degoo/util.py
@@ -1162,7 +1162,7 @@ def put_directory(local_directory, remote_folder, verbose=0, if_changed=False, d
             relative_root = root

         for name in dirs:
-            Name = os.path.join(root, name)
+            Name = os.path.join(relative_root, name)

             IDs[Name] = mkdir(name, IDs[relative_root], verbose - 1, dry_run)

python degoo_put /mnt/kuvat /Web

After successfull upload I try to download the same directory to another folder:

python degoo_get /Web/kuvat /mnt/kuvat2

Some of the files are downloaded correctly while some of them output error: <file> apparently has no URL to download from.

Has anyone faced such problems in the past? Any help how to debug the issue is appreciated. Zip package of files I have used (to try to reproduce the problem) can be downloaded from here

bernd-wechner commented 3 years ago

Firs thing I do with debugging such a thing is check whether it's doable using Degoo's web app. That sets the standard for me.

If it can't then I'm looking at a Degoo feature/bug/limitation and if worth my while I contact Degoo support. I have found such things and they have responded and fixed them.

If it can, then I watch the download in the browsers Network transaction watcher (usually press F12 in browser, click Network, clear the data and then click Download) I log the whole transaction and then in a text editor format it nicely (I use Atom and it has a lot of beautifiers, usually a JSON beautifier lays it out nicely). That's basically how degoo_get was written ... and so I'm looking for any idiosyncrasies overlooked in the original reverse engineering.

The patch you supplied is puzzling. As it seems to do nothing. Replaces root with relative_root in the join but above relative_root = root - there may be missing context of course (perhaps root changes in the loop).

miikka75 commented 3 years ago

Patch does something when target_junk contains a string. In this case it contains /mnt and in the first iteration the loop incorrectly adds ID of root (full path with /mnt). Next iteration tries to read ID of relative_root (without /mnt), which doesn't exist in the dict.

I tried downloading the files with web browser and it fails, so perhaps it's a problem at Degoo's end or something went wrong while uploading. Details of the file in web UI shows file size correctly though. Strange thing is that even if I delete the files from Degoo and re-upload them, the same files are missing.

PBehr commented 2 years ago

I had the same issue and was able to trace it back to the wrong "checksum" being created. The checksum must not contain + or /. However, I then noticed that if you use Python 3.9 as described in the readme, the checksum is apparently adjusted by the request lib? So in case you didn't read correctly either try Python 3.9

PBehr commented 2 years ago

ok i have to correct myself. unfortunately the error remains with python 3.9 and i have to correct the checksum manually. Then it works:
Checksum = Checksum.replace("/","_") Checksum = Checksum.replace("+","-")

I am pretty sure the issues was gone on my first python3.9 setup but now it is there again on another machine.. maybe I should double check

PBehr commented 2 years ago

@bernd-wechner could you maybe have another look at this issues?