From fc55b75dab95ca65700f26a145fc76d7ef05eef1 Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 28 Nov 2023 22:28:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E6=94=BE=E5=B9=B3=E5=8F=B0=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E4=BD=BF=E7=94=A8=E6=9B=B4=E9=9A=BE=E7=A2=B0=E6=92=9E?= =?UTF-8?q?=E7=9A=84=E9=9A=8F=E6=9C=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blivedm/clients/open_live.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blivedm/clients/open_live.py b/blivedm/clients/open_live.py index 5c6169a..0b00a2f 100644 --- a/blivedm/clients/open_live.py +++ b/blivedm/clients/open_live.py @@ -5,7 +5,7 @@ import hashlib import hmac import json import logging -import random +import uuid from typing import * import aiohttp @@ -119,7 +119,7 @@ class OpenLiveClient(ws_base.WebSocketClientBase): 'x-bili-accesskeyid': self._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())), }