boredazfcuk / docker-icloudpd

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

A error happened when login to icloud: pyicloud_ipd.exceptions.PyiCloudAPIResponseError: statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, Failed to resolve 'accountservice.p00.prod.me.com' after 6 queries #227

Closed blademainer closed 1 year ago

blademainer commented 1 year ago

The trace info:

2022-11-04 23:00:52 INFO     Using password stored in keyring file: /config/python_keyring/keyring_pass.cfg                                                                                                 
2022-11-04 23:00:52 INFO     Correct owner on config directory, if required                                                                                                                                 
2022-11-04 23:00:52 INFO     Correct group on config directory, if required                                                                                                                                 
2022-11-04 23:00:52 INFO     Generate 2FA cookie using password stored in keyring file                                                                                                                      
Traceback (most recent call last):                                                                                                                                                                          
  File "/usr/bin/icloudpd", line 33, in <module>                                                                                                                                                            
    sys.exit(load_entry_point('icloudpd==1.7.2', 'console_scripts', 'icloudpd')())                                                                                                                          
  File "/usr/lib/python3.10/site-packages/click/core.py", line 722, in __call__                                                                                                                             
    return self.main(*args, **kwargs)                                                                                                                                                                       
  File "/usr/lib/python3.10/site-packages/click/core.py", line 697, in main                                                                                                                                 
    rv = self.invoke(ctx)                                                                                                                                                                                   
  File "/usr/lib/python3.10/site-packages/click/core.py", line 895, in invoke                                                                                                                               
    return ctx.invoke(self.callback, **ctx.params)                                                                                                                                                          
  File "/usr/lib/python3.10/site-packages/click/core.py", line 535, in invoke                                                                                                                               
    return callback(*args, **kwargs)                                                                                                                                                                        
  File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/base.py", line 255, in main                                                                                                    
    icloud = authenticate(                                                                                                                                                                                  
  File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/authentication.py", line 47, in authenticate                                                                                   
    request_2sa(icloud, logger)                                                                                                                                                                             
  File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/authentication.py", line 53, in request_2sa                                                                                    
    devices = icloud.trusted_devices                                                                                                                                                                        
  File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 249, in trusted_devices                                                                                                               
    request = self.session.get(                                                                                                                                                                             
  File "/usr/lib/python3.10/site-packages/requests/sessions.py", line 600, in get                                                                                                                           
    return self.request("GET", url, **kwargs)                                                                                                                                                               
  File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 100, in request                                                                                                                       
    self._raise_error(code, reason)                                                                                                                                                                         
  File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 122, in _raise_error                                                                                                                  
    raise api_error                                                                                                                                                                                         
pyicloud_ipd.exceptions.PyiCloudAPIResponseError: statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, Failed to resolve 'acco
untservice.p00.prod.me.com' after 6 queries                                                                                                                                                                 
2022-11-04 23:00:59 ERROR    2FA information missing from cookie. Authentication has failed                                                                                                                 
2022-11-04 23:00:59 ERROR     - Was the correct password entered?                                                                                                                                           
2022-11-04 23:00:59 ERROR     - Was the 2FA code mistyped?                                                                                                                                                  
2022-11-04 23:00:59 ERROR     - Can you log into iCloud.com without receiving pop-up notifications?
shaoj0013 commented 1 year ago

我也是同样的故障!

2022-11-05 11:53:04 INFO Adding password to keyring file: /config/python_keyring/keyring_pass.cfg Enter iCloud password for shaoj0013@qq.com: Bad username or password for shaoj0013@qq.com Enter iCloud password for shaoj0013@qq.com: Save password in keyring? [y/N]: y Two-step authentication required. Your trusted devices are: Traceback (most recent call last): File "/usr/bin/icloud", line 33, in sys.exit(load_entry_point('pyicloud-ipd==0.10.1', 'console_scripts', 'icloud')()) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/cmdline.py", line 216, in main devices = api.trusted_devices File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 249, in trusted_devices request = self.session.get( File "/usr/lib/python3.10/site-packages/requests/sessions.py", line 600, in get return self.request("GET", url, kwargs) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 100, in request self._raise_error(code, reason) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 122, in _raise_error raise api_error pyicloud_ipd.exceptions.PyiCloudAPIResponseError: statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, Failed to resolve 'accountservice.p00.prod.me.com' after 6 queries 2022-11-05 11:53:49 INFO Correct owner on config directory, if required 2022-11-05 11:53:49 INFO Correct group on config directory, if required 2022-11-05 11:53:49 INFO Generate 2FA cookie using password stored in keyring file Traceback (most recent call last): File "/usr/bin/icloudpd", line 33, in sys.exit(load_entry_point('icloudpd==1.7.2', 'console_scripts', 'icloudpd')()) File "/usr/lib/python3.10/site-packages/click/core.py", line 722, in call return self.main(args, kwargs) File "/usr/lib/python3.10/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python3.10/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3.10/site-packages/click/core.py", line 535, in invoke return callback(args, kwargs) File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/base.py", line 255, in main icloud = authenticate( File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/authentication.py", line 47, in authenticate request_2sa(icloud, logger) File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/authentication.py", line 53, in request_2sa devices = icloud.trusted_devices File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 249, in trusted_devices request = self.session.get( File "/usr/lib/python3.10/site-packages/requests/sessions.py", line 600, in get return self.request("GET", url, **kwargs) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 100, in request self._raise_error(code, reason) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 122, in _raise_error raise api_error pyicloud_ipd.exceptions.PyiCloudAPIResponseError: statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, Failed to resolve 'accountservice.p00.prod.me.com' after 6 queries 2022-11-05 11:53:55 ERROR 2FA information missing from cookie. Authentication has failed 2022-11-05 11:53:55 ERROR - Was the correct password entered? 2022-11-05 11:53:55 ERROR - Was the 2FA code mistyped? 2022-11-05 11:53:55 ERROR - Can you log into iCloud.com without receiving pop-up notifications? root@DS918-shaoj0013:~#

miniers commented 1 year ago

same error

shaoj0013 commented 1 year ago

奇怪都是同一个容器,我一个docker下,另外一个apple id帐户却同步正常!

blademainer commented 1 year ago

你另外一个容器是不是已经登录上去过?只是新的才报错

shaoj0013 commented 1 year ago

两个容器同时部署的!一直使用正常!目前只有一个容器报错,另一个正常

sk163 commented 1 year ago

同样的故障,感觉可能是网页版的问题,https://www.icloud.com/和https://www.icloud.com.cn/,页面一直在加载,都打不开了

blademainer commented 1 year ago

同样的故障,感觉可能是网页版的问题,https://www.icloud.com/和https://www.icloud.com.cn/,页面一直在加载,都打不开了

确实是,但用隐身模式是可以加载进去的。有可能是icloud最近更新了他们的服务

dysf888 commented 1 year ago

一样的问题 2022-11-06 04:58:34 WARNING Downloading from icloud.com.cn is untested. Please report issues at https://github.com/boredazfcuk/docker-icloudpd/issues 2022-11-06 04:58:35 INFO Nextcloud synchronisation trigger: Enabled 2022-11-06 04:58:35 INFO Script launch parameters: --Initialise 2022-11-06 04:58:35 INFO Group, apps:568, already created 2022-11-06 04:58:35 INFO User, apps:568, already created 2022-11-06 04:58:35 INFO Set owner, apps, on iCloud directory, if required 2022-11-06 04:58:35 INFO Set group, apps, on iCloud directory, if required 2022-11-06 04:58:35 INFO Correct owner on icloudpd temp directory, if required 2022-11-06 04:58:35 INFO Correct group on icloudpd temp directory, if required 2022-11-06 04:58:35 INFO Correct owner on config directory, if required 2022-11-06 04:58:35 INFO Correct group on config directory, if required 2022-11-06 04:58:35 INFO Correct owner on keyring directory, if required 2022-11-06 04:58:35 INFO Correct group on keyring directory, if required 2022-11-06 04:58:35 INFO Set 750 permissions on iCloud directories, if required 2022-11-06 04:58:35 INFO Set 640 permissions on iCloud files, if required 2022-11-06 04:58:35 INFO Configure password 2022-11-06 04:58:35 INFO Using password stored in keyring file: /config/python_keyring/keyring_pass.cfg 2022-11-06 04:58:35 INFO Correct owner on config directory, if required 2022-11-06 04:58:35 INFO Correct group on config directory, if required 2022-11-06 04:58:35 INFO Generate 2FA cookie using password stored in keyring file Traceback (most recent call last): File "/usr/bin/icloudpd", line 33, in sys.exit(load_entry_point('icloudpd==1.7.2', 'console_scripts', 'icloudpd')()) File "/usr/lib/python3.10/site-packages/click/core.py", line 722, in call return self.main(args, kwargs) File "/usr/lib/python3.10/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python3.10/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3.10/site-packages/click/core.py", line 535, in invoke return callback(args, kwargs) File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/base.py", line 255, in main icloud = authenticate( File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/authentication.py", line 47, in authenticate request_2sa(icloud, logger) File "/usr/lib/python3.10/site-packages/icloudpd-1.7.2-py3.10.egg/icloudpd/authentication.py", line 53, in request_2sa devices = icloud.trusted_devices File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 249, in trusted_devices request = self.session.get( File "/usr/lib/python3.10/site-packages/requests/sessions.py", line 600, in get return self.request("GET", url, kwargs) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 100, in request self._raise_error(code, reason) File "/usr/lib/python3.10/site-packages/pyicloud_ipd/base.py", line 122, in _raise_error raise api_error pyicloud_ipd.exceptions.PyiCloudAPIResponseError: statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, Failed to resolve 'accountservice.p00.prod.me.com' after 6 queries 2022-11-06 04:58:41 ERROR 2FA information missing from cookie. Authentication has failed 2022-11-06 04:58:41 ERROR - Was the correct password entered? 2022-11-06 04:58:41 ERROR - Was the 2FA code mistyped? 2022-11-06 04:58:41 ERROR - Can you log into iCloud.com without receiving pop-up notifications?

blademainer commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

zofnk commented 1 year ago

Same error

jaysunneu commented 1 year ago

Same error

sk163 commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

请问这个地址是怎么抓取到的?原先是https://setup.icloud.com/setup/ws/1 这个么?

blademainer commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

请问这个地址是怎么抓取到的?原先是https://setup.icloud.com/setup/ws/1 这个么?

登录 https://icloud.com.cn 时抓包抓到的,原先是 https://setup.icloud.com/setup/ws/1 没错的

happyeddie commented 1 year ago

ping accountservice.p00.prod.me.com 这个地址根本就没有解析,无论是在国内还是海外,很奇怪,这个 domain 是从哪里来的

blademainer commented 1 year ago

ping accountservice.p00.prod.me.com 这个地址根本就没有解析,无论是在国内还是海外,很奇怪,这个 domain 是从哪里来的

猜测是比较老版本的API(这个项目引用的icloud库确实也比较老了)引用该域名,me.com是归属apple的

Linnnkkk commented 1 year ago

same error

happyeddie commented 1 year ago

ping accountservice.p00.prod.me.com 这个地址根本就没有解析,无论是在国内还是海外,很奇怪,这个 domain 是从哪里来的

猜测是比较老版本的API(这个项目引用的icloud库确实也比较老了)引用该域名,me.com是归属apple的

嗯,我知道 me.com 是 apple 的域名,我不理解的是,accountservice.p00.prod.me.com 这个域名无论是在国内还是海外都没有解析,如果是自动扒 icloud 登陆过程中的请求,那 apple 也不会引用这么一个没有解析的域名,是不是代码逻辑的问题导致计算出了一个拼错的路径

blademainer commented 1 year ago

ping accountservice.p00.prod.me.com 这个地址根本就没有解析,无论是在国内还是海外,很奇怪,这个 domain 是从哪里来的

猜测是比较老版本的API(这个项目引用的icloud库确实也比较老了)引用该域名,me.com是归属apple的

嗯,我知道 me.com 是 apple 的域名,我不理解的是,accountservice.p00.prod.me.com 这个域名无论是在国内还是海外都没有解析,如果是自动扒 icloud 登陆过程中的请求,那 apple 也不会引用这么一个没有解析的域名,是不是代码逻辑的问题导致计算出了一个拼错的路径

apple不引用是正常的,因为他的新版本API可能已经弃用该域名,之所以现在下掉域名,可能是已经过了新版本的灰度期

shaoj0013 commented 1 year ago

可是,我同时两个账号,只有一个出现这种情况,另一个任然工作正常发自我的 iPhone在 2022年11月11日,19:01,blademainer @.***> 写道:

ping accountservice.p00.prod.me.com 这个地址根本就没有解析,无论是在国内还是海外,很奇怪,这个 domain 是从哪里来的

猜测是比较老版本的API(这个项目引用的icloud库确实也比较老了)引用该域名,me.com是归属apple的

嗯,我知道 me.com 是 apple 的域名,我不理解的是,accountservice.p00.prod.me.com 这个域名无论是在国内还是海外都没有解析,如果是自动扒 icloud 登陆过程中的请求,那 apple 也不会引用这么一个没有解析的域名,是不是代码逻辑的问题导致计算出了一个拼错的路径

apple不引用是正常的,因为他的新版本API可能已经弃用该域名,之所以现在下掉域名,可能是已经过了新版本的灰度期

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

gyk001 commented 1 year ago

same error

YuHayring commented 1 year ago

一样的问题,啥时候可以跑了踢我一脚

wtlucky commented 1 year ago

mark, has the same error.

boredazfcuk commented 1 year ago

Hi,

I've created a new test container for myself and it works perfectly.

If I perform an nslookup on accountservice.p00.prod.me.com, I get a "non-existent domain" error too. This means that the accountservice.p00.prod.me.com server was not contacted when validating my account. It's not a DNS issue localised to China.

I used SMS 2FA authentication for both password and cookie 2FA prompts. I'm not sure if that makes a difference.

Thanks.

sk163 commented 1 year ago
image

Thanks boredazfcuk. I retried using the initialization ,after entering the password, an error is reported before 2FA verification. can't find this domain name anywhere, I don't know if it is in the response after password verification

sk163 commented 1 year ago

imageFailed Cookie

imageSuccess Cookie

I have 2 apple id , by comparing the cookie files, the successes and failures are not the same. Success Cookie : Set-Cookie3: X-APPLE-WEBAUTH-HSA-TRUST-** Failed Cookie: Set-Cookie3: X-APPLE-DS-WEB-SESSION-TOKEN-***

luyud commented 1 year ago

Apple just updated iCloud web, Maybe the script also needs some updates

yunxiaofeng1001 commented 1 year ago

same error mark issues

blademainer commented 1 year ago

imageFailed Cookie

imageSuccess Cookie

I have 2 apple id , by comparing the cookie files, the successes and failures are not the same. Success Cookie : Set-Cookie3: X-APPLE-WEBAUTH-HSA-TRUST-** Failed Cookie: Set-Cookie3: X-APPLE-DS-WEB-SESSION-TOKEN-***

可以发下成功登录的具体有哪些COOKIE名吗?我想自己先扒出来贴到配置里面去,先让备份跑起来

boredazfcuk commented 1 year ago

I have 2 apple id , by comparing the cookie files, the successes and failures are not the same. Success Cookie : Set-Cookie3: X-APPLE-WEBAUTH-HSA-TRUST-** Failed Cookie: Set-Cookie3: X-APPLE-DS-WEB-SESSION-TOKEN-***

This is expected behaviour.

When the app connects to the website, it is issued the X-APPLE-DS-WEB-SESSION-TOKEN cookie. Users who do not have 2FA enabled on their account will keep this X-APPLE-DS-WEB-SESSION-TOKEN cookie.

If a user has 2FA enabled on their account, when they successfully verify their account using 2FA, the X-APPLE-DS-WEB-SESSION-TOKEN cookie is replaced with the X-APPLE-WEBAUTH-HSA-TRUST cookie.

boredazfcuk commented 1 year ago

Apple just updated iCloud web, Maybe the script also needs some updates

If this is true then the underlying application will require an update.

I am not seeing any changes to my iCloud website... Or the website hasn't been changed enough to break the script at least.

sk163 commented 1 year ago

I am not seeing any changes to my iCloud website... Or the website hasn't been changed enough to break the script at least.

which script file name? I try to debug it,thanks

sk163 commented 1 year ago

imageSuccess Cookie I have 2 apple id , by comparing the cookie files, the successes and failures are not the same. Success Cookie : Set-Cookie3: X-APPLE-WEBAUTH-HSA-TRUST-** Failed Cookie: Set-Cookie3: X-APPLE-DS-WEB-SESSION-TOKEN-***

可以发下成功登录的具体有哪些COOKIE名吗?我想自己先扒出来贴到配置里面去,先让备份跑起来

就是我截图成功的这两个cookie,只是部分内容打码了,打码的内容里没有新的key名

boredazfcuk commented 1 year ago

I am not seeing any changes to my iCloud website... Or the website hasn't been changed enough to break the script at least.

which script file name? I try to debug it,thanks

This is the project which does I use to download everything: https://github.com/icloud-photos-downloader/icloud_photos_downloader

If you figure it out I might need to fork their project, so you can merge changes to the fork, as nobody seems to be maintaining that project anymore.

sk163 commented 1 year ago

I am not seeing any changes to my iCloud website... Or the website hasn't been changed enough to break the script at least.

which script file name? I try to debug it,thanks

This is the project which does I use to download everything: https://github.com/icloud-photos-downloader/icloud_photos_downloader

If you figure it out I might need to fork their project, so you can merge changes to the fork, as nobody seems to be maintaining that project anymore.

image

project: icloud-photos-downloader/pyicloud, branch:pyicloud_ipd

debug in script base.py[239-244] , self.data['dsInfo'].get('hsaVersion', 0) = 2 , Not Implement 2FA

trusted_devices method: "https://setup.icloud.com.cn/setup/ws/1/listDevice" is invalid , invoke this url an error occurred

validate_verification_code method: "https://setup.icloud.com.cn/setup/ws/1/sendVerificationCode" move to "https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode"

image image

pyicloud_ipd.exceptions.PyiCloudAPIResponseError: (403)

sk163 commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

确实是,调试了一下程序,跟您的情况一样,hsaVersion=2 这个版本的2FA就没有实现,走到trusted_devices方法里调用/listDevice就会报accountservice.p00.prod.me.com域名错误。 程序改成直接返回设备列表可以绕过去 if self.data['dsInfo'].get('hsaVersion', 0) == 2: return self.account.devices

后边的验证安全码的接口地址变了,调这个地址/validateVerificationCode也会出现accountservice.p00.prod.me.com域名错误, 抓包后改成idmsa.apple.com地址后会报403错误,跟网页端对比了一下,应该是携带的请求header不全,暂时也没抓到请求idmsa的cookie header是在哪里设置的。

也试了试直接改cookie文件,直接把网页抓到的cookie替换到/config/appleid这个文件里,也是不起作用,因为icloud_photos_downloader程序启动后,会自动执行一次登录,然后把文件里面的cookie又给替换成新登录的cookie了。

Linnnkkk commented 1 year ago

这个问题还能解决吗?

blademainer commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

确实是,调试了一下程序,跟您的情况一样,hsaVersion=2 这个版本的2FA就没有实现,走到trusted_devices方法里调用/listDevice就会报accountservice.p00.prod.me.com域名错误。 程序改成直接返回设备列表可以绕过去 if self.data['dsInfo'].get('hsaVersion', 0) == 2: return self.account.devices

后边的验证安全码的接口地址变了,调这个地址/validateVerificationCode也会出现accountservice.p00.prod.me.com域名错误, 抓包后改成idmsa.apple.com地址后会报403错误,跟网页端对比了一下,应该是携带的请求header不全,暂时也没抓到请求idmsa的cookie header是在哪里设置的。

也试了试直接改cookie文件,直接把网页抓到的cookie替换到/config/appleid这个文件里,也是不起作用,因为icloud_photos_downloader程序启动后,会自动执行一次登录,然后把文件里面的cookie又给替换成新登录的cookie了。

是的,最近我尝试用go重写登录程序,也是卡在了securitycode这里,不知道是哪个header没设置对

shaoj0013 commented 1 year ago

更新后故障依旧!无法使用

HuLuXi commented 1 year ago

坐等大佬们修复

nazh888888 commented 1 year ago

坐等大佬们修复

Arnold4869 commented 1 year ago

我没有看到我的 iCloud 网站有任何变化...或者网站还没有改变到足以破坏脚本的程度。

哪个脚本文件名?我尝试调试它,谢谢

这是我用来下载所有内容的项目:https://github.com/icloud-photos-downloader/icloud_photos_downloader

如果你弄清楚了,我可能需要分叉他们的项目,这样你就可以将更改合并到分叉,因为似乎没有人再维护该项目了。

I am not seeing any changes to my iCloud website... Or the website hasn't been changed enough to break the script at least.

which script file name? I try to debug it,thanks

This is the project which does I use to download everything: https://github.com/icloud-photos-downloader/icloud_photos_downloader

If you figure it out I might need to fork their project, so you can merge changes to the fork, as nobody seems to be maintaining that project anymore.

is there any progress?I have been tossed by this bug for several days and have not been able to re-verify

sk163 commented 1 year ago

icloud-photos-downloader/pyicloud 这个项目没有支持对HSA2的账户登录模式,所以要想继续用这个docker,就得先把这个登录模式搞定。有的人icloud账号能够正常使用,是因为他们的账户登录模式还是HSA1,不知道是怎么从HSA1换到HSA2的,感觉像是在做灰度升级,切了一部分人过去

nazh888888 commented 1 year ago

icloud-photos-downloader/pyicloud 这个项目没有支持对HSA2的账户登录模式,所以要想继续用这个docker,就得先把这个登录模式搞定。有的人icloud账号能够正常使用,是因为他们的账户登录模式还是HSA1,不知道是怎么从HSA1换到HSA2的,感觉像是在做灰度升级,切了一部分人过去

有可能是加入家庭组原因,我用免费的icloud的时候好像正常,后来加入了一个icloud 2T的家庭组后就开始无法同步,提示private db access disabled for this account,我删除容器重新创建就报这个错误了

0xJacky commented 1 year ago

我用家庭组很久了,前阵子也开始报 private db access disabled for this accountI use iCloud family for a long time, recently when I visit the iCloud Photo Library on icloud.com.cn, the server throw “private db access disabled for this account” error.JackyOn Nov 25, 2022, at 7:04 PM, nazh888888 @.***> wrote:

icloud-photos-downloader/pyicloud 这个项目没有支持对HSA2的账户登录模式,所以要想继续用这个docker,就得先把这个登录模式搞定。有的人icloud账号能够正常使用,是因为他们的账户登录模式还是HSA1,不知道是怎么从HSA1换到HSA2的,感觉像是在做灰度升级,切了一部分人过去

有可能是加入家庭组原因,我用免费的icloud的时候好像正常,后来加入了一个icloud 2T的家庭组后就开始无法同步,提示private db access disabled for this account,我删除容器重新创建就报这个错误了

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Linnnkkk commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

确实是,调试了一下程序,跟您的情况一样,hsaVersion=2 这个版本的2FA就没有实现,走到trusted_devices方法里调用/listDevice就会报accountservice.p00.prod.me.com域名错误。 程序改成直接返回设备列表可以绕过去 if self.data['dsInfo'].get('hsaVersion', 0) == 2: return self.account.devices 后边的验证安全码的接口地址变了,调这个地址/validateVerificationCode也会出现accountservice.p00.prod.me.com域名错误, 抓包后改成idmsa.apple.com地址后会报403错误,跟网页端对比了一下,应该是携带的请求header不全,暂时也没抓到请求idmsa的cookie header是在哪里设置的。 也试了试直接改cookie文件,直接把网页抓到的cookie替换到/config/appleid这个文件里,也是不起作用,因为icloud_photos_downloader程序启动后,会自动执行一次登录,然后把文件里面的cookie又给替换成新登录的cookie了。

是的,最近我尝试用go重写登录程序,也是卡在了securitycode这里,不知道是哪个header没设置对

大佬,这个问题可以解决吗?

popdisk commented 1 year ago

我用家庭组很久了,前阵子也开始报 private db access disabled for this accountI use iCloud family for a long time, recently when I visit the iCloud Photo Library on icloud.com.cn, the server throw “private db access disabled for this account” error.JackyOn Nov 25, 2022, at 7:04 PM, nazh888888 @.> wrote: icloud-photos-downloader/pyicloud 这个项目没有支持对HSA2的账户登录模式,所以要想继续用这个docker,就得先把这个登录模式搞定。有的人icloud账号能够正常使用,是因为他们的账户登录模式还是HSA1,不知道是怎么从HSA1换到HSA2的,感觉像是在做灰度升级,切了一部分人过去 有可能是加入家庭组原因,我用免费的icloud的时候好像正常,后来加入了一个icloud 2T的家庭组后就开始无法同步,提示private db access disabled for this account,我删除容器重新创建就报这个错误了 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>

奇怪,我调试了下,国区和美区都是"hsaVersion": 2,其中一个加了共享,并没有这个问题。

MARINGTIN commented 1 year ago

我用家庭组很久了,前阵子也开始报 private db access disabled for this accountI use iCloud family for a long time, recently when I visit the iCloud Photo Library on icloud.com.cn, the server throw “private db access disabled for this account” error.JackyOn Nov 25, 2022, at 7:04 PM, nazh888888 @.> wrote: icloud-photos-downloader/pyicloud 这个项目没有支持对HSA2的账户登录模式,所以要想继续用这个docker,就得先把这个登录模式搞定。有的人icloud账号能够正常使用,是因为他们的账户登录模式还是HSA1,不知道是怎么从HSA1换到HSA2的,感觉像是在做灰度升级,切了一部分人过去 有可能是加入家庭组原因,我用免费的icloud的时候好像正常,后来加入了一个icloud 2T的家庭组后就开始无法同步,提示private db access disabled for this account,我删除容器重新创建就报这个错误了 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>

应该不是家庭组,我的iCloud没有加入任何家庭组现在也这样,可能就是灰度测试,随机切一批过去(我现在是每月200g空间iCloud的自购)

bear-boss commented 1 year ago

I am not seeing any changes to my iCloud website... Or the website hasn't been changed enough to break the script at least.

which script file name? I try to debug it,thanks

This is the project which does I use to download everything: https://github.com/icloud-photos-downloader/icloud_photos_downloader

If you figure it out I might need to fork their project, so you can merge changes to the fork, as nobody seems to be maintaining that project anymore.

@boredazfcuk https://github.com/picklepete/pyicloud this porject has implemented the new auth version. maybe u can take a look. thanks

blademainer commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决trusted_devicesFailed to resolve 'accountservice.p00.prod.me.com'问题;将validate_verification_code内的地址改为: https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

确实是,调试了一下程序,跟您的情况一样,hsaVersion=2 这个版本的2FA就没有实现,走到trusted_devices方法里调用/listDevice就会报accountservice.p00.prod.me.com域名错误。 程序改成直接返回设备列表可以绕过去 if self.data['dsInfo'].get('hsaVersion', 0) == 2: return self.account.devices 后边的验证安全码的接口地址变了,调这个地址/validateVerificationCode也会出现accountservice.p00.prod.me.com域名错误, 抓包后改成idmsa.apple.com地址后会报403错误,跟网页端对比了一下,应该是携带的请求header不全,暂时也没抓到请求idmsa的cookie header是在哪里设置的。 也试了试直接改cookie文件,直接把网页抓到的cookie替换到/config/appleid这个文件里,也是不起作用,因为icloud_photos_downloader程序启动后,会自动执行一次登录,然后把文件里面的cookie又给替换成新登录的cookie了。

是的,最近我尝试用go重写登录程序,也是卡在了securitycode这里,不知道是哪个header没设置对

大佬,这个问题可以解决吗?

看有人解决了这个问题,估计得找人重新打docker镜像 https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/492#issuecomment-1336130886

https://github.com/Haoke98/icloud-killer

china31 commented 1 year ago

我将 https://github.com/icloud-photos-downloader/pyicloud/blob/master/pyicloud/base.py#L249-L251 的代码替换为:

request = self.session.get(
            'https://p215-setup.icloud.com.cn/setup/web/device/getDevices',
            params=self.params
        )

之后,可以解决的问题;将validate_verification_code内的地址改为:trusted_devices``Failed to resolve 'accountservice.p00.prod.me.com'``https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

    def validate_verification_code(self, device, code):
        """ Verifies a verification code received on a trusted device"""
        #device.update({
        #    'verificationCode': code,
        #    'trustBrowser': True
        #})
        device.update({
            'securityCode': {
                "code": code
            }
        })
        data = json.dumps(device)

        try:
            request = self.session.post(
                'https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode',
                params=self.params,
                data=data
            )

但仍然会报403,目前看来还是由于网页版icloud(不确定是否只有中国才出现)更新导致的问题

确实是,调试了一下程序,跟您的情况一样,hsaVersion=2 这个版本的2FA就没有实现,走到trusted_devices方法里调用/listDevice就会报域名错误。程序改成直接返回设备列表可以绕过去 if self.data['dsInfo'].get('hsaVersion', 0) == 2: return self.account.devices后边的验证安全码的接口地址变了,调这个地址/validateVerificationCode也会出现域名错误, 抓包后改成 idmsa.apple.com 地址后会报403错误,跟网页端对比了一下,应该是携带的请求header不全,暂时也没抓到请求idmsa的cookie header是在哪里设置的。也试了试直接改cookie文件,直接把网页抓到的cookie替换到/config/appleid这个文件里,也是不起作用,因为icloud_photos_downloader程序启动后,会自动执行一次登录,然后把文件里面的cookie又给替换成新登录的cookie了。accountservice.p00.prod.me.com``accountservice.p00.prod.me.com

是的,最近我尝试用go重写登录程序,也是卡在了securitycode这里,不知道是哪个header没设置对

大佬,这个问题可以解决吗?

看有人解决了这个问题,估计得找人重新打docker镜像icloud-photos-downloader/icloud_photos_downloader#492 (comment)

https://github.com/Haoke98/icloud-killer

大佬,解决办法我进去看的云里雾里。能给你具体解决办法吗 https://github.com/Haoke98/icloud-killer该如何使用呢