This commit is contained in:
2023-10-13 19:45:30 +03:00
parent 1c46fc1d48
commit 84e6841331
8 changed files with 84 additions and 73 deletions

View File

@@ -39,7 +39,6 @@ async def get_network(author_id:int, limit:int = 50, offset:int = 0) -> list:
}
followings = []
followers = []
try:
async with AsyncClient() as client:
response = await client.post(API_BASE, headers=headers, data=json.dumps(gql))
@@ -49,12 +48,11 @@ async def get_network(author_id:int, limit:int = 50, offset:int = 0) -> list:
followings = r.get("data", {}).get("authorFollowings", [])
more_amount = limit - len(followings)
if more_amount > 0:
followers = get_followers(author_id, more_amount)
followers = await get_followers(author_id, more_amount)
followings.extend(followers)
except Exception as e:
print(e)
followings.extend(followers)
return followings