Вот мой код:
import json


def process_json(file_path):
    with open(file_path, "r", encoding="utf-8") as file:
        data = json.load(file)
    result = []

    def traverse(obj):
        if isinstance(obj, dict):
            for key, value in obj.items():
                if key == "value":
                    result.append(value)
                    result.append(
                        ""
                    )  # Добавляем пустую строку между значениями 'value' и 'text'
                if key == "sections":
                    # Обработка списка sections
                    for section in value:
                        if "json" in section and section["type"] == "text":
                            combined_text = ""
                            for json_obj in section["json"]:
                                if "text" in json_obj:
                                    combined_text += json_obj["text"]
                            result.append(combined_text)
                            result.append(
                                ""
                            )  # Добавляем пустую строку после объединенного текста
                traverse(value)
        elif isinstance(obj, list):
            for item in obj:
                traverse(item)

    for key in data:
        traverse(data[key])
    # Удаляем последнюю добавленную пустую строку, чтобы избежать лишней пустой строки в конце
    if result and result[-1] == "":
        result.pop()
    return result


def main():
    file_path = r"C:\Users\Rushan\Documents\GitHub\Minecraft-Mods-Russian-Translation\1.20\to_translate\Mana and Artifice 3.0.0.15\mna\guide\en_us.json"  # Замените на путь к вашему JSON-файлу
    result = process_json(file_path)
    for line in result:
        print(line)


if __name__ == "main":
    main()

Почему он не запускается?

Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>>
>>>
>>> def process_json(file_path):
...     with open(file_path, "r", encoding="utf-8") as file:
...         data = json.load(file)
...     result = []
...
>>>     def traverse(obj):
  File "<stdin>", line 1
    def traverse(obj):
IndentationError: unexpected indent
>>>         if isinstance(obj, dict):
  File "<stdin>", line 1
    if isinstance(obj, dict):
IndentationError: unexpected indent
>>>             for key, value in obj.items():
  File "<stdin>", line 1
    for key, value in obj.items():
IndentationError: unexpected indent
>>>                 if key == "value":
  File "<stdin>", line 1
    if key == "value":
IndentationError: unexpected indent
>>>                     result.append(value)
  File "<stdin>", line 1
    result.append(value)
IndentationError: unexpected indent
>>>                     result.append(
  File "<stdin>", line 1
    result.append(
IndentationError: unexpected indent
>>>                         ""
  File "<stdin>", line 1
    ""
IndentationError: unexpected indent
>>>                     )  # Добавляем пустую строку между значениями 'value' и 'text'
  File "<stdin>", line 1
    )  # Добавляем пустую строку между значениями 'value' и 'text'
IndentationError: unexpected indent
>>>                 if key == "sections":
  File "<stdin>", line 1
    if key == "sections":
IndentationError: unexpected indent
>>>                     # Обработка списка sections
>>>                     for section in value:
  File "<stdin>", line 1
    for section in value:
IndentationError: unexpected indent
>>>                         if "json" in section and section["type"] == "text":
  File "<stdin>", line 1
    if "json" in section and section["type"] == "text":
IndentationError: unexpected indent
>>>                             combined_text = ""
  File "<stdin>", line 1
    combined_text = ""
IndentationError: unexpected indent
>>>                             for json_obj in section["json"]:
  File "<stdin>", line 1
    for json_obj in section["json"]:
IndentationError: unexpected indent
>>>                                 if "text" in json_obj:
  File "<stdin>", line 1
    if "text" in json_obj:
IndentationError: unexpected indent
>>>                                     combined_text += json_obj["text"]
  File "<stdin>", line 1
    combined_text += json_obj["text"]
IndentationError: unexpected indent
>>>                             result.append(combined_text)
  File "<stdin>", line 1
    result.append(combined_text)
IndentationError: unexpected indent
>>>                             result.append(
  File "<stdin>", line 1
    result.append(
IndentationError: unexpected indent
>>>                                 ""
  File "<stdin>", line 1
    ""
IndentationError: unexpected indent
>>>                             )  # Добавляем пустую строку после объединенного текста
  File "<stdin>", line 1
    )  # Добавляем пустую строку после объединенного текста
IndentationError: unexpected indent
>>>                 traverse(value)
  File "<stdin>", line 1
    traverse(value)
IndentationError: unexpected indent
>>>         elif isinstance(obj, list):
  File "<stdin>", line 1
    elif isinstance(obj, list):
IndentationError: unexpected indent
>>>             for item in obj:
  File "<stdin>", line 1
    for item in obj:
IndentationError: unexpected indent
>>>                 traverse(item)
  File "<stdin>", line 1
    traverse(item)
IndentationError: unexpected indent
>>>
>>>     for key in data:
  File "<stdin>", line 1
    for key in data:
IndentationError: unexpected indent
>>>         traverse(data[key])
  File "<stdin>", line 1
    traverse(data[key])
IndentationError: unexpected indent
>>>     # Удаляем последнюю добавленную пустую строку, чтобы избежать лишней пустой строки в конце
>>>     if result and result[-1] == "":
  File "<stdin>", line 1
    if result and result[-1] == "":
IndentationError: unexpected indent
>>>         result.pop()
  File "<stdin>", line 1
    result.pop()
IndentationError: unexpected indent
>>>     return result
  File "<stdin>", line 1
    return result
IndentationError: unexpected indent
>>>
>>>
>>> def main():
...     file_path = r"C:\Users\Rushan\Documents\GitHub\Minecraft-Mods-Russian-Translation\1.20\to_translate\Mana and Artifice 3.0.0.15\mna\guide\en_us.json"  # Замените на путь к вашему JSON-файлу
...     result = process_json(file_path)
...     for line in result:
...         print(line)
...
>>>
>>> if __name__ == "main":
...     main()
...
>>>