Skip to content

Commit

Permalink
Merge pull request #190 from Rechi/un-gzip-repository
Browse files Browse the repository at this point in the history
repository: only un-gzip if url ends with .gz
  • Loading branch information
Rechi committed Mar 21, 2019
2 parents 8ab6f49 + db52e00 commit 6ec379a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kodi_addon_checker/addons/Repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ def __init__(self, version, path):
super(Repository, self).__init__()
self.version = version
self.path = path
gz_file = requests.get(path, timeout=(10, 10)).content
with gzip.open(BytesIO(gz_file), 'rb') as xml_file:
content = xml_file.read()
content = requests.get(path, timeout=(10, 10)).content

if path.endswith('.gz'):
with gzip.open(BytesIO(content), 'rb') as xml_file:
content = xml_file.read()

tree = ET.fromstring(content)
self.addons = []
for addon in tree.findall("addon"):
Expand Down

0 comments on commit 6ec379a

Please sign in to comment.