Open Phantom-Cass opened 1 year ago
pytumblr can open file for you as in ReadMe
Just pass the filename instead of opening like client.create_photo('blog url', data=filename, tags=['photo', 'dump'])
Also, please use MarkDown properly next time: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks
Don't forget to read the docs.
Not a bug, just an error I can't find a fix for
import pytumblr import os
Authenticate via Tumblr API
client = pytumblr.TumblrRestClient( "client key", 'client secret', '0auth key', '0auth secret', )
Set the directory containing the photos to upload
photo_directory = 'folder/to/photos'
Iterate through the files in the directory
for filename in os.listdir(photo_directory): if filename.endswith('.JPG'):
Upload the photo to Tumblr
print("Did it.")