Install binarycookies cli tool with go get github.com/cixtor/binarycookies/cmd/binarycookies
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.
Safari
.binarycookies
cli tool withgo get github.com/cixtor/binarycookies/cmd/binarycookies
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 theplutil
orPListBuddy
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 usinghttpie
and ahttps
request with the output of the above.