forked from sytelus/JSON-Messenger-Parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch_parser.py
More file actions
30 lines (25 loc) · 1006 Bytes
/
batch_parser.py
File metadata and controls
30 lines (25 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import subprocess
def run_parser():
# update these paths to match your own
base_input_dir = "../your_facebook_activity/messages"
stickers_dir = "../your_facebook_activity/messages/stickers_used"
base_output_dir = "../out"
main_exec = "./main.py"
# name of the owner of the messages
name = "User Name"
for subdir in ["archived_threads", "e2ee_cutover", "filtered_threads", "inbox"]:
input_dir = os.path.join(base_input_dir, subdir)
for item in os.listdir(input_dir):
item_path = os.path.join(input_dir, item)
if os.path.isdir(item_path):
output_file = f"{base_output_dir}/{subdir}_{item}.html"
subprocess.run([
"python3", main_exec,
"-i", f"{item_path}/",
"-n", name,
"-o", output_file,
"-s", f"{stickers_dir}/"
])
if __name__ == "__main__":
run_parser()