1- import requests
2- import os
3- if os .path .exists ("character_table.json" ):
4- os .remove ("character_table.json" )
5- else :
6- print ("The file character_table.json does not exist" )
7-
8- if os .path .exists ("skin_table.json" ):
9- os .remove ("skin_table.json" )
10- else :
11- print ("The file skin_table.json does not exist" )
12- print ("downloading skins&characters" )
13- url = 'https://cdn.jsdelivr.net/gh/Kengxxiao/ArknightsGameData@master/zh_CN/gamedata/excel/character_table.json'
14- r = requests .get (url )
15- with open ("character_table.json" , "wb" ) as code :
16- code .write (r .content )
17- url = 'https://cdn.jsdelivr.net/gh/Kengxxiao/ArknightsGameData@master/zh_CN/gamedata/excel/skin_table.json'
18- r = requests .get (url )
19- with open ("skin_table.json" , "wb" ) as code :
20- code .write (r .content )
1+ import requests
2+ import os
3+ if os .path .exists ("character_table.json" ):
4+ os .remove ("character_table.json" )
5+ print ("The file character_table.json already exists.Updating..." )
6+ else :
7+ print ("The file character_table.json does not exist.Downloading..." )
8+
9+ if os .path .exists ("skin_table.json" ):
10+ os .remove ("skin_table.json" )
11+ print ("The file skin_table.json already exists.Updating..." )
12+ else :
13+ print ("The file character_table.json does not exist.Downloading..." )
14+ print ("downloading Skins&Characters" )
15+ url = 'https://cdn.jsdelivr.net/gh/Kengxxiao/ArknightsGameData@master/zh_CN/gamedata/excel/character_table.json'
16+ r = requests .get (url )
17+ with open ("character_table.json" , "wb" ) as code :
18+ code .write (r .content )
19+ url = 'https://cdn.jsdelivr.net/gh/Kengxxiao/ArknightsGameData@master/zh_CN/gamedata/excel/skin_table.json'
20+ r = requests .get (url )
21+ with open ("skin_table.json" , "wb" ) as code :
22+ code .write (r .content )
23+ print ("Successfully updated.Enjoy!" )
0 commit comments