wrjlewis / notion-search-alfred-workflow

An Alfred workflow to search Notion with instant results
GNU General Public License v3.0
825 stars 41 forks source link

Here is an automatic way to at least get `notion_browser_id` and such from the cookies #27

Closed haakonstorm closed 3 years ago

haakonstorm commented 3 years ago
  1. Log in to Notion using Safari.
  2. Install binarycookies cli tool with go get github.com/cixtor/binarycookies/cmd/binarycookies
  3. Decode the resultant cookie and extract what we need binarycookies ~/Library/Cookies/Cookies.binarycookies|grep -i '.notion.so'|awk '{print $5, $6}'

The .binarycookie format is reverse engineered over at the repo mentioned above. It should be straight forward to programmatically extract the needed parts automatically. Then, either use some library to decode the embedded binary plist, or fork out to the shell and use the plutil or PListBuddy tools already bundled with macOS.

For the part where we need the spaceID (do we really need it? Is not the tokenv2 enough?) I'm now looking into using httpie and a https request with the output of the above.

wrjlewis commented 3 years ago

Thanks for sharing this! Though really we need the notion API (coming soon!) to circumvent having to do this at all.