genshin.py icon indicating copy to clipboard operation
genshin.py copied to clipboard

Fixed getting authkey not working after genshin 3.0 update

Open nitolar opened this issue 1 year ago • 1 comments

It took so long to make everything correct 💀

nitolar avatar Sep 11 '22 18:09 nitolar

Might be a good idea to support something similar to the approach for cn versions https://github.com/biuuu/genshin-wish-export/blob/main/src/main/getData.js#L155-L164

const logText = await fs.readFile(`${userPath}/AppData/LocalLow/miHoYo/${name}/output_log.txt`, 'utf8')
const gamePathMch = logText.match(/\w:\/.+(GenshinImpact_Data|YuanShen_Data)/)
if (gamePathMch) {
    const cacheText = await fs.readFile(path.join(gamePathMch[0], '/webCaches/Cache/Cache_Data/data_2'), 'utf8')
    const urlMch = cacheText.match(/https.+?game_biz=hk4e_\w+/g)
    if (urlMch) {
        return urlMch[urlMch.length - 1]
    }
}

thesadru avatar Sep 11 '22 21:09 thesadru

Please run nox mate, I can't merge with lint errors.

thesadru avatar Sep 23 '22 19:09 thesadru

Haven't looked here for a while so I haven't seen message before

nitolar avatar Sep 23 '22 20:09 nitolar