mirror of
https://github.com/xfgryujk/blivedm.git
synced 2024-12-26 12:50:13 +08:00
开放平台签名使用更难碰撞的随机数
This commit is contained in:
parent
5525bf5419
commit
fc55b75dab
@ -5,7 +5,7 @@ import hashlib
|
|||||||
import hmac
|
import hmac
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import random
|
import uuid
|
||||||
from typing import *
|
from typing import *
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@ -119,7 +119,7 @@ class OpenLiveClient(ws_base.WebSocketClientBase):
|
|||||||
'x-bili-accesskeyid': self._access_key_id,
|
'x-bili-accesskeyid': self._access_key_id,
|
||||||
'x-bili-content-md5': hashlib.md5(body_bytes).hexdigest(),
|
'x-bili-content-md5': hashlib.md5(body_bytes).hexdigest(),
|
||||||
'x-bili-signature-method': 'HMAC-SHA256',
|
'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-signature-version': '1.0',
|
||||||
'x-bili-timestamp': str(int(datetime.datetime.now().timestamp())),
|
'x-bili-timestamp': str(int(datetime.datetime.now().timestamp())),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user