Last active
October 30, 2023 09:50
-
-
Save evernotegists/73179425cbfc60e3de98 to your computer and use it in GitHub Desktop.
Thumbnail post request in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
ACCESS_TOKEN="INSERT YOUR AUTH TOKEN OR DEV TOKEN HERE" | |
payload={'auth':ACCESS_TOKEN} #map auth token to param "auth" | |
r=requests.post('https://www.evernote.com//shard/s1/thm/note/e679c090-d8b2-4644-9eag-56bd31c84bf7.jpg?size=75',data=payload, stream=True) #returns a binary of the picture type in header | |
f=open('thumbnail.jpg','wb') #open file for binary writing | |
f.write(r.content) #write binary contents of request to a file | |
f.close() #close the file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment