From 7f56449593445a27b5378f9e3ffdbcdad3b464b7 Mon Sep 17 00:00:00 2001 From: chrisaga Date: Fri, 6 Sep 2024 13:24:24 +0200 Subject: [PATCH] content['formatVersion'] didn't exist in old reMarkable files --- rm_tools/rmtool.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rm_tools/rmtool.py b/rm_tools/rmtool.py index 51b202f..bb8826b 100755 --- a/rm_tools/rmtool.py +++ b/rm_tools/rmtool.py @@ -211,9 +211,14 @@ def convert_file(infile, outfile, rootdir, width, height, debug): pagepdf_list = [] # get page list - if content['formatVersion'] == 1: + try: + formatVersion = content['formatVersion'] + except KeyError: + formatVersion = 1 + + if formatVersion == 1: page_uuid_list = content['pages'] - elif content['formatVersion'] == 2: + elif formatVersion == 2: page_uuid_list = [page['id'] for page in content['cPages']['pages'] if 'deleted' not in page] for page_uuid in page_uuid_list: