Skip to main content

A Telegram Bot to stream content on your smart TV

Project description

smart-tv-telegram PyPI PyPI - License Docker Cloud Build Status

A Telegram Bot to stream content on your smart TV (also Chromecast, FireTV and other UPnP device)

Demonstration video

poc

Feature

  • Streaming, the bot will not have to download the entire file before playing it on your device
  • You can play anything if your device has the right codec
  • You can streaming on any device that supports UPnP (AVTransport)
  • Chromecast, Vlc (telnet api) and Kodi (xbmc http api) support
  • Streaming over HTTP

Note: Chromecast (1st, 2nd and 3rd Gen.) only supports H.264 and VP8 video codecs

Note: Most LG TVs with WebOS have an incorrect UPnP implementation, throw it in the trash and buy a new TV

How-to setup

Make sure you have an updated version of python, only the latest version will be supported

(currently it also works on Python 3.6)

  • Download the repository
  • Install python dependencies from requirements.txt
  • Copy config.ini.example to config.ini
  • Edit config.ini
git clone https://github.com/andrew-ld/smart-tv-telegram
cd smart-tv-telegram
python3 setup.py sdist bdist_wheel
python3 -m pip install dist/*.whl
cp config.ini.example config.ini
nano config.ini
smart_tv_telegram -c config.ini -v 1

How-to setup (Docker)

  • Copy config.ini.example to config.ini
  • Edit config.ini
  • Build Docker
  • Start Docker
cp config.ini.example config.ini
nano config.ini
docker image build -t smart-tv-telegram:latest .
docker run --network host -v "$(pwd)/config.ini:/app/config.ini:ro" -d smart-tv-telegram:latest

Troubleshooting

Q: My Firewall block upnp and broadcasting, how can use kodi without it

A: Set xbmc_enabled to 1 and add your kodi device to xbmc_devices list

Q: What is the format of xbmc_devices

A: A List of Python Dict with host, port, (and optional: username and password)

example: [{"host": "192.168.1.2", "port": 8080, "username": "pippo", "password": "pluto"}]

Q: How-To control vlc from this bot

A: set vlc_enabled to 1 and add your vlc device to vlc_devices list

Q: What is the format of vlc_devices

A: A List of Python Dict with host, port, (and optional: password)

example: [{"host": "127.0.0.1", "port": 4212, "password": "123"}]

Q: How-To enable upnp on my device that use kodi

A: follow this guide (you should enable remote control)

Q: How do I get a token?

A: From @BotFather

Q: How do I set up admins?

A: You have to enter your user_id, there are many ways to get it, the easiest is to use @getuseridbot

Q: How do I get an app_id and app_hash?

A: https://core.telegram.org/api/obtaining_api_id#obtaining-api-id

Q: The video keeps freezing

A: Check the video bitrate, this bot supports maximum ~4.5Mb/s

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

Built Distribution

smart_tv_telegram-1.1.0.dev0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file smart_tv_telegram-1.1.0.dev0.linux-x86_64.tar.gz.

File metadata

  • Download URL: smart_tv_telegram-1.1.0.dev0.linux-x86_64.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for smart_tv_telegram-1.1.0.dev0.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 109ccded6c21a9995db97e9f473578851a3a41ea7ee78c8ddf1b10b9088749af
MD5 52a61591fcd367b37ed68d8d6c58553d
BLAKE2b-256 1b3d9e5903adf102eca169b52fb0cb0afa1eb0059f4c7f5e4a3737f6be391903

See more details on using hashes here.

File details

Details for the file smart_tv_telegram-1.1.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: smart_tv_telegram-1.1.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for smart_tv_telegram-1.1.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 23618919092cf521b5c19fdf32a3c0409083248226ac21c1c33f6d3be92e2846
MD5 cf9170ca48d5ff30084f4d11294746d3
BLAKE2b-256 ecf5b09721aac73504ed09c7ad3c68d9d5b355bbf8b18b534a5b43957f5cb434

See more details on using hashes here.

Supported by

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