Closed marktop closed 5 months ago
Your cookies have likely expired. ap.usage()
probably worked because it's read-only, but as soon as you perform any action that modifies state (upload, download, trash, etc.) Amazon may expire those cookies sooner, at least that's what I've noticed.
You can try logging out, logging back in, then copying the new cookies and trying again.
Hi Trevor, thank for your quick support!
Unfortunately no, I had already tried that - here again a log with fresh cookies: (ap.usage() - ap.delete(node_ids) - ap.upload('...') - delete worked, the upload didn't work again)
Are more cookies needed after all?
python3 test.py
type billable_bytes billable_count total_bytes total_count
0 doc 0 0 0 0
1 other 0 0 0 0
2 photo 0 0 35543 1
3 video 0 0 0 0
Permanently deleting files: 100%|████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 5.53it/s]
Checking for duplicate files: 100%|██████████████████████████████████████████████████| 29/29 [00:00<00:00, 4776.36it/s]
2024-01-13 09:26:11.281 [INFO] :: 0 Duplicate files found
2024-01-13 09:26:11.282 [INFO] :: 29 Unique files found
Uploading files: 0%| | 0/29 [00:00<?, ?it/s]
2024-01-13 09:26:12.253 [ERROR] :: 401 {"logref":"4c1020d0-58a9-4797-a72a-6154194846ef","message":"No Auth Method Provided","code":""}
I don't actually see any cookies in
https://content-eu.drive.amazonaws.com/v2/upload?...
Instead a header X-Amz-Access-Token
!
It should be fixed now, let me know if there are any other issues.
The problem was that I had hard-coded that upload URL to the default na
variant:
https://content-na.drive.amazonaws.com/cdproxy/nodes
.
I had the same problem with a french account, with the version 0.0.96 I had to replace eu line from determine_cdproxy to 'https://content-eu.drive.amazonaws.com/cdproxy/nodes' (always .com) to make it work, do you want a PR?
Interesting @OncleTif, thanks for noting this! Updates have been made, as of v0.0.97
everything should work as expected.
Alternatively, you can also use the override parameter if Amazon decides to change things again.
E.g.
ap = AmazonPhotos(
cookies={
...
},
db_path='ap.parquet',
dtype_backend='pyarrow',
engine='pyarrow',
cdproxy_override='https://content-eu.drive.amazonaws.com/cdproxy/nodes'
)
Great job, thanks for the quick adaption!
Works now:
Uploading files: 100%|█████████████████████████████████████████████████████████████████| 30/30 [00:12<00:00, 2.41it/s]
Have a nice Sunday!
Hi, using cookies ubid-acbde and at-acbde with session-id from amazon.de, I'm able to use ap.usage(), ap.query() and ap.delete(), but not ap-upload():
Many thanks having a look at this Mark