boredazfcuk / docker-icloudpd

An Alpine Linux container for the iCloud Photos Downloader command line utility
1.57k stars 149 forks source link

massive download triggered post-upgrade #579

Closed BillKeenan closed 2 weeks ago

BillKeenan commented 2 weeks ago

Just upgraded my docker / unraid image with the new icloudpd, and get this in the logs

2024-06-12 11:34:59 INFO Downloading 64737 original photos and videos to /home/user/iCloud ...

It was seemingly up to date before, did it somehow lose track? how does it keep track?

boredazfcuk commented 2 weeks ago

Hi, this is one of either two things. The first would be a bug in the code, which related to the user variable not being read correctly from the icloudpd.conf file. It would only work if it was set as a variable. Once fixed, this would potentially have changed the username from nothing (so downloads likely going to /home//iCloud) to /home/user/iCloud. This wouldn't have mattered for people who had configured the download path, either, as the download location overrides the home folder path. It also didn't apply to any of my own containers, as they already had the user variable configured.

There was also another potential issue I noticed as I had a few hundred extra files download. It seemed that files were now being downloaded with capitalised file extensions... So IMG_0001.jpg was now being downloaded as IMG_0001.JPG. Fortunately, I have all my photostreams configured to keep the originals, so for the most part download HEICs. If someone has a photostream configured to be optimised, then their photos could all be stored in JPG format, which would have triggered far more additional download. I only saw it happening for .jpg and .mov files, but there may have been others.

It doesn't actually keep track of what has been downloaded and what hasn't. I just looks for the file on icloud.com, then checks to see if the file is in the destination directory already. If not, it downloads the file. The change of user, will have changed the file path inside the destination directory.

It would be possible to just move all the photos from the original directory to the new location and it should pick them all up again.