tg-mpv-bot

Telegram bot that turns any Linux box into a media center — stream links, forward files to TV, browse library with inline buttons.

Built 2025
Python aiogram mpv yt-dlp
Terminal showing tg-mpv-bot playing media

A Telegram bot that turns a Linux box with HDMI into a media center. Browse the local library with inline buttons, stream any link directly to the TV, or forward a Telegram file and watch it play. Built on top of mpv’s IPC interface for real-time playback control.

Project facts

Scope

  • Telegram bot with inline keyboard library browser
  • mpv IPC integration for playback control
  • Stream any URL directly to the TV
  • Forward Telegram files to mpv for local playback
  • Network handling for IPv6 and IP-locked CDNs

Implementation highlights

  • Built an inline button tree for browsing the local media library.
  • Solved mpv pipe deadlocks with proper process lifecycle management.
  • Handled broken IPv6 and IP-locked CDN edge cases for reliable streaming.

Outcome

A Telegram remote for my living room TV — browse, stream, and control playback without leaving the chat.

What I'd improve now

Add multi-room support, queue management, and voice command integration.