{ pkgs, lib, ... }: let proxies = [ "https://eu.luminous.dev" # (Europe) "https://eu2.luminous.dev" # (Europe 2) "https://as.luminous.dev" # (Asia) "https://lb-eu.cdn-perfprod.com" # (Europe) "https://lb-eu2.cdn-perfprod.com" # (Europe 2) "https://lb-eu4.cdn-perfprod.com" # (Europe 4) "https://lb-eu5.cdn-perfprod.com" # (Europe 5) "https://lb-eu3.cdn-perfprod.com" # (Europe 3, using Russia-only proxies) "https://lb-na.cdn-perfprod.com" # (NA) "https://lb-as.cdn-perfprod.com" # (Asia) "https://lb-sa.cdn-perfprod.com" # (SA) ]; in { programs.streamlink = { enable = true; settings = { player = "${pkgs.mpv}/bin/mpv"; player-args = "--cache 2048"; player-no-close = true; twitch-low-latency = true; twitch-disable-ads = true; default-stream = "best"; }; plugins = { # It is important this is called "twitch" and overwrites the default plugin twitch = { settings = { twitch-proxy-playlist = lib.concatStringsSep "," proxies; }; src = builtins.readFile (pkgs.fetchurl { url = "https://github.com/2bc4/streamlink-ttvlol/releases/download/7.0.0-20241105/twitch.py"; hash = "sha256-WbxLNkxG64BlnfI/RwY5N0bqEkO/D6u14nYMyTuveN8="; }); }; }; }; }