Open aengeringh opened 1 year ago
I have the same issue. Only 209 albums returned. There must be some pagination functionality in the API. I'm happy to help implement but cannot find documentation of the Photos API anywhere. Where is it ?
I fixed locally by changing the implementation of _fetch_folders to;
def _fetch_folders(self):
url = f"{self.service_endpoint}/records/query?{urlencode(self.params)}"
json_data = (
'{"query":{"recordType":"CPLAlbumByPositionLive"},'
'"zoneID":{"zoneName":"PrimarySync"}}'
)
request = self.session.post(
url, data=json_data, headers={"Content-type": "text/plain"}
)
response = request.json()
records = response["records"]
while 'continuationMarker' in response:
json_data = (
'{"query":{"recordType":"CPLAlbumByPositionLive"},'
'"zoneID":{"zoneName":"PrimarySync"},'
'"continuationMarker":"' + response['continuationMarker'] + '"}'
)
request = self.session.post(
url, data=json_data, headers={"Content-type": "text/plain"}
)
response = request.json()
records.extend(response["records"])
return records
@gordonaspin thanks! tested your code using PIP develop mode and it fixed the issue for me locally.
Great! Checkout my fork of icloud-photos-downloader. I added features to download photos by album name, include or exclude reserved album names (store to local filesystem organized by album name) and updated to use my fork of pyicloud vs pyicloud_ipd and update to python 3.10.6
I use it on Linux mint to download my entire photos library for backup purposes.
Only the first 209 albums listed using api.photos.albums
When using: for album in api.photos.albums
Only the first 209 albums are listed. When I delte 4 albums from iCloud, 4 additional albums I was missing earlier appear. The total of albums remains 209, while I do have more albums in my iCloud account.
Environment
Operating environment: Fedora 36
Traceback/Error logs
n/a
Additional information
n/a