幻能边境解包求助

正在改…不过卡在setting那个文件里有几个404然后就自己搓轮子

import json

BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
BASE64_VALUES = [0] * 128
for idx, char in enumerate(BASE64_CHARS):
    BASE64_VALUES[ord(char)] = idx

HEX_CHARS = list('0123456789abcdef')
_t = ['', '', '', '']
UUID_TEMPLATE = _t + _t + ['-'] + _t + ['-'] + _t + ['-'] + _t + ['-'] + _t + _t + _t
INDICES = [i for i, x in enumerate(UUID_TEMPLATE) if x != '-']

def decode_uuid(base64_str):
    if len(base64_str) != 22:
        return base64_str
    result = UUID_TEMPLATE.copy()
    result[0] = base64_str[0]
    result[1] = base64_str[1]

    j = 2
    for i in range(2, 22, 2):
        lhs = BASE64_VALUES[ord(base64_str[i])]
        rhs = BASE64_VALUES[ord(base64_str[i + 1])]

        result[INDICES[j]] = HEX_CHARS[lhs >> 2]
        j += 1
        result[INDICES[j]] = HEX_CHARS[((lhs & 3) << 2) | (rhs >> 4)]
        j += 1
        result[INDICES[j]] = HEX_CHARS[rhs & 0xF]
        j += 1

    return ''.join(result)

with open(r"C:\Users\username\Downloads\cc.config.cc2e9.json", 'r', encoding='utf-8') as f:
    data = json.load(f)

uuids = data['uuids']
versions = data['versions']['import']

version_map = {}
for i in range(0, len(versions), 2):
    line = versions[i]
    hash_ = versions[i + 1]
    version_map[line] = hash_

urls = []
for idx, short_id in enumerate(uuids):
    try:
        decoded = decode_uuid(short_id)
    except Exception as e:
        print(f"解析失败 uuid[{idx}]: {short_id} 错误: {e}")
        continue

    if idx not in version_map:
        print(f"跳过没有版本的uuid[{idx}]: {short_id}")
        continue

    hash_ = version_map[idx]
    url = f"https://eowgame.jcbgame.com/eow-jp-game/bundle/anima/import/{decoded[:2]}/{decoded}.{hash_}.json"
    urls.append(url)

with open('testurl.txt', 'w', encoding='utf-8') as f:
    f.write('\n'.join(urls))

print(f"{len(urls)} -> testurl.txt")

这个算个半成品导出部分json的url为了后续写多合一下载器打算尽量精简一点还是感谢大佬的思路