SR 1.0.5 CN

This commit is contained in:
Rene 2023-04-28 15:15:27 +07:00
parent 1b073cea82
commit bfdf209611
2 changed files with 122 additions and 0 deletions

92
StarRail CN/README.md Normal file
View File

@ -0,0 +1,92 @@
```
{
"pre_download_game":null,
"latest":{
"game":{
"latest":{
"name":"",
"version":"1.0.5",
"path":"https://autopatchcn.bhsr.com/client/cn/20230413215209_VC9JD8S2WrcciZFu/StarRail_1.0.5.zip",
"size":"21810485760",
"md5":"58fad1765e8474cba45cbba566010817",
"entry":"StarRail.exe",
"voice_packs":[],
"decompressed_path":"",
"segments":[],
"package_size":"10900000000"
},
"diffs":[]
},
"plugin":{
"plugins":[
{
"name":"DXSETUP.zip",
"version":"",
"path":"https://autopatchcn.bhsr.com/client/DXSETUP.zip",
"size":"100647892",
"md5":"ca2ac3835d7d7da6cb8624fefb177083",
"entry":""
}
],
"version":"1"
},
"web_url":"https://hkrpg.mihoyo.com/launcher",
"force_update":null,
"pre_download_game":null,
"deprecated_packages":[
{
"name":"StarRail_0.90.0.zip",
"md5":"5f79bb79d37f4b714e8ec8ccc59ef705"
},
{
"name":"20230329-2354-BetaLive-3764784-CNPREbetaWin0.90.57-CnTest-0-resign.zip",
"md5":"91d6caf08881b0dba9668c576228f10d"
},
{
"name":"20230329-2354-BetaLive-3764784-CNPREbetaWin0.90.57-CnTest-0-resign_encrypt.zip",
"md5":"059267849fa3fe933650947da5ef9f18"
}
],
"sdk":null,
"deprecated_files":[]
},
"deprecated_packages":[
{
"game":{
"latest":{
"name":"",
"version":"0.90.0",
"path":"https://autopatchos.starrails.com/client/download/20230202113937_NE7YVwlt4XBAMuNL/StarRail_0.90.0.zip",
"size":"19210485760",
"md5":"6717b1560bac650f0dbde4011df6e967",
"entry":"StarRail.exe",
"voice_packs":[],
"decompressed_path":"",
"segments":[],
"package_size":"9600000000"
},
"diffs":[]
},
"plugin":{
"plugins":[
{
"name":"DXSETUP.zip",
"version":"",
"path":"https://autopatchos.starrails.com/client/DXSETUP.zip",
"size":"100647892",
"md5":"ca2ac3835d7d7da6cb8624fefb177083",
"entry":""
}
],
"version":"1"
},
"web_url":"https://starrail.hoyoverse.com/launcher",
"force_update":null,
"pre_download_game":null,
"deprecated_packages":[],
"sdk":null,
"deprecated_files":[]
}
]
}
```

30
StarRail CN/StarRailCN.py Normal file
View File

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
import sys
import json
import requests
import collections
if __name__ == "__main__":
with open('README.md','a+') as readme:
readme.seek(0)
sys.stdout = readme
stringContent=str(requests.get('https://api-launcher-static.mihoyo.com/hkrpg_cn/mdk/launcher/api/resource?channel_id=1&key=6KcVuOkbcqjJomjZ&launcher_id=33&sub_channel_id=1').content,'utf-8')
jsonFile=json.loads(readme.read().strip().strip('```'),object_pairs_hook=collections.OrderedDict)
changed = False
pre_download_game=None
try:
pre_download_game=json.loads(stringContent)['data']['pre_download_game']
except:
pre_download_game=""
if jsonFile['pre_download_game']!=pre_download_game:
jsonFile['pre_download_game']=pre_download_game
changed=True
latest=json.loads(stringContent)['data']
if jsonFile['latest']!=latest:
deprecated_packages=jsonFile['deprecated_packages']
deprecated_packages.append(jsonFile['latest'])
jsonFile['latest']=latest
changed=True
if changed:
readme.seek(0)
readme.truncate()
print('```\n'+json.dumps(jsonFile,ensure_ascii=False,indent=4,separators=(',',':'))+'\n```')