Merge pull request #1754 from croneter/py3-fix-artwork-proxy

Make sure that no proxy is used for artwork caching for calls to Kodi's webserver at `localhost`
This commit is contained in:
croneter 2021-12-25 21:05:11 +01:00 committed by GitHub
commit 49303f6eed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,11 +99,15 @@ def cache_url(url, should_suspend=None):
sleeptime = 0 sleeptime = 0
while True: while True:
try: try:
# Make sure that no proxy is used for our calls to Kodi's webserver
# at localhost See
# https://github.com/croneter/PlexKodiConnect/issues/1732
requests.head( requests.head(
url=f'http://{app.CONN.webserver_username}:{app.CONN.webserver_password}@{app.CONN.webserver_host}:{app.CONN.webserver_port}/image/image://{url}', url=f'http://{app.CONN.webserver_username}:{app.CONN.webserver_password}@{app.CONN.webserver_host}:{app.CONN.webserver_port}/image/image://{url}',
auth=(app.CONN.webserver_username, auth=(app.CONN.webserver_username,
app.CONN.webserver_password), app.CONN.webserver_password),
timeout=TIMEOUT) timeout=TIMEOUT,
proxies={'http': None, 'https': None})
except requests.Timeout: except requests.Timeout:
# We don't need the result, only trigger Kodi to start the # We don't need the result, only trigger Kodi to start the
# download. All is well # download. All is well