notion-py
notion-py copied to clipboard
Collection cover url can't be accessed.
Hi! Thanks for this awesome repo! I am accessing for my project the cover URL of an array of collections inside a page. If the cover I set is one that comes from the notion, the URL I get is downloadable, but if the image cover is a custom one, I do get the aws link to the image and it can't be accessed. Maybe somehow link needs to be signed with a token for credentials and security purposes or something? Thanks Cordially, Bruno
Update: Found something
cover = collection.cover
cover = urllib.parse.quote(cover)
cover = cover.replace("/","%2F")
url = "https://www.notion.so/image/{0}?table=collection&id={1}&width=300&userId={2}&cache=v2".format(cover,collection_id, self.client.current_user.id)
Will help you access the image. The width parameter can be changed to whatever you want I have been seeing! Hope this helps someone.
+1