From 602ef0fbf5e14d1ae583742de4e36cef55082866 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Tue, 31 Jul 2018 01:16:56 +0700 Subject: [PATCH] Allow client_id to be overridden in __init__ (for replayable HTTP requests in pyvcr tests) --- pyicloud/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyicloud/base.py b/pyicloud/base.py index 0ad84e5..81d7707 100644 --- a/pyicloud/base.py +++ b/pyicloud/base.py @@ -134,13 +134,14 @@ class PyiCloudService(object): """ def __init__( - self, apple_id, password=None, cookie_directory=None, verify=True + self, apple_id, password=None, cookie_directory=None, verify=True, + client_id=None ): if password is None: password = get_password_from_keyring(apple_id) self.data = {} - self.client_id = str(uuid.uuid1()).upper() + self.client_id = client_id or str(uuid.uuid1()).upper() self.user = {'apple_id': apple_id, 'password': password} self._password_filter = PyiCloudPasswordFilter(password)