trevorhobenshield / amazon_photos

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

Folders #1

Closed ryanshrott closed 6 months ago

ryanshrott commented 10 months ago

How can I upload to specific folders, and create them if they don't exist?

trevorhobenshield commented 6 months ago

Great question, If you want to upload to a specific directory you just need to copy the heirarchy:

Given an example Amazon Photos filesystem:

~ 
├── Documents 
├── Pictures 
│   ├── iPhone 
│   └── Web 
└── Videos 

On the website the default upload path is ~/Pictures/Web

If you also want to upload to ~/Pictures/Web you would create that directory structure locally, add your images in there, and then run:

ap.upload('Pictures/Web')

If you upload to directories that don't exist, it creates them, so:

ap.upload('hello/world')

results in:

~ 
├── hello 
│   └── world 
├── Documents 
├── Pictures 
│   ├── iPhone 
│   └── Web 
└── Videos