Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chinshin committed Jun 4, 2020
1 parent 8d9d84e commit 1a423b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ CoolQ HTTP API请更新至 [最新版本4.10](https://github.com/richardchien/co

## 更新记录

**2020.06.04更新:** `koudai48.py`, `setting.py` **[该版本未经测试!]** bug fix

**2020.06.03更新:** `koudai48.py` **[该版本未经测试!]** 增加对v6.0.13的支持,谢谢房爷lgy和总工的大力付出

**2019.06.09更新:** `main.py``koudai48.py` 增加2019总选投票播报
Expand Down
2 changes: 1 addition & 1 deletion koudai48.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def getMainpage(self):
'ownerId': int(ownerId),
'roomId': int(roomId)
}
header = self.commonHeader(True, False)
header = self.commonHeader()
try:
response = requests.post(
url,
Expand Down
15 changes: 14 additions & 1 deletion setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import requests
import json
import urllib3
import hashlib
from base64 import b64encode
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


Expand All @@ -21,6 +23,16 @@ def idol_name():
return str(idol_name)


def getPa():
t = int(time.time())*1000
r = random.randint(1000, 9999)
salt = "K4bMWJawAtnyyTNOa70S"
s = "{}{}{}".format(t, r, salt).encode("utf-8")
m = hashlib.md5(s).hexdigest()
pa = b64encode("{},{},{}".format(t, r, m).encode("utf-8"))
return pa


# ----------------------摩点微打赏设置----------------------


Expand Down Expand Up @@ -187,7 +199,8 @@ def token_verify():
'appInfo': '{"vendor":"apple","deviceId":"0","appVersion":"6.0.0","appBuild":"190409","osVersion":"12.2.0","osType":"ios","deviceName":"iphone","os":"ios"}',
'Content-Type': 'application/json;charset=utf-8',
'Connection': 'keep-alive',
'token': token
'token': token,
'pa': getPa(),
}
response = requests.post(
url,
Expand Down

0 comments on commit 1a423b8

Please sign in to comment.