Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: <AssetVersionSize.ORIGINAL: 'original'> if download with --size adjusted --size alternative #926

Open
xbd-gh opened this issue Aug 2, 2024 · 3 comments
Assignees
Labels

Comments

@xbd-gh
Copy link

xbd-gh commented Aug 2, 2024

Overview
KeyError: <AssetVersionSize.ORIGINAL: 'original'> if download with --size adjusted --size alternative (not use --force-size)
threr was only one photo in my icloud with not edited, when i download with --size adjusted --size alternative (not use --force-size),
after got one photo ,then i got the info: KeyError: <AssetVersionSize.ORIGINAL: 'original'>
then i edit the photo ,run icloudpd again .after got one edited photo ,i got the same error message.

Steps to Reproduce

  1. there is only one photo in cloud (not edited)
  2. icloudpd --directory .\photos --domain cn --username xx --password xx --folder-structure none --size adjusted --size alternative --file-match-policy name-id7
  3. edit the photo
  4. icloudpd --directory .\photos --domain cn --username xx --password xx --folder-structure none --size adjusted --size alternative --file-match-policy name-id7

Expected Behavior
no error info

Actual Behavior
exit with error

Context
after debug,I found the return of disambiguate_filenames only include adjusted ,when download_size=alternative,download_size will be changed to original , but no original in the return of disambiguate_filenames
ver

@xbd-gh xbd-gh added the bug label Aug 2, 2024
@AndreyNikiforov AndreyNikiforov self-assigned this Aug 4, 2024
@AndreyNikiforov
Copy link
Collaborator

Thanks for digging into to the issue. I need to revisit of cases for disambiguate_filenames and test combinations. I suspect I missed something.

@AndreyNikiforov
Copy link
Collaborator

Can you post actual exception pls? I need to understand where KeyError is being thrown.

@xbd-gh
Copy link
Author

xbd-gh commented Aug 23, 2024

0
1
2
I can read english well ,but bad in writing.so maybe you can not understand what i write ,^_^
versions = disambiguate_filenames(photo.versions, size)

the versions not include original , but in the loop (for download_size in size:), download_size = AssetVersionSize.ORIGINAL was exec ,so version = versions[download_size] throw a error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants