> **Use at your own risk.** This script has not been thoroughly tested. Always make sure you have a backup of your files before running it, especially with the `mv` (move) operation. The author takes no responsibility for any data loss or damage caused by the use of this script.
A command-line utility to restore files from a flat TeleDrive export dump back into their original folder hierarchy, using the metadata exported from TeleDrive as a `files.json` file.
## Requirements
- Python 3.6 or newer (no third-party packages required)
## Background
TeleDrive stores all uploaded files in Telegram as flat message attachments. When you export your data, you get:
1. A `files.json` metadata file describing every file and folder, including parent-child relationships.
2. A flat directory of downloaded files, all sitting in the same folder.
This script reads the metadata and reconstructs the full directory tree, placing every file in its correct folder.