Skip to content

Commit

Permalink
fix(Aist2Strm):修复_sign方法中data解码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Akimio521 committed Jul 4, 2024
1 parent 23fd85a commit 1a5d688
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/Alist2Strm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hashlib
import base64
import asyncio
from urllib.parse import unquote
from requests import Session
from aiohttp import ClientSession as AsyncSession
from pathlib import Path
Expand Down Expand Up @@ -124,7 +125,7 @@ async def _processer(self) -> None:

async with asyncio.TaskGroup() as tg:
for alist_path_cls in fs.rglob("*.*"):
await tg.create_task(self._file_processer(alist_path_cls))
tg.create_task(self._file_processer(alist_path_cls))

if self.session:
if self.async_mode:
Expand Down Expand Up @@ -214,6 +215,7 @@ def _sign(self, secret_key: Optional[str], data: str) -> str:
if secret_key == "" or secret_key == None:
return ""

data = unquote(data)
h = hmac.new(secret_key.encode(), digestmod=hashlib.sha256)
expire_time_stamp = str(0)
h.update((data + ":" + expire_time_stamp).encode())
Expand Down

0 comments on commit 1a5d688

Please sign in to comment.