Python script for importing notes from Synology's Note Station into Joplin

Thank you @zerosandones for working your way through this. I'm now following your path. Looking at the GitHub repository, it seems the author has not worked on this since 02-Mar-2020, so none of your fixes have been applied. Anyway, I'm stuck at a new error.

I changed the import statement from:

from joplin_api import JoplinApi

to

from joplin_api import JoplinApiSync as JoplinApi

Then I changed the 3 occurrences of:

res = await some_function

to remove the await like this:

res = some_function

Now it gets through all my "Reading note" steps, and then it gets through 174/701 of my "Writing note" steps before failing:

Traceback (most recent call last):
  File "nsx2joplin.py", line 467, in <module>
    nsx.export_to_joplin(token=joplin_token, nsx_content=nsx_content)
  File "nsx2joplin.py", line 410, in export_to_joplin
    note["content"] = asyncio.run(
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "nsx2joplin.py", line 348, in create_resource
    res = joplin.create_resource(
  File "/home/david/.local/lib/python3.8/site-packages/joplin_api/core_sync.py", line 508, in create_resource
    return self.query('post', '/resources/', **data)
  File "/home/david/.local/lib/python3.8/site-packages/joplin_api/core_sync.py", line 123, in query
    res.raise_for_status()
  File "/home/david/.local/lib/python3.8/site-packages/httpx/_models.py", line 1108, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: 500 Server Error: Internal Server Error for url: http://127.0.0.1:41184/resources?token=5e9fa90fa40a75d5033b2dc4e8258e108b6a91a361c30a245cd587f5f8fe1456f03c2b08ddd49e50d85b6a6c8904b0f0c144b2b5b333174aa6c2b7405395cc61
For more information check: https://httpstatuses.com/500

I'm using Python 3.8.6.

Any idea what's causing this?