Skip to content

Latest commit

Β 

History

256 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“½οΈ Telegram Indexer

Automatic Movie Web-App

A powerful web app to browse, search, and stream media from Telegram channels β€” right in your browser.

Python Telethon License Status

🌐 Live Demo Β· πŸ“Ί Deploy Tutorial Β· πŸ› Report a Bug


πŸ–ΌοΈ Screenshots

πŸ’‘ Add your own screenshots here β€” e.g., the homepage, search results, and media player views.

Home / Browse Search Results Media Player
screenshot_home.png screenshot_search.png screenshot_player.png

✨ Features

Feature Description
πŸ” Smart Indexing Index one or multiple Telegram channels/chats
πŸ“± Web Interface Browse messages and media files directly in your browser
πŸ”Ž Advanced Search Search through all indexed content instantly
πŸ“‘ Multi-Channel Index multiple channels simultaneously
πŸ–ΌοΈ Thumbnails Channel profile thumbnails displayed in-browser
πŸ” Auth Support Optional username/password login protection
πŸ“₯ Media Download Download files via browser or download managers
🎯 Selective Indexing Choose specific chats or index everything at once
πŸ”’ Channel Lock Lock specific channels from public access

πŸ“‹ Roadmap

  • Channel lock functionality
  • Multi-client worker bot support
  • Caching system
  • API Support
  • Admin Dashboard

πŸ“Ί Deploy Tutorial

Watch the video


πŸš€ Quick Start

1. Clone the repository

git clone https://github.com/odysseusmax/tg-index.git
cd tg-index

2. Set up a virtual environment

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

3. Install dependencies

pip install -U -r requirements.txt

4. Generate a Session String

Run the included script and follow the prompts:

python3 app/generate_session_string.py

πŸ’‘ Alternatively, use the Telethon Session Generator online tool.

5. Configure environment variables

Create a .env file in the root directory (see Configuration below).

6. Start the app

python3 -m app

The app will be available at http://localhost:8080 (or your configured host/port).


βš™οΈ Configuration

Required Variables

Variable Description
API_ID Telegram API ID from my.telegram.org/apps
API_HASH Telegram API Hash from my.telegram.org/apps
SESSION_STRING Generated by running python3 app/generate_session_string.py
INDEX_SETTINGS JSON config (see below)

Optional Variables

Variable Default Description
PORT 8080 Port the app listens on
HOST 0.0.0.0 Host the app listens on
DEBUG false Set to true for verbose logging
BLOCK_DOWNLOADS (unset) Set any value to disable downloads
RESULTS_PER_PAGE 20 Number of results per page
TGINDEX_USERNAME '' Username for auth (leave blank to disable)
PASSWORD '' Password for auth (leave blank to disable)
SHORT_URL_LEN β€” Length of alias URLs
SESSION_COOKIE_LIFETIME 60 Session duration (minutes)
SECRET_KEY β€” 32-char string for signing cookies (required if auth is enabled)

INDEX_SETTINGS Options

{
  "index_all": false,
  "index_private": false,
  "index_group": false,
  "index_channel": true,
  "exclude_chats": [],
  "include_chats": [-1001234567890]
}
Key Description
index_all Index all available chats (true/false)
index_private Include private chats (requires index_all: true)
index_group Include groups (requires index_all: true)
index_channel Include channels (requires index_all: true)
exclude_chats Array of chat IDs to exclude
include_chats Array of specific chat IDs to index (requires index_all: false)

Generate a Secret Key

import secrets, string

chars = string.ascii_letters + string.digits + string.punctuation
print(''.join(secrets.choice(chars) for _ in range(32)))

πŸ”’ Security Tips

  • Always set a strong, random SECRET_KEY when enabling login
  • Consider enabling BLOCK_DOWNLOADS for public-facing deployments
  • Only index channels/chats you have permission to access
  • Keep your SESSION_STRING private β€” treat it like a password
  • Regularly update your dependencies to patch security vulnerabilities

❓ Troubleshooting & FAQ

Q: The app starts but no media is showing up.
A: Double-check your INDEX_SETTINGS. Make sure the include_chats IDs are correct and that the Telegram account used for the session is a member of those chats.

Q: I'm getting a SESSION_STRING error on startup.
A: Regenerate your session string using python3 app/generate_session_string.py. Make sure you log in with the correct Telegram account.

Q: Downloads are not working.
A: Make sure BLOCK_DOWNLOADS is not set in your environment. If it's set to any value, downloads will be disabled.

Q: How do I find my Telegram chat ID?
A: Forward a message from the channel/group to @userinfobot or use a bot like @username_to_id_bot.

Q: Authentication isn't working after I set a username and password.
A: Make sure you've also set a valid SECRET_KEY (32 characters). Auth won't function without it.

Q: Can I host this on a free cloud platform?
A: Yes! The demo is hosted on Koyeb. Platforms like Railway, Render, and Fly.io also work well.


🀝 Contributing

Contributions are always welcome! Feel free to:

  • πŸ› Open an issue for bugs or feature requests
  • πŸ”€ Submit a pull request with improvements
  • ⭐ Star the repo if you find it useful!

πŸ§‘β€πŸ’» Credits


πŸ’¬ Support

Telegram


πŸ“„ License

Licensed under the GNU General Public License. See LICENSE for details.


⚠️ Disclaimer: Make sure you have the appropriate permissions to access and index any Telegram channels or chats. Always comply with Telegram's Terms of Service and respect user privacy.

About

Python Web App which indexes a telegram channel and serves its files for download and stream over Https

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages