MDKPredator/degoo_drive

Use adaptive read sizes towards Degoo API

c3c opened this issue · 2 comments

c3c commented

Hi :)
Thanks for creating this.
Is there a way to make the requests to the Degoo API use larger read sizes - or make it more adaptive according to the available throughput? Each time, it makes requests of exactly 262144 bytes, adding a lot of overhead for the individual requests (and actually making the transfer slow).
This is for non-media files.

unique: 94, opcode: READ (15), nodeid: 17013236854, insize: 80, pid: 17
2022-02-08 21:03:38.790 MainThread: [__main__] Hello 6029312 262144
2022-02-08 21:03:38.791 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): c.degoo.media:443
2022-02-08 21:03:40.375 MainThread: [urllib3.connectionpool] https://c.degoo.media:443 "GET /degoo-production-large-file-us-east1.degoo.me/a/b/sh/xxxx&use-cf-cache=true HTTP/1.1" 206 262144
   unique: 94, success, outsize: 262160
unique: 96, opcode: READ (15), nodeid: 17013236854, insize: 80, pid: 17
2022-02-08 21:03:40.384 MainThread: [__main__] Hello 6291456 262144
2022-02-08 21:03:40.386 MainThread: [urllib3.connectionpool] Starting new HTTPS connection (1): c.degoo.media:443
2022-02-08 21:03:40.840 MainThread: [urllib3.connectionpool] https://c.degoo.media:443 "GET /degoo-production-large-file-us-east1.degoo.me/a/b/sh/xxxx&use-cf-cache=true HTTP/1.1" 206 262144

The read size is according to what the OS requests, as if you have the file locally. It is true that for large files it can be a bit tedious.

I will figure out how to do this efficiently to download the file in background while it can be read, as it is done with media files.

Thanks for your feedback.

Hi @c3c

I have pushed an update, now the cache size is for all file types.