Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix Accept-Encoding headers in stream_json #4022

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions script/install-dependencies.sh
Expand Up @@ -7,6 +7,8 @@ set -ex
python -m pip install --disable-pip-version-check --upgrade pip setuptools
python -m pip install --upgrade -r dev-requirements.txt
python -m pip install pycountry
# https://github.com/streamlink/streamlink/issues/4021
python -m pip install brotli
# temporary windows python 3.10 fix for missing 'lxml 4.6.3' wheel
# https://github.com/streamlink/streamlink/issues/3971
python -m pip install "https://github.com/back-to/tmp_wheel/raw/b237059b18110ca298e191340eebb6eb0aef8827/lxml-4.6.3-cp310-cp310-win_amd64.whl; \
Expand Down
9 changes: 6 additions & 3 deletions tests/test_stream_json.py
@@ -1,5 +1,8 @@
import unittest

# noinspection PyUnresolvedReferences
from requests.utils import DEFAULT_ACCEPT_ENCODING

from streamlink import Streamlink
from streamlink.stream import AkamaiHDStream
from streamlink.stream import HDSStream
Expand Down Expand Up @@ -31,7 +34,7 @@ def test_http_stream(self):
"headers": {
"User-Agent": "Test",
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Encoding": DEFAULT_ACCEPT_ENCODING,
"Connection": "keep-alive",
}},
stream.__json__()
Expand All @@ -49,7 +52,7 @@ def test_hls_stream(self):
"headers": {
"User-Agent": "Test",
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Encoding": DEFAULT_ACCEPT_ENCODING,
"Connection": "keep-alive",
}
},
Expand All @@ -64,7 +67,7 @@ def test_hls_stream(self):
"headers": {
"User-Agent": "Test",
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Encoding": DEFAULT_ACCEPT_ENCODING,
"Connection": "keep-alive",
},
"master": master
Expand Down