minor fix deprecation warning

tests/test_util.py: 14 warnings
  /home/runner/work/yt-local/youtube-local/youtube/util.py:321: DeprecationWarning: HTTPResponse.getheader() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTPResponse.headers.get(name, default).
    response.getheader('Content-Encoding', default='identity'))
This commit is contained in:
Astound 2025-03-01 01:12:05 +08:00
parent 3217305f9f
commit 57854169f4
Signed by: kaiser
GPG Key ID: 97504AF0027B1A56
2 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ def error_page(e):
elif (exc_info()[0] == util.FetchError elif (exc_info()[0] == util.FetchError
and exc_info()[1].code == '404' and exc_info()[1].code == '404'
): ):
error_message = ('Error: The page you are looking for isn\'t here. ¯\_(ツ)_/¯') error_message = ('Error: The page you are looking for isn\'t here.')
return flask.render_template('error.html', return flask.render_template('error.html',
error_code=exc_info()[1].code, error_code=exc_info()[1].code,
error_message=error_message, error_message=error_message,

View File

@ -318,7 +318,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None,
cleanup_func(response) # release_connection for urllib3 cleanup_func(response) # release_connection for urllib3
content = decode_content( content = decode_content(
content, content,
response.getheader('Content-Encoding', default='identity')) response.headers.get('Content-Encoding', default='identity'))
if (settings.debugging_save_responses if (settings.debugging_save_responses
and debug_name is not None and debug_name is not None