Cleaning up cookie handling to use a system-level temporary directory. Adding logger.
This commit is contained in:
parent
897f905855
commit
4daa34f310
1 changed files with 10 additions and 2 deletions
|
@ -1,9 +1,11 @@
|
|||
import uuid
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import pickle
|
||||
import requests
|
||||
import sys
|
||||
import pickle
|
||||
import tempfile
|
||||
import os
|
||||
from re import match
|
||||
|
||||
|
@ -16,6 +18,9 @@ from pyicloud.services import (
|
|||
)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PyiCloudService(object):
|
||||
"""
|
||||
A base authentication class for the iCloud service. Handles the
|
||||
|
@ -40,7 +45,10 @@ class PyiCloudService(object):
|
|||
self._base_system_url = '%s/system/version.json' % self._home_endpoint
|
||||
self._base_webauth_url = '%s/refreshWebAuth' % self._push_endpoint
|
||||
|
||||
self._cookie_directory = 'cookies'
|
||||
self._cookie_directory = os.path.join(
|
||||
tempfile.gettempdir(),
|
||||
'pyicloud',
|
||||
)
|
||||
|
||||
self.session = requests.Session()
|
||||
self.session.verify = False
|
||||
|
|
Loading…
Reference in a new issue