From 4d96334de53ad55946ab82bab6b985c3e17a3426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Sat, 18 May 2019 00:11:16 +0200 Subject: [PATCH] Updated CurseForge API call --- CB/CurseForge.py | 6 +++--- CB/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CB/CurseForge.py b/CB/CurseForge.py index 3b8c965..d3598c6 100644 --- a/CB/CurseForge.py +++ b/CB/CurseForge.py @@ -17,7 +17,7 @@ def __init__(self, url, cache, allowdev): project = re.findall(r'\d+', soup.find('a', attrs={'class': 'button button--icon button--twitch ' 'download-button'})["data-nurture-data"])[0] self.cacheID = project - self.payload = requests.get(f'https://addons-ecs.forgesvc.net/api/addon/{project}').json() + self.payload = requests.post('https://addons-ecs.forgesvc.net/api/v2/addon', json=[int(project)]).json()[0] self.name = self.payload['name'] self.allowDev = allowdev self.downloadUrl = None @@ -28,9 +28,9 @@ def __init__(self, url, cache, allowdev): def _parse_files(self, releasetype): for f in self.payload['latestFiles']: - if f['releaseType'] == releasetype: + if f['releaseType'] == releasetype and '-nolib' not in f['displayName']: self.downloadUrl = f['downloadUrl'] - self.currentVersion = f['fileName'] + self.currentVersion = f['displayName'] break def get_current_version(self): diff --git a/CB/__init__.py b/CB/__init__.py index 8a421da..39a36ee 100644 --- a/CB/__init__.py +++ b/CB/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.5.0' +__version__ = '1.5.1' __license__ = 'GPLv3' __copyright__ = '2019, Paweł Jastrzębski ' __docformat__ = 'restructuredtext en'