Skip to content

Repository files navigation

live2audio

A simple proxy to stream YouTube livestream audio directly into Jellyfin (or any media player). Also includes a webpage to stream audio directly in your browser. Mostly AI assisted.

Screenshots

Light mode Dark mode

Setup

  1. Start the service:

    docker-compose up -d

    Or if you prefer Python

    python stream_manager.py
  2. Add to Jellyfin:

    • Go to Dashboard -> Live TV.
    • Click the + next to Tuner Devices.
    • Select M3U Tuner as the type.
    • For the File or URL, create a local file (e.g., youtube.m3u) or use a Data URI.

M3U Example

Create a file called youtube.m3u and add your favorite streams. For Jellyfin, adding tvg-id and group-title helps categorization:

#EXTM3U
#EXTINF:-1 tvg-id="LofiGirl" tvg-logo="http://YOUR_SERVER_IP:5000/thumbnail.jpg?v=jfKfPfyJRdk" group-title="YouTube Radio", Lofi Girl - Radio
http://YOUR_SERVER_IP:5000/stream.mp3?v=jfKfPfyJRdk
#EXTINF:-1 tvg-id="Synthwave" tvg-logo="http://YOUR_SERVER_IP:5000/thumbnail.jpg?v=4xDzrJKXOOY" group-title="YouTube Radio", Synthwave Radio
http://YOUR_SERVER_IP:5000/stream.mp3?v=4xDzrJKXOOY

Replace YOUR_SERVER_IP with the IP of the machine running this docker container, and v= with any YouTube Video ID.

Troubleshooting Jellyfin

  • Manifest Unknown / Probe Failed: Ensure the container is running and the IP is accessible. The server now handles HEAD requests to help Jellyfin's initial probe.
  • Stream Stops: YouTube sometimes rotates stream URLs. Restarting the channel in Jellyfin will force a fresh fetch through yt-dlp.
  • Latency: There is an inherent 2-5 second delay as yt-dlp resolves the YouTube stream and ffmpeg starts transcoding.
  • Permission Denied when adding stations:
    • Linux/Docker: Ensure the user running Docker has write permissions to youtube.m3u. Run chmod 666 youtube.m3u on the host.
    • Windows: Right-click youtube.m3u -> Properties -> Ensure "Read-only" is unchecked.
    • Docker Compose: Ensure the file is correctly mounted in your docker-compose.yml.

How it works

  • Flask: Receives the request from Jellyfin.
  • yt-dlp: Fetches the best audio stream from YouTube.
  • ffmpeg: Transcodes the stream to MP3 in real-time.
  • Direct Streaming: The audio data is piped directly to the HTTP response, meaning zero disk space is used.

About

stream youtube livestreams to m3u (AI used to develop)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages