psobot / keynote-parser

A packer/unpacker for Apple Keynote presentation files.
158 stars 17 forks source link

Please add support for Keynote 12.1 (7034.0.86, 1A95) #39

Closed SheetJSDev closed 2 years ago

SheetJSDev commented 2 years ago

From a blank workbook with the default template, Index/DocumentStylesheet.iwa fails to parse with message

NotImplementedError: Don't know how to parse Protobuf message type 26
gaitskell commented 2 years ago

Ditto - please add support for Keynote 12.1 (this is not a blank file) NotImplementedError: Don't know how to parse Protobuf message type 6383 Thank you so much

gaitskell commented 2 years ago

What can we do to help with additional information you would require in order to patch the code? I cannot workout what the specific protobuf message types mean - what is a type 26 or a type 6383?

SheetJSDev commented 2 years ago

There are some instructions in https://github.com/psobot/keynote-parser#updates . They should theoretically work since @masaccio has a similar setup for https://github.com/masaccio/numbers-parser/

The referenced types are defined in https://github.com/psobot/keynote-parser/blob/master/keynote_parser/mapping.py#L70 . Under the hood, the file has a series of records with a record type and corresponding data. keynote-parser errors when it sees fields that are not known in advance. It may not be a bad idea to add a mode that skips unrecognized fields.

gaitskell commented 2 years ago

Thank you - that is very helpful - I will see if I can re-make the protobuf code for keynote-parser as described in more detail in the numbers-parser readme. (I couldn't find the "dumper" directory mentioned in the readme for keynote-parser. It may be because I am working on Apple Silicon MacOS.) I am also trying to work inside a venv rather than using my system-wide homebrew so I need to change instructions some.

An option to skip unrecognized fields would be useful in read-only, however, in my case I am trying to alter the content of some of the slides and then reassemble the entire Keynote file, so I don't want to leave any content out.