diff --git a/pkgs/applications/video/streamlink/default.nix b/pkgs/applications/video/streamlink/default.nix index 1c1a0fb3d84c..4abc2b6546aa 100644 --- a/pkgs/applications/video/streamlink/default.nix +++ b/pkgs/applications/video/streamlink/default.nix @@ -2,6 +2,7 @@ , python3Packages , rtmpdump , ffmpeg +, fetchpatch }: python3Packages.buildPythonApplication rec { @@ -33,11 +34,14 @@ python3Packages.buildPythonApplication rec { ffmpeg ]; - # note that upstream currently uses requests 2.25.1 in Windows builds - postPatch = '' - substituteInPlace setup.py \ - --replace 'requests>=2.26.0,<3.0' 'requests' - ''; + patches = [ + # Patch failing tests to expect correct Accept-Encoding as generated by Requests + (fetchpatch { + url = "https://github.com/streamlink/streamlink/commit/ae747a113199c119bced4613d33edcc67a222bb9.patch"; + includes = [ "tests/test_stream_json.py" ]; + sha256 = "sha256-KEgyWdh5DNgNktmLSvKQowUQO9p9Q7zP4NbCQJPNgKw="; + }) + ]; meta = with lib; { homepage = "https://streamlink.github.io/";