|
Download COMMANDS.md from luci18/animebot: direct link, hf CLI and curl.
- Browser
- Download file 5.89 kB
-
https://huggingface.co/luci18/animebot/resolve/main/COMMANDS.md
- Command line
-
hf download hf://luci18/animebot/COMMANDS.md
-
curl -L -o COMMANDS.md https://huggingface.co/luci18/animebot/resolve/main/COMMANDS.md
5.89 kB
| # Anime Encoder Bot - Commands & Features | |
| ## π All Available Commands | |
| ### π¬ Basic Commands | |
| | Command | Usage | Description | | |
| |---------|-------|-------------| | |
| | `/start` | `/start` | Start the bot with menu buttons | | |
| | `/help` | `/help` | Show help message | | |
| | `/sites` | `/sites` | List available anime sites | | |
| ### π Search & Download | |
| | Command | Usage | Description | | |
| |---------|-------|-------------| | |
| | `/anime` | `/anime <query>` | Search all anime sites | | |
| | `/anime` | `/anime <query> <site>` | Search specific site (e.g., `/anime naruto gogoanime`) | | |
| | `/download` | `/download <url> <ep>` | Download specific episode | | |
| | `/ddl` | `/ddl <url>` | Download from direct URL | | |
| ### ποΈ Video Encoding | |
| | Command | Usage | Description | | |
| |---------|-------|-------------| | |
| | `/encode` | Reply to video + `/encode` | Encode a video with user settings | | |
| | `/batchencode` | Reply to video + `/batchencode` | Batch encode multiple videos | | |
| | `/thumb` | Reply to video + `/thumb` | Generate custom thumbnail | | |
| ### βοΈ Settings & Stats | |
| | Command | Usage | Description | | |
| |---------|-------|-------------| | |
| | `/settings` | `/settings` | Configure encoding, renaming, thumbnail preferences | | |
| | `/status` | `/status` | View queue status | | |
| | `/mystats` | `/mystats` | View your personal statistics | | |
| | `/stats` | `/stats` | Admin statistics (admin only) | | |
| ## ποΈ Settings Customization (via `/settings`) | |
| ### Video Encoding Settings | |
| - **Video Codec**: H.264 (libx264) or H.265/HEVC (libx265) | |
| - **CRF Quality**: 16-35 (lower = better quality) | |
| - **Speed Preset**: ultrafast to veryslow | |
| - **Resolution**: original, 1080p, 720p, 480p, 360p | |
| - **Audio Codec**: AAC, AC3, Opus, MP3 | |
| - **Audio Bitrate**: 96k-320k | |
| ### πΌοΈ Thumbnail Settings | |
| Users can customize: | |
| 1. **Resolution**: 1080p, 720p, 480p, 360p, 240p, 180p | |
| 2. **Position**: 10%, 25%, 50%, 75%, 90% (where in video to capture) | |
| 3. **Format**: JPG or PNG | |
| 4. **Caption Template**: Custom text with variables: | |
| - `{filename}` - Video filename | |
| - `{resolution}` - Thumbnail resolution | |
| - `{position}` - Timestamp position | |
| ### π Rename Settings | |
| - **Auto Rename**: Toggle on/off | |
| - **Pattern Template**: Choose from presets or custom: | |
| - `simple`: `{title} - Ep{episode}` | |
| - `detailed`: `{title} - S{season}E{episode} [{quality}]` | |
| - `with_codec`: `{title} - Ep{episode} [{quality}] [{codec}]` | |
| - `with_site`: `[{source_site}] {title} - Ep{episode} [{quality}]` | |
| - `anime_style`: `[{studio}] {title} - {episode} [{quality}]` | |
| ### Video Caption Template | |
| Default: `π¬ {filename}\nπ {resolution} | β±οΈ {duration} | πΎ {size}` | |
| Available variables: | |
| - `{filename}` - Video filename | |
| - `{resolution}` - Video resolution (e.g., 1920x1080) | |
| - `{duration}` - Video duration | |
| - `{size}` - File size | |
| - `{codec}` - Video codec | |
| ## π Web Admin Panel | |
| Access at `http://localhost:5000` after running: | |
| ```bash | |
| python web_panel.py | |
| ``` | |
| **Default Login:** | |
| - Username: `admin` | |
| - Password: `admin` (β οΈ change in production!) | |
| **Panel Features:** | |
| - π Dashboard with real-time stats | |
| - π₯ User management | |
| - π Task monitoring | |
| - π Leaderboard view | |
| - βοΈ Settings control | |
| ## π§ Known Issues to Fix | |
| ### 1. **Import Error in queue.py** | |
| Make sure `from config import Config` is at the top of `bot/queue.py` | |
| ### 2. **Missing UUID import in handlers.py** | |
| Should have `import uuid` at the top | |
| ### 3. **Missing imports in renamer.py** | |
| Needs `from config import Config` | |
| ### 4. **Flask missing in requirements.txt** | |
| Add: | |
| ``` | |
| flask>=2.3.0 | |
| werkzeug>=2.3.0 | |
| ``` | |
| ### 5. **Web Panel Environment Variables** | |
| Add to `.env`: | |
| ``` | |
| ADMIN_USERNAME=admin | |
| ADMIN_PASSWORD_HASH=<bcrypt_hash> | |
| FLASK_SECRET_KEY=your-secret-key | |
| ``` | |
| ## π Quick Setup Checklist | |
| 1. **Install dependencies:** | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 2. **Configure environment:** | |
| ```bash | |
| cp .env.example .env | |
| # Edit .env with your credentials | |
| ``` | |
| 3. **Run the bot:** | |
| ```bash | |
| python -m bot.main | |
| ``` | |
| 4. **Run web panel (optional):** | |
| ```bash | |
| python web_panel.py | |
| ``` | |
| ## π Project Structure | |
| ``` | |
| windsurf-project/ | |
| βββ bot/ | |
| β βββ __init__.py | |
| β βββ database.py # MongoDB operations | |
| β βββ downloader.py # Anime downloading | |
| β βββ encoder.py # FFmpeg encoding | |
| β βββ handlers.py # Telegram handlers | |
| β βββ main.py # Bot entry point | |
| β βββ queue.py # Task queue system | |
| β βββ renamer.py # File renaming | |
| β βββ sites.py # Anime site configs | |
| β βββ stats.py # Statistics module | |
| β βββ thumbnail.py # Thumbnail generation | |
| βββ config.py # Configuration | |
| βββ web_panel.py # Web admin panel | |
| βββ requirements.txt # Dependencies | |
| βββ Dockerfile # Docker image | |
| βββ docker-compose.yml # Docker orchestration | |
| βββ README.md # Documentation | |
| ``` | |
| ## π Troubleshooting | |
| **Bot not starting?** | |
| - Check `.env` has all required variables | |
| - Ensure MongoDB is running | |
| - Verify FFmpeg is installed: `ffmpeg -version` | |
| **Downloads failing?** | |
| - Check `animdl` is installed: `animdl --version` | |
| - Verify download directories exist and are writable | |
| **Web panel not accessible?** | |
| - Check port 5000 is not in use | |
| - Verify Flask is installed | |
| - Check firewall settings | |
| ## π Environment Variables | |
| Required: | |
| ```env | |
| API_ID=your_api_id | |
| API_HASH=your_api_hash | |
| BOT_TOKEN=your_bot_token | |
| OWNER_ID=your_telegram_id | |
| MONGO_URI=mongodb://localhost:27017/anime_encoder_bot | |
| ``` | |
| Optional: | |
| ```env | |
| # Web Panel | |
| ADMIN_USERNAME=admin | |
| ADMIN_PASSWORD_HASH=<bcrypt_hash> | |
| FLASK_SECRET_KEY=secret | |
| # Defaults | |
| DEFAULT_CRF=28 | |
| DEFAULT_PRESET=medium | |
| DEFAULT_CODEC=libx264 | |
| DEFAULT_RENAME_PATTERN={title} - Ep{episode} [{quality}] | |
| # Queue limits | |
| MAX_CONCURRENT_DOWNLOADS=2 | |
| MAX_CONCURRENT_ENCODINGS=1 | |
| ``` | |