Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions linktree.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ async def uncensorLinks(self, account_id : int, link_ids : Union[List[int], int]
json_resp = await resp.json()
await session.close()

_links = json_resp["links"]
json_resp = await resp.json()
if not json_resp or "links" not in json_resp:
await session.close()
return []

links = json_resp["links"]


links = []
for _link in _links:
Expand Down Expand Up @@ -120,8 +126,7 @@ async def getLinktreeUserInfo(self, url : Optional[str] = None, username : Optio
avatar_image = account["profilePictureUrl"]
url = f"https://linktr.ee/{username}" if url is None else url
id = account["id"]
tier = account["tier"]
isActive = account["isActive"]
tier = account.get("tier", "Unknown")
createdAt = account["createdAt"]
updatedAt = account["updatedAt"]
description = account["description"]
Expand Down Expand Up @@ -170,6 +175,5 @@ async def main():


if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())