Skip to content

Commit

Permalink
Updated CurseForge API call
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed May 17, 2019
1 parent 0869b54 commit 4d96334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CB/CurseForge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion CB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.5.0'
__version__ = '1.5.1'
__license__ = 'GPLv3'
__copyright__ = '2019, Paweł Jastrzębski <[email protected]>'
__docformat__ = 'restructuredtext en'
Expand Down

0 comments on commit 4d96334

Please sign in to comment.