🎨 适配星穹铁道特殊情况 (#14)

* 适配星穹铁道过码

* 🚨 `pre-commit-ci`修复格式错误

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
RBAmeto 2023-05-22 00:28:11 +08:00 committed by GitHub
parent cfc0944c52
commit ed846b5851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,12 +202,20 @@ class BaseMysApi:
raw_data = {}
for _ in range(2):
if 'Cookie' in header and header['Cookie'] in self.chs:
# header['x-rpc-challenge']=self.chs.pop(header['Cookie'])
if self.is_sr:
header['x-rpc-challenge'] = self.chs.pop(
header['Cookie']
)
if isinstance(params, Dict):
header['DS'] = get_ds_token(
'&'.join(
[f'{k}={v}' for k, v in params.items()]
)
)
header['x-rpc-challenge_game'] = '6' if self.is_sr else '2'
header['x-rpc-page'] = (
'3.1.3_#/rpg' if self.is_sr else '3.1.3_#/ys'
)
async with client.request(
method,
url=url,