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

fix: new AppleID auth with srp #972

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

iowk
Copy link
Contributor

@iowk iowk commented Oct 25, 2024

Fixes #970

src/pyicloud_ipd/base.py Fixed Show fixed Hide fixed
params={"isRememberMeEnabled": "true"},
data=json.dumps(data),
headers=headers,
)
if response.status_code == 401:
raise PyiCloudAPIResponseException(response.status_code)
Copy link

@twcurrie twcurrie Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise PyiCloudAPIResponseException(response.status_code)
raise PyiCloudAPIResponseException(response.text , str(response.status_code))

PyiCloudAPIResponseException takes two parameters, both must be strings to pass type checks.

response is a Response object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thank you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for getting this fixed.

try:
response = self.session.post("%s/signin/init" % self.AUTH_ENDPOINT, data=json.dumps(data), headers=headers)
if response.status_code == 401:
raise PyiCloudAPIResponseException(response.status_code)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise PyiCloudAPIResponseException(response.status_code)
raise PyiCloudAPIResponseException(response.text , str(response.status_code))

Similar as below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

input="0\n654321\n",
)
assert result.exit_code == 0
shutil.copytree(cookie_master_path, cookie_dir)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change have to be done in the following files as well?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per comment, this is just a missed change in PR 971

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @AndreyNikiforov mentioned that he will fix it. I will then rebase this branch and the tests should pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased. Also fixed CodeQL and type check warnings. Now this PR is ready.

@iowk iowk force-pushed the issue-970 branch 2 times, most recently from 1a1b8de to 3d97c20 Compare October 25, 2024 08:28
@AndreyNikiforov AndreyNikiforov merged commit d796f99 into icloud-photos-downloader:master Oct 25, 2024
378 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service Temporarily Unavailable (503)
3 participants