--- title: testbot emoji: ๐ŸŽฌ colorFrom: red colorTo: yellow sdk: docker app_port: 7860 pinned: false --- # ๐Ÿ”ฅ ANGRY BIRD File Serve Bot (Premium Edition) ๐Ÿ”ฅ A premium, high-speed **Telegram File Search and Direct Browser Download** bot powered by **FastAPI**, **Pyrogram**, and **Neon PostgreSQL**. Designed for seamless 24/7 deployment on **HuggingFace Spaces** (Docker) and **Render**. --- ## ๐ŸŒŸ Core & Premium Features ### ๐Ÿ’Ž Premium High-Speed Streaming Gateway * **๐ŸŒ Direct Browser Streaming**: High-speed browser file downloading directly from Telegram CDNs using custom-engineered asynchronous chunk streaming. * **โšก Concurrency Optimized (100 Slots)**: Supports up to **100 simultaneous parallel downloads/streams** without any queuing or delay bottlenecks, utilizing `workers=100` parallel client connections. * **๐Ÿš€ Practically 0 MB Server Overhead**: Streams block-by-block using Pyrogram's `client.stream_media(...)` async generator, avoiding local file caching and RAM out-of-memory (OOM) failures entirely. * **๐Ÿ—‘๏ธ Auto-Clean Token Verification**: Automatically cleans up authorization alerts, expiry errors, and incoming user query messages after a 10-second delay, ensuring clean private chats. * **โ“ Dynamic Help & Guide Integrations**: Renders a dynamic administrative control setting button (`how_to_download` guide URL) across `/start` keyboards. ### ๐Ÿ” Advanced Database Search Engine * **๐Ÿ”ฅ Weekly Trending Tracker (`/trending`)**: Automatically monitors and tracks movie search query frequencies over a 7-day rolling cycle, presenting the top 10 most popular movies directly to users on start keyboards or inline buttons. * **๐Ÿ†• Newly Uploaded Monitor (`/newuploads`)**: Displays a real-time list of the 25 most recently indexed movies/files, making it easy for users to check recent releases instantly. * **๐Ÿ“ˆ Trigram pg_trgm Fuzzy Search**: Implements fuzzy title-matching leveraging PostgreSQL GIN trigram indexes to suggest and correct spelling mistakes. * **๐ŸŽฏ Precise Mode Search Option**: Toggleable precise-matching mode to target exact word hits or perform general query containing searches. * **๐Ÿ“ Multiple File Formats Supported**: Fully indexes and handles Documents, Video files, and Audio file formats with complete metadata logging. * **๐Ÿ”€ Multi-Format Result Output**: Dynamically outputs search query results in button layouts, list structures, or hyperlink lists. ### โš™๏ธ Channel Indexing & Operations * **๐Ÿ”„ Automated Live Indexing**: Real-time listening and automatic indexing of files uploaded directly to DB channels. * **๐Ÿ“ฆ Manual Indexing (`/index`)**: Forward-based administrative channel scanning to easily batch-import files into database records. Works based on original file captions to prevent duplicate quality skip issues! * **๐Ÿ—‘๏ธ Dynamic Database Deletion**: Quick inline administrative file deletions (`/delete`) directly inside chat threads. * **โณ Auto-Delete Schedule**: Automatic scheduled file purge settings to clear files after configured time thresholds. ### ๐Ÿงน Bulk Delete Mode * **Smart Bulk Deleting**: Standalone `/delete` command turns on a powerful state-based bulk delete mode. Forward multiple files at once, and the bot will automatically delete them all from the database, deactivated with `/done`. ### ๐Ÿ›ก๏ธ Administration & Controls * **๐Ÿ›ก๏ธ Multi-Channel Force Subscribe**: Blocks all search queries, keyboard commands, and downloads until users join all configured update channels. Supports a comma-separated list of public/private channels in settings. * **๐Ÿ”— Dynamic Invite Link Generation**: Automatically resolves usernames (even without `@` prefix) or creates private invite links for each configured channel dynamically. * * **๐Ÿ”„ Instant Resumption Handshake**: Saves blocked queries in the database and automatically executes them once the user joins and clicks "Try Again". If a token shortener is enabled, the query is passed seamlessly to the token system and executed automatically upon returning from the browser via `/start tok_xxxx`. * * **๐ŸŽ›๏ธ Spam & Double-Click Protection**: Instantly removes verification buttons when clicked to prevent duplicate execution, and edits prompt messages in-place with popup alerts to prevent user chat spam. * * **๐Ÿ“… Filename Release Years**: Automatically extracts movie release years from filenames (e.g. `1900-2030`) and appends them to search list buttons (e.g., `Odyssey (2026)`) for a cleaner UX. * **๐Ÿท๏ธ Custom File Captioning**: Setup custom headers/captions (like adding usernames or watermarks) to all dispatched files. * **โ›” Member Ban/Unban System**: Block unwanted users instantly using `/ban` and `/unban` command strings. * **๐Ÿ“ข Massive Broadcast system**: Send custom formatted alerts or messages globally to all registered bot users concurrently. * **๐Ÿ“Š Live Server Stats & Logs**: Get real-time stats and runtime log dumps directly inside the administrator's chat. --- ## ๐Ÿ“‚ Codebase & Setup For full instructions, file structures, and advanced procedures: * ๐Ÿ“– Refer to the comprehensive deployment manuals at: * [documentation/render_deployment_guide.md](file:///d:/Work/AngryBird-main/documentation/render_deployment_guide.md) (For Render and Local setups) ### Quick Local Run 1. **Activate environment & install dependencies**: ```bash python -m venv .venv .venv\Scripts\Activate.ps1 # Windows source .venv/bin/activate # Linux/macOS pip install -r requirements.txt ``` 2. **Add environment variables** to a local `.env` file (API_ID, API_HASH, BOT_TOKEN, DB_URL, OWNER_ID, DB_CHANNELS, etc.). 3. **Launch the bot**: ```bash python -m mfinder ``` --- ## ๐Ÿ“œ License & Ownership This software, codebase, and its implementations are **fully owned, managed, and licensed** by: * ๐Ÿ‘ค **Angry Bird** (Primary Maintainer: [@ANGRY_BIRD22_bot](https://t.me/ANGRY_BIRD22_bot)) * โšก **Team FireBolt** All rights reserved. Unauthorized redistribution or copying of these custom features is strictly prohibited.