Skip to main content

tflix

A Telegram CLI interface for media downloading and streaming, built on top of Telethon.

Description

tflix streamlines the process of discovering, downloading and streaming media files from Telegram bots. It provides an interactive command-line interface that handles bot navigation, automatic channel joining, and media file streaming and downloads with minimal user intervention.

Features

  • Interactive CLI - Navigate bot menus and send messages directly from the terminal
  • Auto-Join Support - Automatically joins groups via invite links when required
  • Button Navigation - Click numbered options from bot menus instantly
  • Media Filtering - Lists only media files
  • Downloading and Streaming - Can download or stream media files directly
  • Movie/Series Search - Use Tab to search and autocomplete movies or series titles

Requirements

Installation

From PyPI

pip install tflix

From Source

git clone https://github.com/voidsnax/tflix.git
cd tflix
pip install -e .

Usage

Setup Guide

Creating the .env File

  1. Locate the config folder:

    • Windows: C:\Users\<User>\tflix\
    • Linux/Mac: ~/.config/tflix/
  2. Create a new file named .env in the config folder

  3. Get your Telegram API credentials:

    • Visit https://my.telegram.org
    • Log in with your Telegram account
    • Go to "API development tools"
    • Create a new application
    • Copy your api_id and api_hash
  4. Add your credentials to .env:

    TGRAM_API_ID=your_api_id_here
    TGRAM_API_HASH=your_api_hash_here
    
  5. Optional: Add movie database API keys for title suggestions

    Note: TMDB is recommended for vast movie and series collections, while OMDB is recommended for quicker response times.

    Example:

    TGRAM_API_ID=your_api_id_here
    TGRAM_API_HASH=your_api_hash_here
    TMDB_API_KEY=your_tmdb_api_key_here
    OMDB_API_KEY=your_omdb_api_key_here
    
  6. Save the file

Configuration File

tflix also supports a config file for advanced settings. The default location is:

  • Linux/Mac: ~/.config/tflix/tflix.conf
  • Windows: C:\Users\<User>\tflix\tflix.conf

A sample config file looks like:

[chat]
auto_join_buttons = join updates channel, join channel, me joined, request to my updates channel
buttons_to_skip = search movies here, search on google

[log]
# channel =

[server]
host = http://localhost
port = 8080

[stream]
auto_stream = True
copy_links = False

[download]
connection_count = 4

Options:

  • auto_join_buttons: comma-separated button labels to auto-click for joining channels/groups
  • buttons_to_skip: comma-separated button labels to ignore
  • channel: log channel ID for forwading streaming files (needed if u want to start or use streaming services also u can connect to log channel and access files by just mentioning log channel name, e.g, tflix streamlogs -s)
  • host: streaming server host
  • port: streaming server port
  • auto_stream: automatically generate stream links for files
  • copy_links: copy streaming links to clipboard
  • connection_count: number of download connections (1-20) (higher values can cause instability or flood wait)

If the config file does not exist, it is created automatically with default values.

Basic Command

tflix CHAT [OPTIONS]

Options

CHAT                         Chat username, ID, or link
-o, --output PATH            Output directory for downloads (default: current dir)
-l, --list [LIMIT/STRING]    List recent N bot media messages (default: 1) or searches across the chat for the file if a string is provided
-d, --download [INDEX]       Download recent N bot media messages (default: 1)
-s, --stream                 Starts streaming server

Interactive Commands

h                     → Print help table
<text>                → Send message to bot
<number>              → Click button # from the list
ls [LIMIT/STRING]     → List files to a limit or based on string
stream [INDEX]        → Stream files
dl [INDEX]            → Download files (e.g., indices '1', '1,2,3', '1:3', '1-3')
exit/ctrl-c           → Quit

Examples

Connect to a bot and list 5 recent files:

tflix @mybot -l 5

Connect to a bot with server running:

tflix @mybot -s

Connect to a bot and set output folder:

tflix @mybot -o C:\Downloads

Then interact :)

Notes

  • API Credentials - Create .env in config folder with TGRAM_API_ID and TGRAM_API_HASH
  • Session Changes - Overwrites existing session when .env file attributes changes
  • Private groups - need invite link to connect
  • Input Delay - Allow 10-15 seconds for input to process if responses or input prompt arrow seem delayed
  • Faster downloads - Install cryptg or telethon-tgcrypto for faster download speeds (pip install cryptg OR pip install telethon-tgcrypto).
  • Video listing filter - Only video files with size greater than 15 MB are listed by default.
  • Copying streaming links - Depends on platform:
    • Windows/Mac: install pyperclip (pip install pyperclip) to enable clipboard copying.
    • Linux: wl-copy from the wl-clipboard package is used (e.g. on Debian/Ubuntu: sudo apt install wl-clipboard).
    • Termux: requires the Termux:API add-on and termux-api package (install Termux:API from F‑Droid/GitHub repo, the original source you have used to install termux and run pkg install termux-api).
  • Streamable links - Use the generated streamable links in a media player like mpv for a better streaming experience.You can also use the links in a download managers when server is active.

License

MIT License

Release files for tflix 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tflix 1.1.3
File Size Uploaded
tflix-1.1.3.tar.gz 151.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tflix 1.1.3
File Interpreter ABI Platform
tflix-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 179.0 kB

Release files / tflix-1.1.3.tar.gz

Download URL tflix-1.1.3.tar.gz
Size 151.0 kB
Tags Source
SHA-256 checksum
How to use checksums
27dcdae727274144da6976fc1e59e4c8418da587b8495f1d119ae7109334112a
BLAKE2b-256 checksum
How to use checksums
bd77a26fcfc7c020e1b2b182ff465750fd68e584a47e45a1f0688da6b4796f9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

Release files / tflix-1.1.3-py3-none-any.whl

Download URL tflix-1.1.3-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02d6ed957ff05a3a1417b35d492769660fac2722b0788c9834c5b585525c4ba2
BLAKE2b-256 checksum
How to use checksums
04d78f66fa8c59c6756cd8c09a0bb6ee764740845665ef3f11f2b35ee59ed2e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page