From 84de1851f6982ca73a2f82eb382ff3f13742e31f Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Wed, 18 Jul 2018 17:23:15 +0200 Subject: Handle retrieving binary files properly --- obsapi/httpapi.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'obsapi/httpapi.py') diff --git a/obsapi/httpapi.py b/obsapi/httpapi.py index 4b0ab65..8ef893e 100644 --- a/obsapi/httpapi.py +++ b/obsapi/httpapi.py @@ -110,11 +110,15 @@ class ObsHttpApi(object): return '/'.join(['{}'] * len(args)).format(*args) def get(self, *args, **params): + binary_get = params.pop('binary_get', False) api = self.__api(*args) r = self.__api_get(api, params=params) if not self.success: return self.default_xml + if binary_get: + return r.content + return r.text def put(self, *args, **kwargs): -- cgit v1.2.3