⚠️ DISCLAIMER: This project is purely an experimental proof-of-concept. Utilizing YouTube for arbitrary data storage may violate their Terms of Service (ToS). Its use for such purposes is highly discouraged. This tool is intended for educational exploration of data encoding and video compression limits.
A toolset to encode any file into a video, upload it to YouTube, and later download and decode it back to the original file.
For a detailed technical explanation of the encoding process, block sizes, and how data survives video compression, see HOW_IT_WORKS.md.
- Encoder: Converts binary data into black-and-white pixel blocks in a video file.
- Multi-threaded: Optimized with NumPy and Python's
ProcessPoolExecutorfor high-speed encoding and decoding. - Adaptive Block Sizing: Automatically selects the best block size based on file size or detects it from video input.
- Error Correction: Integrated Reed-Solomon ECC to survive video compression artifacts.
- Uploader: Uses YouTube Data API v3 to upload the encoded video.
- Downloader: Uses
yt-dlpto retrieve the video from YouTube. - Decoder: Extracts the original binary data from the video frames with error recovery.
- Restorer: Automatically detects the file type and restores the original extension.
The project now features a unified CLI via main.py.
Convert a file into a video:
# Uses default block size (16) and all available CPU cores
python main.py encode input.zip output.mp4
# Uses adaptive block sizing and specific number of threads
python main.py encode input.zip output.mp4 --block-size 0 --threads 4Upload the video to YouTube:
python main.py upload output.mp4 --title "My Data Backup"Note: Requires client_secrets.json and one-time OAuth authorization.
Download your video (using yt-dlp):
yt-dlp https://www.youtube.com/watch?v=VIDEO_ID -o downloaded.mp4Extract the data from the video:
# Auto-detects block size if it was encoded with adaptive sizing
python main.py decode downloaded.mp4 retrieved.dat --block-size 0 --threads 8Restore the original file format:
python main.py restore retrieved.dat- Python 3.12+
- OpenCV (
opencv-python) - NumPy
- Google API Client Libraries
- yt-dlp