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

IndexError: Replacement index 1 out of range for positional args tuple #937

Closed
pipe-organ opened this issue Aug 22, 2024 · 3 comments
Closed
Labels

Comments

@pipe-organ
Copy link

pipe-organ commented Aug 22, 2024

Password and 2FA works perfectly and I have iCloud Web access enabled .
But it fails with these error messages. Any idea what I am doing wrong here?
Thanks in advance!!

Launch

root@podman:~# podman run -it --rm --name icloudpd -v /mnt/photos/Photo_Incoming:/data -e TZ=America/Los_Angeles icloudpd/icloudpd:latest icloudpd --directory /data --username [email protected] --watch-with-interval 3600 --folder-structure {:%Y}/{:%Y-%m-%d}

Running latest

root@podman:~# podman pull icloudpd/icloudpd:latest                                                                                                  
Trying to pull docker.io/icloudpd/icloudpd:latest...
Getting image source signatures
Copying blob fa52739195da skipped: already exists  
Copying blob 9129e9240bcd skipped: already exists  
Copying blob f6abdc93b500 skipped: already exists  
Copying blob 0fffb38349d6 skipped: already exists  
Copying blob 4f4fb700ef54 skipped: already exists  
Copying blob 930bdd4d222e skipped: already exists  
Copying config 6c39b134f9 done  
Writing manifest to image destination

Error Message

2024-08-22 00:17:15 INFO     Great, you're all set up. The script can now be run without user interaction until 2FA expires.
You can set up email notifications for when the two-factor authentication expires.
(Use --help to view information about SMTP options.)
2024-08-22 00:17:17 DEBUG    Looking up all photos and videos from album All Photos...
2024-08-22 00:17:17 INFO     Downloading 1152 original photos and videos to /data ...                                                                
  0%|                                                                                                                       | 0/1152 [00:00<?, ?it/s]Traceback (most recent call last):
  File "starters/icloudpd_ex.py", line 122, in <module>
  File "starters/icloudpd_ex.py", line 118, in main
  File "click/core.py", line 1157, in __call__
  File "click/core.py", line 1078, in main
  File "click/core.py", line 1688, in invoke
  File "click/core.py", line 1434, in invoke
  File "click/core.py", line 783, in invoke
  File "icloudpd/base.py", line 738, in main
  File "icloudpd/base.py", line 1333, in core
  File "icloudpd/base.py", line 841, in download_photo_
IndexError: Replacement index 1 out of range for positional args tuple
[2] Failed to execute script 'icloudpd_ex' due to unhandled exception!
root@podman:~#           
@pipe-organ pipe-organ added the bug label Aug 22, 2024
@AndreyNikiforov
Copy link
Collaborator

I suspect that --folder-structure {:%Y}/{:%Y-%m-%d} is the issue. {} selects parameter and only one parameter is passed to formatting function, but your formatting string asks for two. You can use --folder-structure {:%Y/%Y-%m-%d} instead.

This is a way to test formatting in any online python interpreter:

import datetime 
print('{:%Y/%Y-%m-%d}'.format(datetime.datetime.now()))

prints:

2024/2024-08-22

@pipe-organ
Copy link
Author

Ah! I see. Thank you so much for taking a look Andrey!! I'll try again.

@pipe-organ
Copy link
Author

You corrections are working perfectly. Thanks again for the help!!!! I''ll close it now.

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