fix: json parse

This commit is contained in:
Indranil012 2023-03-09 19:15:04 +05:30
parent 5bb56eaf29
commit 79767fe2ca

View File

@ -28,9 +28,11 @@ class Releases:
assets: list = []
response = await self.httpx_client.get(f"https://api.github.com/repos/{repository}/releases")
if tag=="prerelease":
if response.json()['prerelease']:
tag_name = response.json()['tag_name']
response = await self.httpx_client.get(f"https://api.github.com/repos/{repository}/releases/tags/{tag_name}")
for index in response.json():
if index['prerelease']:
tag_name = index['tag_name']
response = await self.httpx_client.get(f"https://api.github.com/repos/{repository}/releases/tags/{tag_name}")
break
else:
response = await self.httpx_client.get(f"https://api.github.com/repos/{repository}/releases/{tag}")