Skip to content

Commit

Permalink
Updated CurseForge support
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Jun 26, 2019
1 parent 4d96334 commit 0859bc1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CB/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def search(self, query):
results = []
soup = BeautifulSoup(requests.get(f'https://www.curseforge.com/wow/addons/search?search='
f'{html.escape(query.strip())}').content, 'html.parser')
for row in soup.find_all('h2', attrs={'class': 'list-item__title strong mg-b-05'}):
for row in soup.find_all('h3', attrs={'class': 'text-primary-500 font-bold text-lg hover:no-underline'}):
results.append(f'https://www.curseforge.com{row.parent["href"]}')
return results

Expand Down
3 changes: 1 addition & 2 deletions CB/CurseForge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def __init__(self, url, cache, allowdev):
project = cache[url]
else:
soup = BeautifulSoup(requests.get(url).content, 'html.parser')
project = re.findall(r'\d+', soup.find('a', attrs={'class': 'button button--icon button--twitch '
'download-button'})["data-nurture-data"])[0]
project = re.findall(r'\d+', soup.find('div', attrs={'class': 'w-full flex justify-between'}).text)[0]
self.cacheID = project
self.payload = requests.post('https://addons-ecs.forgesvc.net/api/v2/addon', json=[int(project)]).json()[0]
self.name = self.payload['name']
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.1'
__version__ = '1.5.2'
__license__ = 'GPLv3'
__copyright__ = '2019, Paweł Jastrzębski <[email protected]>'
__docformat__ = 'restructuredtext en'
Expand Down
3 changes: 1 addition & 2 deletions CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ def c_update(self, args, addline=False, update=True, force=False):
versionold])
else:
self.table_data.append([f'{Fore.YELLOW}{"Updated" if update else "Update available"}'
f'{Fore.RESET}', name, f'{versionold} {Fore.LIGHTBLACK_EX}>>'
f'>{Fore.RESET} {versionnew}'])
f'{Fore.RESET}', name, f'{Fore.YELLOW}{versionnew}{Fore.RESET}'])
else:
self.table_data.append([f'{Fore.LIGHTBLACK_EX}Not installed{Fore.RESET}', addon, ''])
pbar.update(1)
Expand Down

0 comments on commit 0859bc1

Please sign in to comment.