mirror of
https://github.com/xfgryujk/blivechat.git
synced 2024-12-26 12:50:33 +08:00
开放平台签名使用更难碰撞的随机数
This commit is contained in:
parent
33d3303ff1
commit
d79738441c
@ -5,8 +5,8 @@ import hashlib
|
||||
import hmac
|
||||
import json
|
||||
import logging
|
||||
import random
|
||||
import re
|
||||
import uuid
|
||||
from typing import *
|
||||
|
||||
import aiohttp
|
||||
@ -89,7 +89,7 @@ async def request_open_live(url, body: dict, *, ignore_rate_limit=False) -> dict
|
||||
'x-bili-accesskeyid': cfg.open_live_access_key_id,
|
||||
'x-bili-content-md5': hashlib.md5(body_bytes).hexdigest(),
|
||||
'x-bili-signature-method': 'HMAC-SHA256',
|
||||
'x-bili-signature-nonce': str(random.randint(0, 999999999)),
|
||||
'x-bili-signature-nonce': uuid.uuid4().hex,
|
||||
'x-bili-signature-version': '1.0',
|
||||
'x-bili-timestamp': str(int(datetime.datetime.now().timestamp())),
|
||||
}
|
||||
|
2
blivedm
2
blivedm
@ -1 +1 @@
|
||||
Subproject commit 5525bf5419e282f4d0cc7b03cc1e0fd22cee7a73
|
||||
Subproject commit fc55b75dab95ca65700f26a145fc76d7ef05eef1
|
Loading…
Reference in New Issue
Block a user