dont allow redirects for sonarr/radarr requests.

pull/37/head
James 7 years ago
parent 68f618de03
commit 739b34afca

@ -27,7 +27,8 @@ class PVR(ABC):
req = requests.get( req = requests.get(
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/system/status'), os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/system/status'),
headers=self.headers, headers=self.headers,
timeout=60 timeout=60,
allow_redirects=False
) )
log.debug("Request Response: %d", req.status_code) log.debug("Request Response: %d", req.status_code)
@ -49,7 +50,8 @@ class PVR(ABC):
req = requests.get( req = requests.get(
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), endpoint), os.path.join(misc_str.ensure_endswith(self.server_url, "/"), endpoint),
headers=self.headers, headers=self.headers,
timeout=60 timeout=60,
allow_redirects=False
) )
log.debug("Request URL: %s", req.url) log.debug("Request URL: %s", req.url)
log.debug("Request Response: %d", req.status_code) log.debug("Request Response: %d", req.status_code)
@ -71,7 +73,8 @@ class PVR(ABC):
req = requests.get( req = requests.get(
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/profile'), os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/profile'),
headers=self.headers, headers=self.headers,
timeout=60 timeout=60,
allow_redirects=False
) )
log.debug("Request URL: %s", req.url) log.debug("Request URL: %s", req.url)
log.debug("Request Response: %d", req.status_code) log.debug("Request Response: %d", req.status_code)
@ -111,7 +114,8 @@ class PVR(ABC):
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), endpoint), os.path.join(misc_str.ensure_endswith(self.server_url, "/"), endpoint),
headers=self.headers, headers=self.headers,
json=payload, json=payload,
timeout=60 timeout=60,
allow_redirects=False
) )
log.debug("Request URL: %s", req.url) log.debug("Request URL: %s", req.url)
log.debug("Request Payload: %s", payload) log.debug("Request Payload: %s", payload)

@ -23,7 +23,8 @@ class Sonarr(PVR):
req = requests.get( req = requests.get(
os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/tag'), os.path.join(misc_str.ensure_endswith(self.server_url, "/"), 'api/tag'),
headers=self.headers, headers=self.headers,
timeout=60 timeout=60,
allow_redirects=False
) )
log.debug("Request URL: %s", req.url) log.debug("Request URL: %s", req.url)
log.debug("Request Response: %d", req.status_code) log.debug("Request Response: %d", req.status_code)

Loading…
Cancel
Save