boredazfcuk / docker-icloudpd

An Alpine Linux container for the iCloud Photos Downloader command line utility
1.75k stars 165 forks source link

Temporary fix for auth #448

Closed w1zz4 closed 9 months ago

w1zz4 commented 9 months ago

Temporary fix for #442

This download a fixed icloudpd lib during docker image creation

elhigu commented 9 months ago

Got it working with this 👍

git clone https://github.com/w1zz4/docker-icloudpd.git
cd docker-icloudpd
DOCKER_BUILDKIT=1 docker build -f icloudpd.dockerfile -t fixdasfck/icloudpd .

And changed repo in unraid template to fixdasfck/icloudpd

vsonth commented 9 months ago

I am not sure if the docker registry updates as well but the current registry shows last updated 2 months ago

https://hub.docker.com/r/boredazfcuk/icloudpd/

boredazfcuk commented 9 months ago

I'm observing some really unexpected behaviour with this fix... something I'm quite concerned about actually.

So I built and fired up a new container. Deleted my keyring, re-initialised the script, and was prompted for my password.

I entered it and was then prompted to choose my preferred method of MFA. It didn't correctly list my mobile device and I only had a single option, 0.

I pressed 0 and the script crashed out. I allowed access from my phone anyway, but I was not prompted to type in the 6 digit code that popped up on my iDevice:

2023-12-13 22:11:19 DEBUG    Switched to icloudpd: 1.16.3
Enter iCloud password for not@myemail.com:
Save password in keyring?  [y/N]: y
Two-step authentication required. Your trusted devices are:
Which device would you like to use? [0]: 0
Traceback (most recent call last):
  File "/opt/icloudpd_latest/bin/icloud", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/icloudpd_latest/lib/python3.11/site-packages/pyicloud_ipd/cmdline.py", line 235, in main
    device = devices[device]
             ~~~~~~~^^^^^^^^
IndexError: list index out of range

It then went off and downloaded all my most recent photos. This seems troubling, as I didn't actually confirm the 6-digit MFA code... Was MFS just bypassed? Or is it no longer a requirement to type in the 6-digit code to confirm MFA? hmmmmm.

I was waiting for the fix to be released, as I need to figure out how I can actually get it to work in China... but as it's kind of working for the rest of the world, and we have the Christmas holidays coming up where people are bound to take a bunch of photos, I've built and pushed a new container to Dockerhub.

w1zz4 commented 9 months ago

I was asked for codes on my phone when I fired it up. But I know China iCloud is different and it’s a possibility this library is not as Chinese friendly as the one used previously. I think this used a custom China fix in previous version.

zbare commented 9 months ago

I'm observing some really unexpected behaviour with this fix... something I'm quite concerned about actually.

So I built and fired up a new container. Deleted my keyring, re-initialised the script, and was prompted for my password.

I entered it and was then prompted to choose my preferred method of MFA. It didn't correctly list my mobile device and I only had a single option, 0.

I pressed 0 and the script crashed out. I allowed access from my phone anyway, but I was not prompted to type in the 6 digit code that popped up on my iDevice:

2023-12-13 22:11:19 DEBUG    Switched to icloudpd: 1.16.3
Enter iCloud password for not@myemail.com:
Save password in keyring?  [y/N]: y
Two-step authentication required. Your trusted devices are:
Which device would you like to use? [0]: 0
Traceback (most recent call last):
  File "/opt/icloudpd_latest/bin/icloud", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/icloudpd_latest/lib/python3.11/site-packages/pyicloud_ipd/cmdline.py", line 235, in main
    device = devices[device]
             ~~~~~~~^^^^^^^^
IndexError: list index out of range

It then went off and downloaded all my most recent photos. This seems troubling, as I didn't actually confirm the 6-digit MFA code... Was MFS just bypassed? Or is it no longer a requirement to type in the 6-digit code to confirm MFA? hmmmmm.

I was waiting for the fix to be released, as I need to figure out how I can actually get it to work in China... but as it's kind of working for the rest of the world, and we have the Christmas holidays coming up where people are bound to take a bunch of photos, I've built and pushed a new container to Dockerhub.

I am seeing the same behavior for one of my iCloud accounts. I have two containers running. One for Account1 and another for account2. Account1 is working fine off the latest build, but Account2 is giving this same error where it creates the keyring file, and prompts for which device I would like to use, but no devices are listed. Entering Zero gives the 'IndexError' message. The terminal then moves to the "Starting container initialization" line, but I'm not sure it's actually doing anything. Rebooting the container after this point, the logs still show that it is looking for a valid cookie file to be created.

Despite the error, I am getting prompts on my other Apple Devices to allow the connection and then receive a MFA code. Of course no where to input the code.

w1zz4 commented 9 months ago

This fix auth was made from vanilla iphoto photo downloader code that have issue with current MFA. Scarabeus made a new fork that include auth and MFA fix.

This could fix some issue, maybe induce new one since this project seem to use a different fork of photo downloader itself.

w1zz4 commented 9 months ago

NVM, @boredazfcuk already merged the new code to current release.