File size: 6,164 Bytes
5dc4327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
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.