alvinwan / notion2markdown

python export for notion pages to markdown
https://pypi.org/project/notion2markdown/
MIT License
16 stars 6 forks source link

Notion2markdown crashes with notion-client 2.2.1 #3

Open vbeutner opened 7 months ago

vbeutner commented 7 months ago

Stacktrace:

[2024-01-31T21:04:13.792Z] Traceback (most recent call last):
[2024-01-31T21:04:13.991Z]   File "/usr/local/lib/python3.11/site-packages/notion2markdown/__init__.py", line 14, in export_url
[2024-01-31T21:04:13.991Z]     self.downloader.download_url(url, json_dir)
[2024-01-31T21:04:13.992Z]   File "/usr/local/lib/python3.11/site-packages/notion2markdown/notion.py", line 24, in download_url
[2024-01-31T21:04:13.992Z]     self.download_page(page_id, out_dir / f"{page_id}.json")
[2024-01-31T21:04:13.992Z]   File "/usr/local/lib/python3.11/site-packages/notion2markdown/notion.py", line 32, in download_page
[2024-01-31T21:04:13.992Z]     blocks = self.notion.get_blocks(page_id)
[2024-01-31T21:04:13.992Z]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-01-31T21:04:13.992Z]   File "/usr/local/lib/python3.11/site-packages/notion2markdown/notion.py", line 107, in get_blocks
[2024-01-31T21:04:13.992Z]     list(self.get_blocks(child["id"])) if child["has_children"] else []
[2024-01-31T21:04:13.992Z]                                           ~~~~~^^^^^^^^^^^^^^^^
[2024-01-31T21:04:13.992Z] TypeError: string indices must be integers, not 'str'

Fixed this by downgrading notion-client to 2.0.0

winf-hsos commented 2 months ago

Worked for me. I wonder what doesn't work because of the downgrade. Any updates planned for this library?