jya-dev / supernote-tool

Unofficial python tool for Supernote
Apache License 2.0
237 stars 25 forks source link

unsupported file format #33

Closed cwhittl closed 7 months ago

cwhittl commented 7 months ago

Looks like they changed something with the upgrade to Chauvet 2.12.28_beta When I run the code below (or try to convert to PDF) I get this stack trace

Any help would be awesome! C:\Users\jumper\AppData\Roaming\Python\Python312\Scripts\supernote-tool.exe analyze "D:\20230525_165407.note" Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\jumper\AppData\Roaming\Python\Python312\Scripts\supernote-tool.exe\__main__.py", line 7, in <module> File "C:\Users\jumper\AppData\Roaming\Python\Python312\site-packages\supernotelib\cmds\supernote_tool.py", line 203, in main args.handler(args) File "C:\Users\jumper\AppData\Roaming\Python\Python312\site-packages\supernotelib\cmds\supernote_tool.py", line 49, in subcommand_analyze metadata = sn.parse_metadata(f, policy=args.policy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jumper\AppData\Roaming\Python\Python312\site-packages\supernotelib\parser.py", line 62, in parse_metadata raise exceptions.UnsupportedFileFormat('unsupported file format') supernotelib.exceptions.UnsupportedFileFormat: unsupported file format

jya-dev commented 7 months ago

I'm not a beta user so I can't confirm, but adding an option --policy=loose may work around that issue. The option allows parser try to parse for files with unknown signature.

Example:

supernote-tool convert --policy=loose -a -type pdf file.note out.pdf

I have gotten a A6X2 Nomad and started to analyze the latest file format Chauvet 3.14.27. There are some changes so I need to modify my code to support it. I believe that A6X (& A5X) and A6X2 will receive common updates, so once support for A6X2 is complete, I think it will naturally be possible to support the next update for A6X.

cwhittl commented 7 months ago

I just added this and it seems to work, will let you know for sure. Thanks!

cwhittl commented 7 months ago

It worked, thanks!