This commit is contained in:
parent
35ad683579
commit
435a00b558
|
@ -24,7 +24,7 @@ async def get_all_authors():
|
|||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
print(f"[services.core] {query_name}: {response.status_code} {len(response.text)} bytes")
|
||||
print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes")
|
||||
if response.status_code != 200:
|
||||
return None
|
||||
r = response.json()
|
||||
|
@ -50,9 +50,13 @@ async def get_my_followings():
|
|||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
print(f"[services.core] {query_name}: {response.status_code} {len(response.text)} bytes")
|
||||
print(f"[services.core] {query_name}: [{response.status_code}] {len(response.text)} bytes")
|
||||
if response.status_code != 200:
|
||||
return None
|
||||
r = response.json()
|
||||
authors = r.get("data", {}).get(query_name, {}).get("authors", [])
|
||||
return authors
|
||||
data = r.get("data")
|
||||
if data:
|
||||
authors = data.get(query_name, {}).get("authors", [])
|
||||
return authors
|
||||
else:
|
||||
return []
|
||||
|
|
Loading…
Reference in New Issue
Block a user