Skip to content

Commit 57023b1

Browse files
committed
tests: fix Accept-Encoding headers in stream_json
1 parent fd9e0b1 commit 57023b1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

script/install-dependencies.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ set -ex
77
python -m pip install --disable-pip-version-check --upgrade pip setuptools
88
python -m pip install --upgrade -r dev-requirements.txt
99
python -m pip install pycountry
10+
# https://github.com/streamlink/streamlink/issues/4021
11+
python -m pip install brotli
1012
# temporary windows python 3.10 fix for missing 'lxml 4.6.3' wheel
1113
# https://github.com/streamlink/streamlink/issues/3971
1214
python -m pip install "https://github.com/back-to/tmp_wheel/raw/b237059b18110ca298e191340eebb6eb0aef8827/lxml-4.6.3-cp310-cp310-win_amd64.whl; \

tests/test_stream_json.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import unittest
22

3+
# noinspection PyUnresolvedReferences
4+
from requests.utils import DEFAULT_ACCEPT_ENCODING
5+
36
from streamlink import Streamlink
47
from streamlink.stream import AkamaiHDStream
58
from streamlink.stream import HDSStream
@@ -31,7 +34,7 @@ def test_http_stream(self):
3134
"headers": {
3235
"User-Agent": "Test",
3336
"Accept": "*/*",
34-
"Accept-Encoding": "gzip, deflate",
37+
"Accept-Encoding": DEFAULT_ACCEPT_ENCODING,
3538
"Connection": "keep-alive",
3639
}},
3740
stream.__json__()
@@ -49,7 +52,7 @@ def test_hls_stream(self):
4952
"headers": {
5053
"User-Agent": "Test",
5154
"Accept": "*/*",
52-
"Accept-Encoding": "gzip, deflate",
55+
"Accept-Encoding": DEFAULT_ACCEPT_ENCODING,
5356
"Connection": "keep-alive",
5457
}
5558
},
@@ -64,7 +67,7 @@ def test_hls_stream(self):
6467
"headers": {
6568
"User-Agent": "Test",
6669
"Accept": "*/*",
67-
"Accept-Encoding": "gzip, deflate",
70+
"Accept-Encoding": DEFAULT_ACCEPT_ENCODING,
6871
"Connection": "keep-alive",
6972
},
7073
"master": master

0 commit comments

Comments
 (0)