Skip to content

Commit

Permalink
Added Tachiyomi backup converter
Browse files Browse the repository at this point in the history
Added Tachiyomi backup converter. .proto to .json
  • Loading branch information
ThePromidius authored Mar 2, 2022
2 parents 3201975 + aa0fbb9 commit 4dcfc9a
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import json
from os import path

from google.protobuf.json_format import MessageToJson

import tachiyomi_pb2

ScriptDir = path.dirname(__file__)
output_fileName = 'data.json'
backup_path = input("Write the path to your .proto backup file\n>")

with open(backup_path, 'rb') as f:
read_metric = tachiyomi_pb2.Backup()
read_metric.ParseFromString(f.read())

json_str = MessageToJson(read_metric)
json_obj = json.loads(json_str)

with open(output_fileName, 'w', encoding='utf-8') as f:
json.dump(json_obj, f, ensure_ascii=False, indent=4)

print(f"Saved to {ScriptDir}/{output_fileName}")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
protobuf
90 changes: 90 additions & 0 deletions MangaManager/ConvertersLib/TachiyomiProto2Json/tachiyomi_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4dcfc9a

Please sign in to comment.