rclone / rclone

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Home Page:https://rclone.org

Repository from Github https://github.comrclone/rcloneRepository from Github https://github.comrclone/rclone

Add iCloud GCBD (China Mainland) Option in iCloud Drive backend

BingoKingo opened this issue · comments

          > Hi, I got these when using a Apple ID (cn) 

NOTICE: Fatal error: HTTP error 302 (302 Found) returned body: "{\"domainToUse\":\"iCloud.com.cn\"}"

CRITICAL: Failed to create file system for "iCloud:": missing icloud trust token: try refreshing it with "rclone config reconnect iCloud:"

Any progress?

china right? not supported right now (china uses a different server)

could you create an issue for this? will add it soon

Originally posted by @lostb1t in #7717 (comment)

Same problem when using the v1.69.1 version, try to update the url by adding ".cn" in each url in the file with "https://github.com/rclone/rclone/blob/master/backend/iclouddrive/api/client.go",
'''
const (
baseEndpoint = "https://www.icloud.com"
homeEndpoint = "https://www.icloud.com"
setupEndpoint = "https://setup.icloud.com/setup/ws/1"
authEndpoint = "https://idmsa.apple.com/appleauth/auth"
)
''',
However, the go build command didn't go well, as it needs to download massive package from internet, and my connection is unstable. Can someone could fix it. Thank you very much

@wcumsjy I updated all the urls to .cn ones. I don't know if it will work - please report back!

v1.70.0-beta.8597.7f715befb.fix-8257-iclouddrive-cn on branch fix-8257-iclouddrive-cn (uploaded in 15-30 mins)

@ncw Dear Nick, thank you very much for your timely feedback and for quickly compiling the new version. However, I regret to inform you that my computer has an x86 architecture and cannot execute the arm64 version. I was wondering if you have an x86 version available? If so, I can try testing it immediately.
“rclone v1.69.1

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.8.0-53-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.24.0
  • go/linking: static
  • go/tags: none

@ncw Dear Nick, I confirmed that I can connect and mount the iCloud to my Unbuntu through this version with my China iCloud account! BIG THANKS TO YOU!!!

"~$ rclone version
rclone v1.70.0-beta.8597.7f715befb.fix-8257-iclouddrive-cn

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.8.0-53-generic (x86_64)
  • os/type: linux
  • os/arch: 386
  • go/version: go1.24.0
  • go/linking: static
  • go/tags: none
    "

failed with 1 errors and: corrupted on transfer: sizes differ src() 10679453 vs dst(Local file system at /Users/admin/Downloads) 10501687
rclone was able to list the file but got the wrong file size.

We probably need @lostb1t to do this properly, but I thought it would be interesting to do an experiment to see if changing the URLs was enough or not.

@BingoKingo what kind of file was that? Do any fillers transfer ok?

rclone works fine with most files. This issue can be closed.

It's a new problem with iWork files generated or modified by iWork Web and it can be reproduced on iCloud backend. Just create any file through iWork Web, and then download it using rclone.

@BingoKingo

rclone works fine with most files. This issue can be closed.

Is that with the patched rclone with the .cn domain names I linked above?

It's a new problem with iWork files generated or modified by iWork Web and it can be reproduced on iCloud backend. Just create any file through iWork Web, and then download it using rclone.

Yes, .cn domain patch works well.

Great. I'll re-open this as we need to merge the fix (and likely do it a bit better!)

commented

failed with 1 errors and: corrupted on transfer: sizes differ src() 10679453 vs dst(Local file system at /Users/admin/Downloads) 10501687 rclone was able to list the file but got the wrong file size.

rclone ls is working well, no error for me

commented

Great. I'll re-open this as we need to merge the fix (and likely do it a bit better!)

Maybe simply add a CN option in config?

If everyone is busy, maybe I can try to write a PR