mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2024-11-25 22:50:22 +08:00
feat: check url from cache
1. NEVER MODIFY THE `yarn.lock` YOU GET. YOU NEVER KNOW WHAT IT CRASHES 2. FUCK REGEX
This commit is contained in:
parent
5f9fc94709
commit
681e664e32
@ -139,7 +139,19 @@ const readLog = async () => {
|
|||||||
const promises = logPaths.map(async logpath => {
|
const promises = logPaths.map(async logpath => {
|
||||||
const logText = await fs.readFile(logpath, 'utf8')
|
const logText = await fs.readFile(logpath, 'utf8')
|
||||||
const url = logText.match(/https:\/\/.*?\/info/g)
|
const url = logText.match(/https:\/\/.*?\/info/g)
|
||||||
return getLatestUrl(url)
|
if (url) {
|
||||||
|
return getLatestUrl(url)
|
||||||
|
}
|
||||||
|
const gamePathMch = logText.match(/([A-Z]:\/.*?\/)(?=ZenlessZoneZero_Data)/i)
|
||||||
|
if (gamePathMch) {
|
||||||
|
const[cacheText, cacheFile] = await getCacheText("F:/zzz_game/ZenlessZoneZero_Data") /* getCacheText(gamePathMch[0]+"/ZenlessZoneZero_Data") */
|
||||||
|
const urlMch = cacheText.match(/https.+?authkey=.+?end_id=/g)
|
||||||
|
if (urlMch) {
|
||||||
|
cacheFolder = cacheFile.replace(/Cache_Data[/\\]data_2$/, '')
|
||||||
|
return getLatestUrl(urlMch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
const result = await Promise.all(promises)
|
const result = await Promise.all(promises)
|
||||||
for (let url of result) {
|
for (let url of result) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user