Skip to content

Commit

Permalink
feat: cookies转换为dict
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Oct 13, 2024
1 parent 21809cf commit 0c3039a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions campux/social/qzone/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,18 @@ async def login_via_ob11_bot(
cookies = await ob11_bot.get_cookies(
domain='user.qzone.qq.com',
)
print("raw cookies:", cookies)

cookies = cookies.get('cookies', {})
cookies_str = cookies.get('cookies', {}).split('; ')

print("parsed cookies:", cookies)
cookies_dict = {}
for cookie in cookies_str:
spt = cookie.split('=')
if len(spt) == 2:
cookies_dict[spt[0]] = spt[1]

await ob11_auto_callback(cookies)
await ob11_auto_callback(cookies_dict)

return cookies
return cookies_dict


if __name__ == '__main__':
Expand Down

0 comments on commit 0c3039a

Please sign in to comment.