-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting markdown fails #55
Comments
Sorry, no idea. I currently don't have time to investigate this so you're on your own. I'm guessing Be happy to merge a PR if you figure it out. As far as figuring it out: you can follow the same process as I did originally https://blog.kowalczyk.info/article/88aee8f43620471aa9dbcad28368174c/how-i-reverse-engineered-notion-api.html Basically: invoke the action from the browser and see what API calls the browser makes. Write a pupeeter script to record API calls for easier analysis. |
Unfortunately, that's exactly what I did (check the browser logs) and |
@tkrajina Did you resolve this problem? |
Found this alternative to Notion's undocumented Export to Markdown API kjkNotionApiClient := ¬ionapi.Client{
AuthToken: tokenV2CookieString,
}
childPage, err := kjkNotionApiClient.DownloadPage(childPageId)
if err != nil {
printErrorAndExit(err)
}
markdown := tomarkdown.NewConverter(childPage).ToMarkdown()
fmt.Println(string(markdown)) |
It case it helps anyone, I authored a Go package to export any Notion page to Markdown https://github.com/nisanthchunduru/notion2markdown It accepts a Notion integration token instead of Notion's token v2 cookie string |
Hi @kjk
We're using your excellent library for one reason -- it has the option of exporting pages with markdown. The official API has no markdown exporting.
Now, this used to work with your notionapi, but a few weeks ago they changed something on their backend and it now fails.
We're using
client.ExportPages()
which internall useenqueueTask
andgetTasks
and it then returns the download url.Example code to reproduce the problem:
...and it errors in
client.DownloadURL()
.We tried to inspect the browser to see why downloading the file there works, and this is the final "download file" request (stripped of all the other unneeded headers):
So, it looks like, they now require a
file_token
cookie withfile.notion.so
. It is not enough to have the download URL.Any idea how the
file_token
is retrieved/calculated?The text was updated successfully, but these errors were encountered: