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.
  • 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.
  • TG_START_MESG - The message that should be shown in Telegram chat, in case of non-media message.
  • TG_G_C_MESG - The message that should be shown in a Telegram Group chat.
  • TG_SESSION_NAME (defaults to tgfilestream) - The name of the Telethon session file to use.
  • TG_BOT_FATHER_TOKEN (defaults to None) - This option is mutually exclusive to TG_SESSION_NAME, and if set, the client will login as a bot, instead of an user.

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.0.tar.gz (21.4 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.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tgfilestream-0.1.0.tar.gz
  • Upload date:
  • Size: 21.4 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.0.tar.gz
Algorithm Hash digest
SHA256 6c2b383093587bce93ec98ca76b735a48270d633dd05b164fb75d456ff52ae4b
MD5 d634af6d9c45865a8effa7f5bb23b71b
BLAKE2b-256 44d17ae932353cc7b455ad379870517d4702bd3113d0d0bdb6aa49309ab3642c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tgfilestream-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f72470d6e5964b00e8cadbcb86b7a72db229cdbdb2e33f9b2e8ddb63084f02b
MD5 b90efe6fb3b68fa9f4d59092c6378ac6
BLAKE2b-256 7d747fdc0ffe565b57b2cf6cba96c7f09d9f622a8fcae9bfde311e5f43e3a564

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