-
Notifications
You must be signed in to change notification settings - Fork 574
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
downloader fails #139
Comments
I got the same. It seems some change on Apple side. HomeAssistant's comment: ++++ Breaking News +++++ FYI - It has been reported that Apple changed something on there end that is breaking the pyicloud.py program that sits between HA components and Apple. There is some issue where authorizing the access to the Apple iCloud account fails. It is happening on all versions of HA and on icloud3 (all versions), along with the base icloud component that is part of HA. I’ve tried it on 0.92.0, 0.93.0, 0.93.2, 0.94.0 & 0.94.1. Everything works, or seems to, until the account needs to be reauthorized. I’m now keeping up with what is going on and am dead in the water until this issue is resolved. Gary aka GeeksterGary |
|
Can any one please implement in java for https://github.com/viable-hartman/InflatableDonkey/tree/TwoFAHacky please help |
Hi @huangbiyong , cheers, |
Can refer to my github: https://github.com/huangbiyong/Apple-iCloud-lastest-API |
Hey!
These lines have to be commented out because otherwise I get the error that the PhotoAsset object has no attribute called "item_type". |
Hi @danielfmolnar , I cloned the repository and run
But I still get the "same" error message:
Do you have any Idea what went wrong and could help me with that? |
I also have problems with icloudpd, does anyone have any working workarounds? |
@danielfmolnar 's fix does it work? If so can anyone build a new docker image for it so I can update my icloud-sync job |
Hi everyone, sorry I don't have any time to investigate this issue or work on a fix, but I'm very happy to merge a PR and release a new version + docker image. Thanks! |
It looks like we might need a change in the pyicloud library, so here's my fork of pyicloud that If someone could please send a PR to update the |
@ndbroadbent |
So, apparently his code managed to fix the authentication issue, but it did not work with your photo downloader library. I had to uncomment a paragraph. Now it works perfectly like it used to. |
@danielfmolnar can you do a PR for this to https://github.com/ndbroadbent/pyicloud/tree/pyicloud-ipd ? Or at least post diffs of the changes to this thread? Thanks... |
I cloned that version of pyicloud and it doesn't work for me;
|
Hey! |
Hey! |
Hi @danielfmolnar - no luck I'm afraid. I've pulled and installed (sudo python setup.py install) both forks but I still get the authentication error. If I run the icloud binary itself I get the repeated prompt to authenticate. |
This worked for me once I install FIRST icloud_photos_downloader, and THEN pyicloud.. Edit: I am now able to authenticate and create a cookie using icloud - but icloudpd still gives me the error above ( PyiCloudAPIResponseError('Failed to validate the credentials from cookie')) this is SURELY not the way to do it... but the way I finally made this work was to copy the base.py from the 0.9.1 installation to the 0.10.0 installation cp /lib/python3.7/site-packages/pyicloud-0.9.1-py3.7.egg/pyicloud/base.py /lib/python3.7/site-packages/pyicloud_ipd-0.10.0-py3.7.egg/pyicloud_ipd/ I am so ashamed... someone please tell me the right way to do this... |
That is indeed working for me too. I'm not to bothered about how it works so long as it does work 😄 |
Following those steps I'm getting this error message: |
same for me. I did
The password was correct, I'm sure. |
after pulling danielfmolnars forks and copying base.py according to gregbert42s suggestion, |
Same happens for me. Important to set it for awake hours :-)
… On Jun 26, 2019, at 12:18 PM, biGdada ***@***.***> wrote:
after pulling danielfmolnars forks and copying base.py according to gregbert42s suggestion,
i'm getting 2fa window on my iphone every time i run icloudpd. no matter if i allow or decline the request, icloudpd connects and downloads. any solution?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I believe I have solved this in a somewhat clean way. If you download and install the versions from my two branches: (start with pyicloud-ipd), it should work. As @ndbroadbent, says, icloud_photos_downloader uses the renamed pyicloud-ipd from the pyicloud-ipd branch (https://github.com/ndbroadbent/pyicloud/tree/pyicloud-ipd). I have merged the changes from @PeterHedleyJHA to this branch, and it all seems to work. (I also documented the previously undocumented change that download directory has to be specified as --directory, instead as first argument, confused me for a while...) |
It still seems to launch the 2FA window everytime on the phone though, no idea how to solve that. |
Good work! Having the 2FA pop up all the time is not possible for me as I don't have physical access to the device. I'm hoping we can work aound that limitation |
Hi everyone! It would be great if someone was able to submit a PR with these changes, where all the tests are passing, and with 100% test coverage (and no problem if you need to delete some code to remove some features. We can re-add something later if there is enough demand.) Cheers! |
I think the problem with the current workaround is that it’s a bit of a hack, and it breaks some functionality that other users are depending on. But either way, it would be better to have a working script than a broken one! |
Fully agree on that point @ndbroadbent =) |
I think everyone might be on a wild goose chase... I have this working in a docker container and I haven't applied any fixes at all. The only issue is this error when generating the cookie:
But I only get the 2FA prompt on my iDevice when I generate my cookie. Every sync after that works as expected. |
I’m gonna have to double check but I’m pretty sure that’s not what I’m getting. Is this the same version that’s in @ndbroadbent s container? |
what is the status of 2FA prompt right now? has anyone succeeded to to make it work without triggering the 2FA dialog? |
No, it's using a container I built... Sorry, I should have linked it: https://github.com/boredazfcuk/docker-icloud_photos_downloader |
Yes: https://github.com/boredazfcuk/docker-icloud_photos_downloader |
Sorry, about line 24. I've not had chance to break it out into it's own file yet as I write most of my stuff in Portainer's web editor and I can't feed additional files into it... |
|
The dockerfile is just an install script which has all the commands needed to install it on Alpine Linux. You should be able to adapt it to install on whatever distribution you like. |
I've finished tidying the code. I've split out the launch script to a separate file now so it's easier to read. I've re-built the Docker image and the container from scratch three or four times now and it definitely doesn't have the 2FA prompting issue. This issue must be some sort of system issue, rather than code problem. If people would verify my findings and report any issues that would be great, thanks. |
Ok @boredazfcuk, so there's a bunch of things unfortunately. Volumes: Script init: CLIOPTIONS: Finally, and sadly: Error: Got unexpected extra argument () |
Hi, Volumes point 1: Volumes point 2: I use /home/${USER}/iCloud as the download destination within the container as I have 3 different accounts that I sync (me, Mrs & kids). Having them sync to the user's home folder means I have an easy visual guide as to which container I'm operating in if I am connected via the shell. They also map to the same location on the host machine for consistency. I could change the download path within the container to something generic, but I see that as a drawback as I'd lose user visibility. Also, it doesn't really matter where they're stored within the container as the destination folder is a bind mount to a different location on the host. Script init: CLIOPTIONS:
Edit: just seen you tried passing the SMTP options... You're probably just best leaving them out for the time being. I'm going to look at implementing notification options within my docker file rather than relying on icloudpd. The problem with passing the notification options directly to icloudpd is that you have no way of entering the 2FA code when you get prompted to renew it... This will cause the container to hang indefinitely. On my to do list is configuring a Healthcheck on the container so that it will show as unhealthy if the cookie has expired... Interestingly the cookie expiry date is visible within the cookie so I'm going to amend my script to extract that and display it on each sync so you get plenty of warning. I should be able to fire off notifications about cookie expiry in advance so you get a week or two's notice rather than just a "someone's trying to access your account" type message randomly. |
Hey, Ah, got it, thanks.
Could there be an issue with the escaping? Ps. I also noticed that sometimes you use mix space and = when assigning the parameters (ie. --directory /home/... and --cookie-directory=$CONFIGDIR), both works of course, just my narcissistic brain reacted =) |
This error is saying that the destination folder for the downloads does not exist inside the container. Are you sure your container was created with two volumes and not just the first one?
The first volume is for storing the authentication token so it's available between restarts.
So yours should look something like:
The "/home/hyper/iCloud" folder should automatically be created when you specify that second volume. I've updated the readme so it should be clearer now. |
Hey, Yupp, /home/hyper/iCloud most definitely exists:
... and this is from inside the container of course.. |
I think it's something odd is happening with the quotes. I think those double quotes means it's actually using "/home/hyper/iCloud" (quote included) as the path |
I suppose I can really remove those, as usernames with spaces in them are not allowed. I'm just in the habit of quoting all my variables so I can deal with spaces.
I copy/pasted a lot of the script from one I created to run in an LXC container. That was when the instructions included '='. They've since been removed. See here: #119 |
Just to confirm, you don't get the 2FA prompting issue? |
No issues with the 2FA! |
Winner! Winner! |
Thanks @boredazfcuk and @hyper-ex for building this. Downloading photos now works great (without 2FA prompt) for all "album-Albums" (i.e. named albums I've created my self). For the "official" Apple albums like All Photos, Slo-mo. Screenshots or others it doesn't work ("0 photos"). Any idea what could be going on or how to best debug? Thanks! |
@mdbraber Sorry for the late reply, I was busy building a bunch of other containers and forgot to respond... I've never used the --album functionality to download named albums. I just run it without that option and it pulls "All Photos" which includes all the screen shots, videos etc. Also, I've now pushed this to Ducker hub so the image can be downloaded with:
rather than having to build it from scratch with the dockerfile |
I am super appreciative of this... So happy to have it working again
seamlessly.
…On Mon, Sep 16, 2019 at 1:06 PM boredazfcuk ***@***.***> wrote:
@mdbraber <https://github.com/mdbraber> Sorry for the late reply, I was
busy building a bunch of other containers and forgot to respond...
I've never used the --album functionality to download named albums. I just
run it without that option and it pulls "All Photos" which includes all the
screen shots, videos etc.
Also, I've now pushed this to Ducker hub so the image can be downloaded
with:
docker pull boredazfcuk/icloudpd
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#139>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEBNBYOROYJ5Y2AGXDN5XK3QJ5SDZANCNFSM4HXETO7Q>
.
|
Very happy! Great job and thanks @boredazfcuk @hyper-ex ! Compared to my previous build I'm now missing the --album parameter. Please correct me, hope I'm just wrong and the feature to download specific albums is still available. |
This issue is resolved, I guess, @ndbroadbent |
Thanks @menkej, will close! |
Traceback (most recent call last):
File "/Users/chhu02/anaconda3/bin/icloudpd", line 10, in
sys.exit(main())
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/icloudpd/base.py", line 229, in main
client_id=os.environ.get("CLIENT_ID"),
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/icloudpd/authentication.py", line 32, in authenticate
client_id=client_id)
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/pyicloud_ipd/base.py", line 193, in init
self.authenticate()
File "/Users/chhu02/anaconda3/lib/python3.6/site-packages/pyicloud_ipd/base.py", line 216, in authenticate
raise PyiCloudFailedLoginException(msg, error)
pyicloud_ipd.exceptions.PyiCloudFailedLoginException: ('Invalid email/password combination.', PyiCloudAPIResponseError('Failed to validate the credentials from cookie',))
The text was updated successfully, but these errors were encountered: