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 (defaults to tgfilestream) - 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.1.tar.gz (22.1 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.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tgfilestream-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 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.1.tar.gz
Algorithm Hash digest
SHA256 22af43cc3c33b2e6c1b65840677c54feed6a15ca9c18bba97b09ca53c9f0a02a
MD5 9115b1263bfdbee56cd3594e532359aa
BLAKE2b-256 1d9ec526157e15a0f8cda992af612b185dccd5a9eefc3d089aeb5004e3f28662

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tgfilestream-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7852b1c2865c9d5be5be3f436d71426561f92845c6a9cb8bdfa765ffb3b3416d
MD5 be22aaa4b8e65ec63c919e5317eaa1f9
BLAKE2b-256 2e8a31b55c07884e8b81a0dfe604100007ecd2939dc173bc68235ab685749654

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