# 📦 RedditVideoMakerBot — Project Init Documentation > **Version**: 3.4.0 > **Author gốc**: Lewis Menelaws & [TMRRW](https://tmrrwinc.ca) > **License**: GPL + Roboto Fonts (Apache 2.0) > **Python**: 3.10 / 3.11 / 3.12 --- ## 1. Tổng Quan RedditVideoMakerBot là một công cụ tự động hóa việc tạo video ngắn (TikTok/YouTube Shorts/Instagram Reels) từ các bài đăng trên Reddit. Bot sẽ: 1. **Lấy bài đăng** từ subreddit (qua Reddit API / PRAW) 2. **Chuyển text thành giọng nói** (TTS — 7 engine khác nhau) 3. **Chụp screenshot** bài đăng/comments bằng Playwright 4. **Tải & cắt video/audio nền** từ YouTube 5. **Ghép tất cả** thành video hoàn chỉnh bằng FFmpeg Kết quả cuối cùng: file `.mp4` trong thư mục `results//`. --- ## 2. Cấu Trúc Thư Mục ``` RedditVideoMakerBot/ ├── main.py # 🚀 Entry point chính ├── GUI.py # 🖥️ Web GUI (Flask, port 4000) ├── config.toml # ⚙️ File cấu hình (user-generated) ├── ptt.py # 🔊 Helper script để liệt kê system voices ├── requirements.txt # 📦 Python dependencies ├── Dockerfile # 🐳 Docker support (python:3.10-slim) ├── build.sh / run.sh / run.bat # 📜 Scripts chạy nhanh ├── install.sh # 📜 Auto-installer (Linux/macOS) │ ├── reddit/ # 📡 Module lấy dữ liệu từ Reddit │ └── subreddit.py # Đăng nhập Reddit, lấy threads & comments │ ├── TTS/ # 🗣️ Module Text-to-Speech (7 engines) │ ├── engine_wrapper.py # TTSEngine — wrapper chung cho tất cả TTS │ ├── TikTok.py # TikTok TTS API │ ├── aws_polly.py # AWS Polly (boto3) │ ├── elevenlabs.py # ElevenLabs API │ ├── openai_tts.py # OpenAI TTS API │ ├── GTTS.py # Google Translate TTS (gTTS) │ ├── pyttsx.py # pyttsx3 (offline, system voices) │ └── streamlabs_polly.py # Streamlabs Polly │ ├── video_creation/ # 🎬 Module tạo video │ ├── voices.py # Orchestrator — chọn TTS provider & chạy │ ├── screenshot_downloader.py # Chụp screenshot Reddit bằng Playwright │ ├── background.py # Tải & cắt background video/audio (yt-dlp) │ ├── final_video.py # Ghép tất cả thành video (FFmpeg pipeline) │ └── data/ # Cookie files + videos.json (tracking) │ ├── cookie-dark-mode.json │ ├── cookie-light-mode.json │ └── videos.json │ ├── utils/ # 🛠️ Utilities │ ├── settings.py # Đọc/validate config.toml theo template │ ├── .config.template.toml # Template cấu hình (định nghĩa tất cả fields) │ ├── console.py # Rich console helpers (print_step, handle_input...) │ ├── ai_methods.py # AI similarity sorting (sentence-transformers) │ ├── subreddit.py # Logic chọn post chưa làm + bộ lọc │ ├── voice.py # sanitize_text(), rate limit, sleep_until() │ ├── videos.py # check_done(), save_data() — tracking │ ├── cleanup.py # Xóa temp files │ ├── ffmpeg_install.py # Tự động cài FFmpeg nếu chưa có │ ├── imagenarator.py # Render ảnh cho storymode method 1 │ ├── thumbnail.py # Tạo thumbnail cho video │ ├── fonts.py # Font size helpers │ ├── id.py # extract_id() — sanitize reddit thread ID │ ├── posttextparser.py # Phân tách post text thành các đoạn │ ├── playwright.py # Helper clear cookies │ ├── version.py # Check version mới trên GitHub │ ├── gui_utils.py # Utils cho Flask GUI │ ├── background_videos.json # Danh sách background videos (YouTube URLs) │ └── background_audios.json # Danh sách background audios (YouTube URLs) │ ├── GUI/ # 🌐 Flask Templates (HTML) │ ├── layout.html # Base template │ ├── index.html # Trang chủ — danh sách videos đã tạo │ ├── settings.html # Trang cấu hình │ ├── backgrounds.html # Quản lý backgrounds │ └── voices/ # Voice sample files │ ├── fonts/ # 🔤 Roboto font files │ ├── Roboto-Regular.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-Black.ttf │ └── LICENSE.txt │ ├── assets/ # 🎨 Static assets │ ├── title_template.png # Template ảnh cho fancy thumbnail │ └── backgrounds/ # Downloaded background files (video/audio) │ ├── results/ # 📁 Output videos (auto-created) │ └── / │ ├──