picklepete / pyicloud

A Python + iCloud wrapper to access iPhone and Calendar data.
MIT License
2.49k stars 441 forks source link

api.files.dir() KeyError: 'item_list' #356

Open smanley opened 2 years ago

smanley commented 2 years ago

The problem

I am having issues with the api.files.dir() command. Other commands work OK per the tutorial, I am authenticated, api.drive works as expected and shows contents of files. I am trying to access Notes stored in icloud.

I got the dsid error first. I solved this per the issue here (333) by assigning it manually.

api.files.params['dsid'] = api.data['dsInfo']['dsid']

I am now getting this error:

api.files.dir() Traceback (most recent call last): File "", line 1, in File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/services/ubiquity.py", line 98, in dir return [child.name for child in self.get_children()] File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/services/ubiquity.py", line 93, in get_children self._children = self.connection.get_children(self.item_id) File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/services/ubiquity.py", line 35, in get_children items = request.json()["item_list"] KeyError: 'item_list'

Attempting to access the notes folder directly yields a 503 error:

api.files['com~apple~Notes'] Traceback (most recent call last): File "", line 1, in File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/services/ubiquity.py", line 46, in getitem return self.root[key] File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/services/ubiquity.py", line 20, in root self._root = self.get_node(0) File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/services/ubiquity.py", line 29, in get_node request = self.session.get(self.get_node_url(node_id)) File "/home/smanley/icloud/lib/python3.5/site-packages/requests/sessions.py", line 555, in get return self.request('GET', url, **kwargs) File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/base.py", line 130, in request self._raise_error(response.status_code, response.reason) File "/home/smanley/icloud/lib/python3.5/site-packages/pyicloud/base.py", line 186, in _raise_error raise api_error pyicloud.exceptions.PyiCloudAPIResponseException: Service Unavailable (503)

Environment

Python 3.5.3; pyicloud 10.2

Running on Debian 9.

Traceback/Error logs

Additional information

smankoo commented 2 months ago

I have the exact same problem. Were you ever able to resolve it?