Skip to main content

A Telegram bot that can stream Telegram files to users over HTTP.

Project description

tgfilestream

A Telegram bot that can stream Telegram files to users over HTTP.

Setup

Install dependencies (see requirements.txt), configure environment variables (see below) and run with python3 -m tgfilestream.

A reverse proxy is recommended to add TLS. When using a reverse proxy, keep HOST as-is, but add the publicly accessible URL to PUBLIC_URL. The URL should include the protocol, e.g. https://example.com.

Deploy to Render/Heroku

Click here to learn how to deploy this bot to Heroku or Render.

Environment variables

  • TG_API_ID (required) - Your Telegram API ID.
  • TG_API_HASH (required) - Your Telegram API hash.
  • TG_BOT_TOKEN (required) - Your Telegram Bot Token.
  • TG_SESSION_NAME (defaults to tgfilestream) - The name of the Telethon session file to use.
  • PORT (defaults to 8080) - The port to listen at.
  • HOST (defaults to localhost) - The host to listen at.
  • PUBLIC_URL (defaults to http://localhost:8080) - The prefix for links that the bot gives.
  • TRUST_FORWARD_HEADERS (defaults to false) - Whether or not to trust X-Forwarded-For headers when logging requests.
  • DEBUG (defaults to false) - Whether or not to enable extra prints.
  • LOG_CONFIG - Path to a Python basic log config. Overrides DEBUG.
  • REQUEST_LIMIT (default 5) - The maximum number of requests a single IP can have active at a time.
  • CONNECTION_LIMIT (default 20) - The maximum number of connections to a single Telegram datacenter.
  • CACHE_SIZE (defaults to 128) - The number of FileInfo objects (messages) to cache.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tgfilestream-0.1.2.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tgfilestream-0.1.2-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file tgfilestream-0.1.2.tar.gz.

File metadata

  • Download URL: tgfilestream-0.1.2.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tgfilestream-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4ba0d25190959b5a831bc9b227d18c621a3857e00f5d0f2d1cb08e2ddc769cde
MD5 d5bb9605f4d543b5ed96f4b3ab4ccaad
BLAKE2b-256 477f1470e71d41ee351634bbf30e697230830a300da81345b0ec290e13fb9555

See more details on using hashes here.

File details

Details for the file tgfilestream-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tgfilestream-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tgfilestream-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1aef18516a44e6a87a71429e65d828811dd00547d492bcce8328c2a5f6f3fd8c
MD5 88b06ff018c6c073cfa2e6780d804c8d
BLAKE2b-256 879157f66d39e8a9f04587b27b7a21f6e92a4f41a5f17705bb15bf12c0b63262

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page