gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
1.97k stars 161 forks source link

Make the video download timeout configurable #382

Closed nymanjens closed 1 year ago

nymanjens commented 1 year ago

First of all: Thanks for this amazing project! It seems to have downloaded all my photos with a fraction of the effort it used to take me via Takeout and manual downloads.

When I run this on my collection via Docker, the photos download process seems to get stuck on a photo or video that is probably too large, and it doesn't continue to the album download it seems (I only have a photos folder). The error:

08-31 07:36:21 ERROR    
Process failed. 
Traceback (most recent call last):
  File "/root/.local/lib/python3.10/site-packages/gphotos_sync/Main.py", line 493, in main
    self.start(args)
  File "/root/.local/lib/python3.10/site-packages/gphotos_sync/Main.py", line 433, in start
    self.do_sync(args)
  File "/root/.local/lib/python3.10/site-packages/gphotos_sync/Main.py", line 401, in do_sync
    files_downloaded = self.google_photos_down.download_photo_media()
  File "/root/.local/lib/python3.10/site-packages/gphotos_sync/GooglePhotosDownload.py", line 178, in download_photo_media
    self.do_download_complete(futures_left)
  File "/root/.local/lib/python3.10/site-packages/gphotos_sync/GooglePhotosDownload.py", line 326, in do_download_complete
    e = future.exception(timeout=timeout)
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 496, in exception
    raise TimeoutError()
concurrent.futures._base.TimeoutError
08-31 07:36:21 WARNING  Done. 

It feels like it would be useful to make these two lines configurable so I can see if it helps to increase the timeout on these: https://github.com/gilesknap/gphotos-sync/blob/main/src/gphotos_sync/GooglePhotosDownload.py#L73-L74

Extra info:

gilesknap commented 1 year ago

Sorry for the slow response. I seem to have missed the notification for this.

I agree that these timeouts should be configurable. I'm probably going to make another release in Oct and will include this change.

In the meantime if you want to have a play, these instructions show how to install an editable version of the code, in which case you could change the lines you reference and try it directly: https://github.com/gilesknap/gphotos-sync/blob/main/CONTRIBUTING.rst

more than half an hour download at 140Mbs must be a big video!

nymanjens commented 1 year ago

Thanks!

FYI: I ended up switching from Docker to installing it directly (the gphotos-sync package in NixOS). With that change, this error went away and now it finishes very quickly and also created and populated the albums folder :-).

gilesknap commented 1 year ago

Well, I just learnt that there is a Nix Package for gphotos-sync. Thanks for the heads-up!

gilesknap commented 1 year ago

I've added configurable timeouts in f7e587d it will be in the next release (today hopefully)