Skip to content

Commit

Permalink
Merge pull request NanmiCoder#528 from HuiGitH/hui/fix-xhs-gender
Browse files Browse the repository at this point in the history
fix xhs gender
  • Loading branch information
NanmiCoder authored Dec 28, 2024
2 parents 79bf9fc + d929ad1 commit 7ce1273
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion store/xhs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,18 @@ async def save_creator(user_id: str, creator: Dict):
elif i.get('type') == 'interaction':
interaction = i.get('count')

def get_gender(gender):
if gender == 1:
return '女'
elif gender == 0:
return '男'
else:
return None

local_db_item = {
'user_id': user_id, # 用户id
'nickname': user_info.get('nickname'), # 昵称
'gender': '女' if user_info.get('gender') == 1 else '男', # 性别
'gender': get_gender(user_info.get('gender')), # 性别
'avatar': user_info.get('images'), # 头像
'desc': user_info.get('desc'), # 个人描述
'ip_location': user_info.get('ipLocation'), # ip地址
Expand Down

0 comments on commit 7ce1273

Please sign in to comment.