Skip to content

Commit

Permalink
Move endpoints of Chinese iCloud account to icloud.com.cn
Browse files Browse the repository at this point in the history
  • Loading branch information
WestXu committed Jun 11, 2022
1 parent 332cc9f commit ac0e579
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyicloud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
from requests import Session
from tempfile import gettempdir
from os import path, mkdir
from os import environ, path, mkdir
from re import match
import http.cookiejar as cookielib
import getpass
Expand Down Expand Up @@ -201,8 +201,10 @@ class PyiCloudService:
"""

AUTH_ENDPOINT = "https://idmsa.apple.com/appleauth/auth"
HOME_ENDPOINT = "https://www.icloud.com"
SETUP_ENDPOINT = "https://setup.icloud.com/setup/ws/1"

icloud_china = environ.get("icloud_china", "1") == "1"
HOME_ENDPOINT = f"https://www.icloud.com{icloud_china * '.cn'}"
SETUP_ENDPOINT = f"https://setup.icloud.com{icloud_china * '.cn'}/setup/ws/1"

def __init__(
self,
Expand Down

0 comments on commit ac0e579

Please sign in to comment.