You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run "sudo icloudpd -u "[email protected]" -p "your-password" -d '/your/download/path' --delete-after-download"
I have previously authenticated.
The output is this:
[sudo] password for server:
2024-12-27 12:19:08 DEBUG Authenticating...
2024-12-27 12:19:11 DEBUG Looking up all photos and videos from album All Photos...
2024-12-27 12:19:12 INFO Downloading 24740 original photos and videos to /your/download/path ...
2024-12-27 12:19:15 DEBUG Downloading /your/download/path/2024/10/20/IMG_0247.HEIC...
2024-12-27 12:19:16 INFO Downloaded /your/download/path/2024/10/20/IMG_0247.HEIC
2024-12-27 12:19:16 DEBUG Deleting IMG_0247.HEIC in iCloud...
2024-12-27 12:19:16 DEBUG POST https://icloud-database-url {"atomic": true, "desiredKeys": ["isDeleted"], "operations": [{"operationType": "update", "record": {"fields": {"isDeleted": {"value": 1}}, "recordChangeTag": "2qj5", "recordName": "record-unique-id", "recordType": "CPLAsset"}}], "zoneID": {"zoneName": "PrimarySync", "ownerRecordName": "owner-unique-id", "zoneType": "REGULAR_CUSTOM_ZONE"}}
2024-12-27 12:19:17 DEBUG {'Server': 'AppleHttpServer', 'Date': 'Fri, 27 Dec 2024 04:19:17 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Responding-Instance': 'instance-details', 'Set-Cookie': 'X-APPLE-WEBAUTH-TOKEN=...;Secure;HttpOnly', 'Access-Control-Allow-Origin': 'https://www.icloud.com', 'Access-Control-Allow-Credentials': 'true', 'Timing-Allow-Origin': 'https://www.icloud.com', 'X-Apple-CloudKit-Version': '1.0', 'Content-Encoding': 'gzip', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains;', 'x-apple-user-partition': '175', 'via': 'cloud-details', 'X-Apple-Request-UUID': 'request-uuid', 'access-control-expose-headers': 'X-Apple-Request-UUID,X-Responding-Instance,Via', 'X-Apple-Edge-Response-Time': '496'}
2024-12-27 12:19:17 DEBUG {'records': [{'recordName': 'record-unique-id', 'recordType': 'CPLAsset', 'fields': {'isDeleted': {'value': 1, 'type': 'INT64'}}, 'pluginFields': {}, 'recordChangeTag': '2zqp', 'created': {'timestamp': 1733362900758, 'userRecordName': 'user-unique-id', 'deviceID': 'device-id'}, 'modified': {'timestamp': 1735273156947, 'userRecordName': 'user-unique-id', 'deviceID': 'device-id'}, 'deleted': False, 'expirationTime': 1738729156}], 'syncToken': 'sync-token'}
2024-12-27 12:19:17 INFO Deleted IMG_0247.HEIC in iCloud
2024-12-27 12:19:17 DEBUG Downloading /your/download/path/2024/10/20/IMG_0246.HEIC...
0%| | 1/24740 [00:05<34:30:53, 5.02s/it]
I then hit CTRL+C (since the error above showed up) and get this:
Aborted!
Traceback (most recent call last):
File "/usr/local/bin/icloudpd", line 5, in
from icloudpd import main
File "/usr/local/lib/python3.10/dist-packages/icloudpd/main.py", line 5, in
sys.exit(subprocess.call([os.path.join(os.path.dirname(file), "icloudpd"), *sys.argv[1:]]))
File "/usr/lib/python3.10/subprocess.py", line 347, in call
return p.wait(timeout=timeout)
File "/usr/lib/python3.10/subprocess.py", line 1209, in wait
return self._wait(timeout=timeout)
File "/usr/lib/python3.10/subprocess.py", line 1959, in _wait
(pid, sts) = self._try_wait(0)
File "/usr/lib/python3.10/subprocess.py", line 1917, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
Just realised - is it possible the debugging request on my output isn't working because I ran it through chatGPT to remove identifying information?
The strange part for me was that your log shows 2024-12-27 12:19:16 DEBUG POST... - that should not be displayed unless extra logging is enabled. I tested latest version and it indeed shows log for deleting request - something to clean up.
I tried to reproduce your issue on my test account and image was successfully deleted in iCloud after downloading - icloudpd behaved as expected on my account.
Overview
I've run "sudo icloudpd -u "[email protected]" -p "your-password" -d '/your/download/path' --delete-after-download"
I have previously authenticated.
The output is this:
[sudo] password for server:
2024-12-27 12:19:08 DEBUG Authenticating...
2024-12-27 12:19:11 DEBUG Looking up all photos and videos from album All Photos...
2024-12-27 12:19:12 INFO Downloading 24740 original photos and videos to /your/download/path ...
2024-12-27 12:19:15 DEBUG Downloading /your/download/path/2024/10/20/IMG_0247.HEIC...
2024-12-27 12:19:16 INFO Downloaded /your/download/path/2024/10/20/IMG_0247.HEIC
2024-12-27 12:19:16 DEBUG Deleting IMG_0247.HEIC in iCloud...
2024-12-27 12:19:16 DEBUG POST https://icloud-database-url {"atomic": true, "desiredKeys": ["isDeleted"], "operations": [{"operationType": "update", "record": {"fields": {"isDeleted": {"value": 1}}, "recordChangeTag": "2qj5", "recordName": "record-unique-id", "recordType": "CPLAsset"}}], "zoneID": {"zoneName": "PrimarySync", "ownerRecordName": "owner-unique-id", "zoneType": "REGULAR_CUSTOM_ZONE"}}
2024-12-27 12:19:17 DEBUG {'Server': 'AppleHttpServer', 'Date': 'Fri, 27 Dec 2024 04:19:17 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Responding-Instance': 'instance-details', 'Set-Cookie': 'X-APPLE-WEBAUTH-TOKEN=...;Secure;HttpOnly', 'Access-Control-Allow-Origin': 'https://www.icloud.com', 'Access-Control-Allow-Credentials': 'true', 'Timing-Allow-Origin': 'https://www.icloud.com', 'X-Apple-CloudKit-Version': '1.0', 'Content-Encoding': 'gzip', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains;', 'x-apple-user-partition': '175', 'via': 'cloud-details', 'X-Apple-Request-UUID': 'request-uuid', 'access-control-expose-headers': 'X-Apple-Request-UUID,X-Responding-Instance,Via', 'X-Apple-Edge-Response-Time': '496'}
2024-12-27 12:19:17 DEBUG {'records': [{'recordName': 'record-unique-id', 'recordType': 'CPLAsset', 'fields': {'isDeleted': {'value': 1, 'type': 'INT64'}}, 'pluginFields': {}, 'recordChangeTag': '2zqp', 'created': {'timestamp': 1733362900758, 'userRecordName': 'user-unique-id', 'deviceID': 'device-id'}, 'modified': {'timestamp': 1735273156947, 'userRecordName': 'user-unique-id', 'deviceID': 'device-id'}, 'deleted': False, 'expirationTime': 1738729156}], 'syncToken': 'sync-token'}
2024-12-27 12:19:17 INFO Deleted IMG_0247.HEIC in iCloud
2024-12-27 12:19:17 DEBUG Downloading /your/download/path/2024/10/20/IMG_0246.HEIC...
0%| | 1/24740 [00:05<34:30:53, 5.02s/it]
I then hit CTRL+C (since the error above showed up) and get this:
Aborted!
Traceback (most recent call last):
File "/usr/local/bin/icloudpd", line 5, in
from icloudpd import main
File "/usr/local/lib/python3.10/dist-packages/icloudpd/main.py", line 5, in
sys.exit(subprocess.call([os.path.join(os.path.dirname(file), "icloudpd"), *sys.argv[1:]]))
File "/usr/lib/python3.10/subprocess.py", line 347, in call
return p.wait(timeout=timeout)
File "/usr/lib/python3.10/subprocess.py", line 1209, in wait
return self._wait(timeout=timeout)
File "/usr/lib/python3.10/subprocess.py", line 1959, in _wait
(pid, sts) = self._try_wait(0)
File "/usr/lib/python3.10/subprocess.py", line 1917, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
Steps to Reproduce
Expected Behavior
It should download then delete the photos from iCloud.
Actual Behavior
The error above happens, photos don't get downloaded then deleted.
Context
It's a pain in the bum to manually delete photos from iCloud.
Also - just to be clear, I have tried this with iCloud in the normal (syncing) mode and in the "photos will be deleted in 30 days" mode.
No idea why this isn't working?
The text was updated successfully, but these errors were encountered: