icloud-photos-downloader / icloud_photos_downloader

A command-line tool to download photos from iCloud
MIT License
7.11k stars 564 forks source link

How to detect a file exists in destination? #670

Closed tangyue1 closed 1 year ago

tangyue1 commented 1 year ago

Summary

I am downloading from multiple icloud accounts to the same destination folder. Will the downloader download and rename if a file with the same name exists in destination but is a different photo?

Context

AndreyNikiforov commented 1 year ago

de-duplication uses file name and size, not account. as long as files with the same name from multiple accounts come with different sizes, you'll have both downloaded

hartzde commented 1 year ago

Andrey, Any thoughts of using file hash comparison for dedup check?

AndreyNikiforov commented 1 year ago

Andrey, Any thoughts of using file hash comparison for dedup check?

Good idea and for general file comparison is proven to be helpful, e.g. git uses hash. I don't know what value can hashing bring for image/video deduping, e.g. what is the chance that two different videos are exactly the same size, same name, and shot on the same date (assuming that person is downloading using folder structure with date)?

Of course deduping fails miserably when EXIF data is modified during downloading, either using hash or name-size pair.