vzhd1701 / enex2notion

Import Evernote ENEX files to Notion
MIT License
424 stars 35 forks source link

[Feature request]: Export note hash to verbose log as a means of skipping a not on the fly #93

Closed ShrimpyChips closed 1 year ago

ShrimpyChips commented 1 year ago

Suggestion

I have been upload a large notebook and I got one note that keeps causing the same import error. The problem is in order to skip this note I have to go back to Evernote, trim out all the ones that successfully uploaded, delete the failing note (or manually import as it were) and then re export the rest of the notebook again. I've got a bunch of large notebooks to do and this could be tedious if there are errors about.

So I noticed that the done file function just exports what seems to be a hash for each note uploaded. Is there a way to print that hash to the verbose log so that if I want to skip a note all I have to do is manually add it to the done file?

vzhd1701 commented 1 year ago

What import error are you getting?

ShrimpyChips commented 1 year ago

Here is what I get:

Network error: 413 Client Error: Payload Too Large for url: https://www.notion.so/api/v3/submitTransaction

Then it retries a number of times, then you get this:

Traceback (most recent call last): File "enex2notion\enex_uploader.py", line 28, in upload_note File "enex2notion\enex_uploader_block.py", line 10, in upload_block File "notion\block.py", line 141, in add_new File "notion\client.py", line 469, in exit File "notion\client.py", line 323, in submit_transaction File "ratelimit\decorators.py", line 113, in wrapper File "ratelimit\decorators.py", line 80, in wrapper File "notion\client.py", line 275, in post File "notion\client.py", line 298, in _post File "requests\models.py", line 1021, in raise_for_status requests.exceptions.HTTPError: 413 Client Error: Payload Too Large for url: https://www.notion.so/api/v3/submitTransaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "enex2notion__main.py", line 4, in File "enex2notion\cli.py", line 47, in main File "enex2notion\cli.py", line 32, in cli File "enex2notion\cli.py", line 42, in _process_input File "enex2notion\cli_upload.py", line 56, in upload_notebook File "enex2notion\cli_upload.py", line 79, in upload_note File "enex2notion\cli_upload.py", line 103, in _upload_note File "enex2notion\enex_uploader.py", line 35, in upload_note enex2notion.utils_exceptions.NoteUploadFailException [16124] Failed to execute script 'main__' due to unhandled exception!

ShrimpyChips commented 1 year ago

Also, the file isn't actually large. It's a web clip. When exported by itself as an ENEX it's only 354kb.

It seems to have linked images that either don't exist or that for whatever reason it shows as broken image links., I've noticed that that seems to cause the same error for a number of web clips.

Export flat patterns from SOLIDWORKS part or assembly components.txt

Here is the ENEX for that one note as a TXT (github wont allow ENEX as an attachment)

vzhd1701 commented 1 year ago

This should be fixed now. I also added --skip-failed option to avoid crashes when upload error occurs. You can use --log option to keep track of failed notes.