Make pypo media downloader port aware

This is needed if the base port is not 80 like in the vagrant setup.
This commit is contained in:
Lucas Bickel 2017-03-10 19:10:15 +01:00
parent 8ddc5867ac
commit 0e8d0868e8

View file

@ -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)