-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Tachiyomi backup converter. .proto to .json
- Loading branch information
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
MangaManager/ConvertersLib/TachiyomiProto2Json/TachiyomiProto2Json.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") |
1 change: 1 addition & 0 deletions
1
MangaManager/ConvertersLib/TachiyomiProto2Json/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
protobuf |
90 changes: 90 additions & 0 deletions
90
MangaManager/ConvertersLib/TachiyomiProto2Json/tachiyomi_pb2.py
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.