Repository navigation
iclouddrive: add iCloud Photos support and SRP authentication - #9234
Conversation
|
Hi @Lyapsus, you asked me to look at this PR. I don't have any relationship with the Rclone project, are you looking for someone to test it? |
|
Good evening @JoshPaterson, sorry for delay! Yes, would be helpful to have a bit of testing if you have time.
If you have Shared Photo Library enabled, these would be also interesting:
|
|
Hi! I've been testing this for a few hours, and it works fantastic! All the features work well, but FUSE mounts are pretty sluggish. Excellent work :) |
|
Glad to hear, thank you for trying! Regarding FUSE: the web API sadly has no way to query photos by name, so full album enumeration is unavoidable on first access (I feel it too with my 75k library). After that, rclone's VFS dir cache should keep it fast for 5 minutes by default |
1eede77 to
ceee858
Compare
|
@ncw @stv0g @poolpOrg @lifenautjoe - you may want to look |
|
Hi @Lyapsus, Thanks! This is working great so far for me :) My observations:
|
|
@stv0g Thank you very much for looking into it. I think everything must be much snappier now and albums in folders are now accessible too |
|
@MatthewIsHere thank you again! You may want to try FUSE again - warm listings should be much faster now. Also recommended to use |
|
Yeah I notice a significant improvement. This is fantastic!! I've already used it to sync a half terabyte of photos and videos to an Immich photo server. The only issue I've had with it is using Rclone sync to download the entire photos main directory causes X number of duplicates of a photo/video stored in multiple albums. I'm not sure if that's solvable on Rclone's side, but I currently use a script to recursively hard link any photos with the same exact filename (I think it's unique right?) |
|
Hmm sounds like smart albums to me? Like one video can be in All photos, Videos and Favorites at the same time, for example |
|
Yes, it was partly smart albums, but I believe it also happens when a photo is in All Photos and another (non shared) album. |
|
That's how it works in original Photos app and web version of Photos I believe. I use Google Photos backend as a reference and I see them doing nothing with the same behavior so I'm a bit hesitant about adding some kind of config for alternative behavior and how it would look. Ideas? |
|
That's just fine. The only thing I could think of would be a folder that contained all images pulled from the database, so that you could sync that folder and then run a script to symlink all the other folders of images to the main synced directory. That's how I use All Photos now. I think the only exception for All Photos on iCloud is that Hidden is not included. |
|
@Lyapsus @MatthewIsHere I am planning to use this new backend together with git-annex which performs hash-based deduplication via symlinks for me. So its quite similar to your hardlink-based approach. Still its a bit sub optimal to fetch those photos multiple times :-/ |
a93691d to
04320da
Compare
|
Thanks, I tested again on the latest #9234 head. Built on Windows for Linux amd64, then tested on Unraid with: ./rclone config reconnect icloud: -vv Relevant log: 2026/03/28 10:28:30 DEBUG : rclone: Version "v1.74.0-DEV-pr9234-latest" starting with parameters ["./rclone" "config" "reconnect" "icloud:" "-vv"] 2026/03/28 10:28:38 DEBUG : icloud: config in: state="2fa_do", result="sms" Additional note: my Apple account does have a trusted phone number configured Let me know what you want me to test next. |
|
@Unbounded6106, a bit strange, what’s your git log --oneline -1 ? |
c4cff25 to
624bfd6
Compare
|
@clouedoc, could you try this one please? |
|
@Lyapsus : worked for me on macos 26.4 (25E246). |
|
@ncw, sorry for delay. One can never be sure enough but that’s that reviews are for, right? I’ll be happy to address anything you are not happy with |
Persist session state after initial SRP sign-in and restore it when validating the 2FA code, instead of calling SignIn() again. Eliminates a redundant SRP roundtrip (~5s) and an extra push notification on pre-26.4 accounts.
Eliminate dead struct fields, conversion layers, and duplicated code. Album uses direct Library pointer instead of PhotosService back-pointer. GetPhotos serves from in-memory cache when populated, skipping disk I/O.
CloudKit stores album names verbatim without Unicode normalization. Albums created from macOS (APFS/NSString) use NFD, while Linux terminals send NFC, causing lookup misses on accented names.
|
@Lyapsus It's working for me now! Thanks a lot. |
|
@clouedoc pleasure to me haha |
|
@ncw, seems to fix it: #9359 (comment) |
|
Honor to me |
|
Hi @Lyapsus, I've been watching this PR with baited breath and gleefully downloaded the latest merge (doc469c) to try it out. The setup proceeds as expected, my password and 2FA codes are accepted and the new config appears ready to use. However, trying a simple "rclone ls iphoto:" returns the following:
is this something with my iphoto account, or something with rclone? apologies if this is vague or not enough info, i'm fairly new to rclone. |
|
update: looking like something with my iphoto account, maybe?. I can do "rclone lsd iphoto:" and get two directories listed, the CNM-4799B27A... one and one named "Primary Sync". it looks like i can access photos from Primary Sync, but any attempt to interact with the other one results in the error above. any ideas what's going on here? Thanks again for the PR, it's very helpful. |
What is the purpose of this change?
Add read-only iCloud Photos support to the existing iclouddrive backend via
service = photosconfig option. Also includes auth improvements on top of #9209's SRP authentication.Photos features:
.MOVcompanions as first-class entries-editedsuffix) and RAW alternativeschanges/zone— warm listings near-instant from disk cacheChangeNotifysupport for FUSE mounts viachanges/zonepollingListRsupport for--fast-listand recursive operations--metadatasupport — width, height, added-time, favorite, hiddenAuth improvements over #9209:
/validateround-trip on warm startDisconnectsupport — clears auth state + disk cacheWas the change discussed in an issue or in the forum before?
Credits
Built on @coughlanio's Photos PoC (#8734) and @mikegillan's SRP auth (#9209).
Test plan
golangci-lint run— 0 issuesgo build/go vet/gofmt— clean-editedentries, JPEG + MOV edited downloadsKnown limitations
Checklist