summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/common.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-08-29 02:17:16 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2022-08-29 02:17:16 -0400
commita768930761f7f20587ae40a8cacca0e55c85290a (patch)
tree5a4163db912b93fc45f717e5e43fd5be3e66f16c /gallery_dl/extractor/common.py
parentae2a0f5622beaa6f402526f8a7b939419283a090 (diff)
New upstream version 1.23.0.upstream/1.23.0
Diffstat (limited to 'gallery_dl/extractor/common.py')
-rw-r--r--gallery_dl/extractor/common.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py
index 6ccae7f..1b41101 100644
--- a/gallery_dl/extractor/common.py
+++ b/gallery_dl/extractor/common.py
@@ -795,12 +795,23 @@ SSL_CIPHERS = {
}
+urllib3 = requests.packages.urllib3
+
# detect brotli support
try:
- BROTLI = requests.packages.urllib3.response.brotli is not None
+ BROTLI = urllib3.response.brotli is not None
except AttributeError:
BROTLI = False
+# set (urllib3) warnings filter
+action = config.get((), "warnings", "default")
+if action:
+ try:
+ import warnings
+ warnings.simplefilter(action, urllib3.exceptions.HTTPWarning)
+ except Exception:
+ pass
+del action
# Undo automatic pyOpenSSL injection by requests
pyopenssl = config.get((), "pyopenssl", False)