mandarons / icloudpy

iCloud web service interface library in Python
Other
179 stars 17 forks source link

[BUG] KeyError: 'data_token' #1

Closed mandarons closed 2 years ago

mandarons commented 2 years ago

Describe the bug Failed to download /app/icloud/drive/<path>/<to>/<file>: 'data_token' error for some of .pages documents in drive. To Reproduce Steps to reproduce the behavior: api = ICloudPyService(username.strip(), password.strip()) drive = api.drive for i in api.drive.dir() item = drive[i] if item.type == "file": localfile = os.path.join('.', item.name) with item.open(stream=True) as response: with open(localfile, "wb") as file_out: copyfileobj(response.raw, file_out)

This produces a KeyError: 'data_token' before this patch when a packaged file like a Pages is attempted to be downloaded.

Expected behavior File should be downloaded without error.

Screenshots NA Configuration Default configuration.

Additional context From: https://github.com/mandarons/icloud-drive-docker/issues/11

mandarons commented 2 years ago

Resolved in release 0.2.1