Archived
1
0
Fork 0
This commit is contained in:
yzhh 2022-06-25 13:53:20 +08:00 committed by GitHub
parent 5478dae819
commit 00f09a664d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ async def curseforge(mod_name: str, ver: str):
bs = BeautifulSoup(html, 'html.parser')
try:
information = bs.body.div.div.a
mod_title = information.find('h3').text
except Exception:
return {'msg': '未搜索到该Mod。', 'success': False}
more_specific_html = str(information)
@ -36,11 +37,10 @@ async def curseforge(mod_name: str, ver: str):
bs_2 = BeautifulSoup(html_2, 'html.parser')
try:
results = bs_2.body.div.find_all('tr')
information_2 = str(results[1])
except Exception:
traceback.print_exc()
return {'msg': f'此Mod没有{ver}的版本。', 'success': False}
print(results)
information_2 = str(results[1])
return {'msg': f'{mod_title}没有{ver}的版本。', 'success': False}
download_link = information_2[int(information_2.find("\"") + 1):int(information_2.find("\" target="))]
file_name = information_2[int(information_2.find("_blank\"") + 8):int(information_2.find("</a>"))]
status = '???'