Szwendacz99 / BookStack-Python-exporter

Customizable script for exporting notes from BookStack through API. Export Pages, Chapters, Books, attachments and images.
MIT License
22 stars 3 forks source link

Export Attachments #4

Open hqsone opened 6 months ago

hqsone commented 6 months ago

Is it possible to export attachments?

Szwendacz99 commented 6 months ago

Currently script does not export attachments. BookStack API gives such possibility, so I think I might make that working as soon as I find time. Currently my idea is to create folder named like __attachments__ next to page to which it was attached, and put them there. But then handling export at multiple levels (pages,chapters,books) could be tricky. I could just make separate folder for only attachments and put all of them there, at their proper paths. If you have suggestions on how that should be handled, you can present them.

Szwendacz99 commented 6 months ago

Attachments are now exported by default. If any suggestions/problems arise, feel free to reopen the issue.

dirks commented 6 months ago

Just in case someone else hits the same problem. In our bookstack we have an attachment linked to a protected resource. The change to export attachments by default thus resulted in a urllib.error.HTTPError: HTTP Error 401: Unauthorized. For me the new flag --dont-export-external-attachments is sufficient to resolve the problem. Thanks for the update. :)

hqsone commented 6 months ago

Thank you for your work! Can links attachments be exported to a text file, maybe something like CSV. For example: Link name; link value

Szwendacz99 commented 6 months ago

They could be, and probably this would be good in case of protected resources, so I might look into that.