-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
第一个版本,看能帮到谁
- Loading branch information
Showing
2 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,311 @@ | ||
import json | ||
import time | ||
# 读取 JSON 文件 | ||
|
||
with open('你的2.2文件.json', 'r',encoding='utf-8') as f: | ||
data = json.load(f) | ||
data_head={ | ||
"info": { | ||
"export_timestamp": 1721974439, | ||
"export_app": "Snap Hutao", | ||
"export_app_version": "1.10.7.0", | ||
"version": "v4.0" | ||
}, | ||
"hk4e": [ | ||
{ | ||
"uid": "", | ||
"timezone": 0 | ||
} | ||
] | ||
} | ||
data_json={ | ||
"(test)穿模测试": 10008, | ||
"无锋剑": 11101, | ||
"银剑": 11201, | ||
"冷刃": 11301, | ||
"黎明神剑": 11302, | ||
"旅行剑": 11303, | ||
"暗铁剑": 11304, | ||
"吃虎鱼刀": 11305, | ||
"飞天御剑": 11306, | ||
"西风剑": 11401, | ||
"笛剑": 11402, | ||
"祭礼剑": 11403, | ||
"宗室长剑": 11404, | ||
"匣里龙吟": 11405, | ||
"试作斩岩": 11406, | ||
"铁蜂刺": 11407, | ||
"黑岩长剑": 11408, | ||
"黑剑": 11409, | ||
"暗巷闪光": 11410, | ||
"降临之剑": 11412, | ||
"腐殖之剑": 11413, | ||
"天目影打刀": 11414, | ||
"辰砂之纺锤": 11415, | ||
"笼钓瓶一心": 11416, | ||
"原木刀": 11417, | ||
"西福斯的月光": 11418, | ||
"「一心传」名刀": 11421, | ||
"东花坊时雨": 11422, | ||
"狼牙": 11424, | ||
"海渊终曲": 11425, | ||
"灰河渡手": 11426, | ||
"船坞长剑": 11427, | ||
"水仙十字之剑": 11429, | ||
"风鹰剑": 11501, | ||
"天空之刃": 11502, | ||
"苍古自由之誓": 11503, | ||
"斫峰之刃": 11504, | ||
"磐岩结绿": 11505, | ||
"雾切之回光": 11509, | ||
"波乱月白经津": 11510, | ||
"圣显之钥": 11511, | ||
"裁叶萃光": 11512, | ||
"静水流涌之辉": 11513, | ||
"有乐御簾切": 11514, | ||
"赦罪": 11515, | ||
"训练大剑": 12101, | ||
"佣兵重剑": 12201, | ||
"铁影阔剑": 12301, | ||
"沐浴龙血的剑": 12302, | ||
"白铁大剑": 12303, | ||
"石英大剑": 12304, | ||
"以理服人": 12305, | ||
"飞天大御剑": 12306, | ||
"西风大剑": 12401, | ||
"钟剑": 12402, | ||
"祭礼大剑": 12403, | ||
"宗室大剑": 12404, | ||
"雨裁": 12405, | ||
"试作古华": 12406, | ||
"白影剑": 12407, | ||
"黑岩斩刀": 12408, | ||
"螭骨剑": 12409, | ||
"千岩古剑": 12410, | ||
"雪葬的星银": 12411, | ||
"衔珠海皇": 12412, | ||
"桂木斩长正": 12414, | ||
"玛海菈的水色": 12415, | ||
"恶王丸": 12416, | ||
"森林王器": 12417, | ||
"饰铁之花": 12418, | ||
"聊聊棒": 12424, | ||
"浪影阔剑": 12425, | ||
"「究极霸王超级魔剑」": 12426, | ||
"便携动力锯": 12427, | ||
"天空之傲": 12501, | ||
"狼的末路": 12502, | ||
"松籁响起之时": 12503, | ||
"无工之剑": 12504, | ||
"赤角石溃杵": 12510, | ||
"苇海信标": 12511, | ||
"裁断": 12512, | ||
"新手长枪": 13101, | ||
"铁尖枪": 13201, | ||
"白缨枪": 13301, | ||
"钺矛": 13302, | ||
"黑缨枪": 13303, | ||
"「旗杆」": 13304, | ||
"匣里灭辰": 13401, | ||
"试作星镰": 13402, | ||
"流月针": 13403, | ||
"黑岩刺枪": 13404, | ||
"决斗之枪": 13405, | ||
"千岩长枪": 13406, | ||
"西风长枪": 13407, | ||
"宗室猎枪": 13408, | ||
"龙脊长枪": 13409, | ||
"喜多院十文字": 13414, | ||
"「渔获」": 13415, | ||
"断浪长鳍": 13416, | ||
"贯月矢": 13417, | ||
"风信之锋": 13419, | ||
"峡湾长歌": 13424, | ||
"公义的酬报": 13425, | ||
"沙中伟贤的对答": 13426, | ||
"勘探钻机": 13427, | ||
"护摩之杖": 13501, | ||
"天空之脊": 13502, | ||
"贯虹之槊": 13504, | ||
"和璞鸢": 13505, | ||
"息灾": 13507, | ||
"薙草之稻光": 13509, | ||
"赤沙之杖": 13511, | ||
"赤月之形": 13512, | ||
"学徒笔记": 14101, | ||
"口袋魔导书": 14201, | ||
"魔导绪论": 14301, | ||
"讨龙英杰谭": 14302, | ||
"异世界行记": 14303, | ||
"翡玉法球": 14304, | ||
"甲级宝珏": 14305, | ||
"琥珀玥": 14306, | ||
"西风秘典": 14401, | ||
"流浪乐章": 14402, | ||
"祭礼残章": 14403, | ||
"宗室秘法录": 14404, | ||
"匣里日月": 14405, | ||
"试作金珀": 14406, | ||
"万国诸海图谱": 14407, | ||
"黑岩绯玉": 14408, | ||
"昭心": 14409, | ||
"暗巷的酒与诗": 14410, | ||
"忍冬之果": 14412, | ||
"嘟嘟可故事集": 14413, | ||
"白辰之环": 14414, | ||
"证誓之明瞳": 14415, | ||
"流浪的晚星": 14416, | ||
"盈满之实": 14417, | ||
"遗祀玉珑": 14424, | ||
"纯水流华": 14425, | ||
"无垠蔚蓝之歌": 14426, | ||
"天空之卷": 14501, | ||
"四风原典": 14502, | ||
"尘世之锁": 14504, | ||
"碧落之珑": 14505, | ||
"不灭月华": 14506, | ||
"神乐之真意": 14509, | ||
"千夜浮梦": 14511, | ||
"图莱杜拉的回忆": 14512, | ||
"金流监督": 14513, | ||
"万世流涌大典": 14514, | ||
"鹤鸣余音": 14515, | ||
"猎弓": 15101, | ||
"历练的猎弓": 15201, | ||
"鸦羽弓": 15301, | ||
"神射手之誓": 15302, | ||
"反曲弓": 15303, | ||
"弹弓": 15304, | ||
"信使": 15305, | ||
"黑檀弓": 15306, | ||
"西风猎弓": 15401, | ||
"绝弦": 15402, | ||
"祭礼弓": 15403, | ||
"宗室长弓": 15404, | ||
"弓藏": 15405, | ||
"试作澹月": 15406, | ||
"钢轮弓": 15407, | ||
"黑岩战弓": 15408, | ||
"苍翠猎弓": 15409, | ||
"暗巷猎手": 15410, | ||
"落霞": 15411, | ||
"幽夜华尔兹": 15412, | ||
"风花之颂": 15413, | ||
"破魔之弓": 15414, | ||
"掠食者": 15415, | ||
"曚云之月": 15416, | ||
"王下近侍": 15417, | ||
"竭泽": 15418, | ||
"鹮穿之喙": 15419, | ||
"烈阳之嗣": 15424, | ||
"静谧之曲": 15425, | ||
"筑云": 15426, | ||
"测距规": 15427, | ||
"天空之翼": 15501, | ||
"阿莫斯之弓": 15502, | ||
"终末嗟叹之诗": 15503, | ||
"冬极白星": 15507, | ||
"若水": 15508, | ||
"飞雷之弦振": 15509, | ||
"猎人之径": 15511, | ||
"最初的大魔术": 15512, | ||
"白雨心弦": 15513, | ||
"(test)竿测试": 20001, | ||
"神里绫华": 10000002, | ||
"琴": 10000003, | ||
"旅行者": 10000007, | ||
"丽莎": 10000006, | ||
"芭芭拉": 10000014, | ||
"凯亚": 10000015, | ||
"迪卢克": 10000016, | ||
"雷泽": 10000020, | ||
"安柏": 10000021, | ||
"温迪": 10000022, | ||
"香菱": 10000023, | ||
"北斗": 10000024, | ||
"行秋": 10000025, | ||
"魈": 10000026, | ||
"凝光": 10000027, | ||
"可莉": 10000029, | ||
"钟离": 10000030, | ||
"菲谢尔": 10000031, | ||
"班尼特": 10000032, | ||
"达达利亚": 10000033, | ||
"诺艾尔": 10000034, | ||
"七七": 10000035, | ||
"重云": 10000036, | ||
"甘雨": 10000037, | ||
"阿贝多": 10000038, | ||
"迪奥娜": 10000039, | ||
"莫娜": 10000041, | ||
"刻晴": 10000042, | ||
"砂糖": 10000043, | ||
"辛焱": 10000044, | ||
"罗莎莉亚": 10000045, | ||
"胡桃": 10000046, | ||
"枫原万叶": 10000047, | ||
"烟绯": 10000048, | ||
"宵宫": 10000049, | ||
"托马": 10000050, | ||
"优菈": 10000051, | ||
"雷电将军": 10000052, | ||
"早柚": 10000053, | ||
"珊瑚宫心海": 10000054, | ||
"五郎": 10000055, | ||
"九条裟罗": 10000056, | ||
"荒泷一斗": 10000057, | ||
"八重神子": 10000058, | ||
"鹿野院平藏": 10000059, | ||
"夜兰": 10000060, | ||
"绮良良": 10000061, | ||
"埃洛伊": 10000062, | ||
"申鹤": 10000063, | ||
"云堇": 10000064, | ||
"久岐忍": 10000065, | ||
"神里绫人": 10000066, | ||
"柯莱": 10000067, | ||
"多莉": 10000068, | ||
"提纳里": 10000069, | ||
"妮露": 10000070, | ||
"赛诺": 10000071, | ||
"坎蒂丝": 10000072, | ||
"纳西妲": 10000073, | ||
"莱依拉": 10000074, | ||
"流浪者": 10000075, | ||
"珐露珊": 10000076, | ||
"瑶瑶": 10000077, | ||
"艾尔海森": 10000078, | ||
"迪希雅": 10000079, | ||
"米卡": 10000080, | ||
"卡维": 10000081, | ||
"白术": 10000082, | ||
"琳妮特": 10000083, | ||
"林尼": 10000084, | ||
"菲米尼": 10000085, | ||
"莱欧斯利": 10000086, | ||
"那维莱特": 10000087, | ||
"夏洛蒂": 10000088, | ||
"芙宁娜": 10000089, | ||
"夏沃蕾": 10000090, | ||
"娜维娅": 10000091, | ||
"嘉明": 10000092, | ||
"闲云": 10000093, | ||
"千织": 10000094, | ||
"希格雯": 10000095, | ||
"阿蕾奇诺": 10000096, | ||
"赛索斯": 10000097, | ||
"克洛琳德": 10000098 | ||
} | ||
|
||
for i in data['list']: | ||
# print(i) | ||
item_name = i['name'] | ||
i['item_id'] = data_json[item_name] | ||
data_head['hk4e'][0].update({'list': data['list']}) | ||
data_head['info']['export_timestamp']=int(time.time()) | ||
data_head['hk4e'][0]['uid']=str(data['info']['uid']) | ||
print(data) | ||
fild_newName =data['list'][0]['uid']+"UIGF.json" | ||
|
||
with open(fild_newName, "w",encoding='utf-8') as file: | ||
json.dump(data_head, file) |