pyicloud
pyicloud copied to clipboard
Data loss in Photos Service about duplicated RecordName
- pyiCloud release with the issue (
pip show pyicloud
): 1.0.0 - Last working pyiCloud release (if known):
- Service causing this issue: photos
- Python version (
python -V
): 3.10.11 - Operating environment (project deps/Docker/Windows/etc.): Windows
I find a case of data loss when I fetch my icloud photos.
There are 77864 items in All Photos Album. (len(api.photos.albums[album])
= 77864)
for photo in api.photos.albums[album]:
print(photo.id, photo.filename)
list.append({'id': photo.id, 'filename': photo.filename, 'added_date':photo.added_date.strftime("%Y-%m-%d %H:%M:%S") , 'master': photo._master_record, 'asset': photo._asset_record})
with open(filename, 'w') as f:
json.dump(list, f, indent=4)
There are only 77863 items in the saved json file.
more than 700 items have duplicated RecordName but only 1 items is lost. I run the code serveral times and lose the same item. No file is added to the icloud photo when I run the code.
The website of icloud.com.cn shows two items of this RecordName, so this is a issue of pyicloud or my code. but I don't find where is wrong.