pyicloud: Ubiquity key error dsid

The problem

print(api.files.dir()) throws a key error:

File “/Users/zimo/pyicloud/lib/python3.8/site-packages/pyicloud/services/ubiquity.py”, line 43, in getattr return getattr(self.root, attr) File “/Users/zimo/pyicloud/lib/python3.8/site-packages/pyicloud/services/ubiquity.py”, line 20, in root self._root = self.get_node(0) File “/Users/zimo/pyicloud/lib/python3.8/site-packages/pyicloud/services/ubiquity.py”, line 29, in get_node request = self.session.get(self.get_node_url(node_id)) File “/Users/zimo/pyicloud/lib/python3.8/site-packages/pyicloud/services/ubiquity.py”, line 25, in get_node_url return self._node_url % (self.params[“dsid”], variant, node_id) KeyError: ‘dsid’

Environment

  • pyiCloud release with the issue (pip show pyicloud): 0.10.2
  • Last working pyiCloud release (if known): -/-
  • Service causing this issue: Ubiquity
  • Python version (python -V): 3.8.2
  • Operating environment (project deps/Docker/Windows/etc.): Mac OS Big Sur 11.2.3

Traceback/Error logs


Checklist

  • I’ve looked informations into the README.
  • I’ve looked informations into the pyiCloud’s code.
  • I’ve looked informations in Google.

Additional information

Login and 2FA works fine, I can access iCloud Drive file info and device listing without errors. The error persists when I switch to python 3.9.4. Thanks a lot in advance for any help! Regards Thomas

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 8
  • Comments: 16

Most upvoted comments

For those looking for a quick fix, get the DSID of yourself from the family member list (api.account.family) and pass it to api.files’s UbiquityService:

api.files.params["dsid"] = api.account.family[0].dsid

Seeing this exact thing, key error. Setting the dsid from family list gets rid of the error, but gives a 503 instead as described. Sadness

Also getting 503 after manually setting dsid.

Has anyone managed to resolve this?

The same problem. Do you have any solutions? -Python V 3.9.5 -PyIcloud v 0.10.2

Maybe this will be helpful for people, though I started using the SimpleNote app for note collection and reading instead. There’s a Python API you can use for this.

The same problem occuring on Windows 10 too, returning KeyError: 'dsid' when trying to access api.files.dir(). Python version: 3.7.2 32-bit.

Any ideas on how to fix this?

Example code: https://pastebin.com/raw/Nxc11Xx5