Closed ryanshrott closed 7 months ago
Exactly the same here:
os.environ['SESSION_ID'] = "258..."
os.environ['UBID_ACDCA'] = "261..."
os.environ['AT_ACBCA'] = "Atza|I..."
ap = AmazonPhotos()
, it takes quite some time (est. 1 Minute) before it throws exactly the same error:
Traceback (most recent call last):
File "/Users/marichter/Desktop/amazon_photos/01/main.py", line 10, in <module>
ap = AmazonPhotos()
^^^^^^^^^^^^^^
File "/Users/marichter/.local/share/virtualenvs/01-k_hNu90A/lib/python3.11/site-packages/amazon_photos/api.py", line 70, in __init__
self.root, self.owner_id = self._get_root()
^^^^^^^^^^^^^^^^
File "/Users/marichter/.local/share/virtualenvs/01-k_hNu90A/lib/python3.11/site-packages/amazon_photos/api.py", line 466, in _get_root
data = r.json()
^^^^^^
AttributeError: 'NoneType' object has no attribute 'json'
My main.py
:
import os
from amazon_photos import AmazonPhotos
os.environ['SESSION_ID'] = "258..."
os.environ['UBID_ACDCA'] = "261..."
os.environ['AT_ACBCA'] = "Atza|Iw..."
ap = AmazonPhotos()
I guess this is related to #4 :
It seems that AP works in a way, depending on which country TLD you use to browse AP (https://www.amazon.de/photos, https://www.amazon.ch/photos, ...) the names of these variables also get a country shortcode suffix (AT_ACBCA -> CA -> Canada, AT_ACBIT -> IT -> Italy, AT_ACBDE -> DE -> Germany, ...).
This also makes the hardcoded amazon.ca
in api.py
questionable and eventually the drive API URL is also wrong if from Europe, for example: https://cdws.eu-west-1.amazonaws.com/drive/v2/memories/v1/collections/this_day_filtered
. Seems that Europe has it's own Base URL at https://cdws.eu-west-1.amazonaws.com
.
Thanks, nice catch. Just made the modifications.
I get this error on occasion
ap = AmazonPhotos()
File "/home/ryan/.local/lib/python3.10/site-packages/amazon_photos/api.py", line 70, in init
self.root, self.owner_id = self._get_root()
File "/home/ryan/.local/lib/python3.10/site-packages/amazon_photos/api.py", line 466, in _get_root
data = r.json()
AttributeError: 'NoneType' object has no attribute 'json'
ryan@ryan-MacBookPro:~/Documents$ python3 photos.py Traceback (most recent call last): File "/home/ryan/Documents/photos.py", line 28, in