From 0e8d0868e8eae8e7f245ee82fbae41652853e5bb Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Fri, 10 Mar 2017 19:10:15 +0100 Subject: [PATCH] Make pypo media downloader port aware This is needed if the base port is not 80 like in the vagrant setup. --- python_apps/pypo/pypo/pypofile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_apps/pypo/pypo/pypofile.py b/python_apps/pypo/pypo/pypofile.py index f4288af53..673a4fd72 100644 --- a/python_apps/pypo/pypo/pypofile.py +++ b/python_apps/pypo/pypo/pypofile.py @@ -66,7 +66,9 @@ class PypoFile(Thread): CONFIG_SECTION = "general" username = self._config.get(CONFIG_SECTION, 'api_key') host = self._config.get(CONFIG_SECTION, 'base_url') - url = "http://%s/rest/media/%s/download" % (host, media_item["id"]) + port = self._config.get(CONFIG_SECTION, 'base_port', 80) + url = "http://%s:%s/rest/media/%s/download" % (host, port, media_item["id"]) + self.logger.error(url) with open(dst, "wb") as handle: response = requests.get(url, auth=requests.auth.HTTPBasicAuth(username, ''), stream=True, verify=False)