trevorhobenshield / amazon_photos

Amazon Photos API
https://pypi.org/project/amazon_photos
MIT License
44 stars 6 forks source link

Its probably my fault. #7

Closed FinnAbrahamson closed 5 months ago

FinnAbrahamson commented 6 months ago

I might just be an idiot: I'm pulling my cookies from mozilla's sqlight db. The amazon cookies I see there are named: 'session-id', 'ubid-main', and 'at-main'. I'm assigning values to my dictionary file as such; but I keep getting the following error:

File C:\ProgramData\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File c:\users\absol\untitled0.py:13 ap = AmazonPhotos(

File ~\AppData\Roaming\Python\Python311\site-packages\amazon_photos_api.py:82 in init self.root = self.get_root()

File ~\AppData\Roaming\Python\Python311\site-packages\amazon_photos_api.py:907 in get_root root = r.json()['data'][0]

AttributeError: 'NoneType' object has no attribute 'json'

I'm assuming I am doing the whole cookie thing wrong, but might need someone to spell it out for me. On another note: I provide a service to incarcerated individuals, where I curate photos and have them printed and mailed to them through the Amazon Photos platform, but I currently have to manually enter their orders in. I keep a database of the photos locally, and have the entire catalog uploaded to Amazon Photos. It would be AWESOME if there was a way to use this API to assemble photo orders and printing projects programmatically.

Sorry if this is all just a waste of your time, and thank you sooo much for the work you are doing!

marketviable commented 5 months ago

Not your fault - I had the same issues.... had to rename the cookies in the code to fix it. I added a pull request that should work for you (keep the "main" names in your cookie IDs)

8

FinnAbrahamson commented 5 months ago

Thank you sooo much!

On Thu, Jan 4, 2024, 9:04 AM marketviable @.***> wrote:

Not your fault - I had the same issues.... had to rename the cookies in the code to fix it. I added a pull request that should work for you (keep the "main" names in your cookie IDs)

8 https://github.com/trevorhobenshield/amazon_photos/pull/8

— Reply to this email directly, view it on GitHub https://github.com/trevorhobenshield/amazon_photos/issues/7#issuecomment-1877350822, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDOWEX6DKIJMBGTRROD6HPLYM3HHJAVCNFSM6AAAAABBBXESS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXGM2TAOBSGI . You are receiving this because you authored the thread.Message ID: @.***>

trevorhobenshield commented 5 months ago

Thanks for catching this @marketviable. I can't merge your PR because I'm dropping the env var option as it will potentially raise the same issue in the future. Users will now copy, at minimum, the essential session-id and ubid/at variants alongside any other special cookies that may be required in certain countries.