UID:629012251137 帖
2022-09-09 00:27
是不是又更新了,感觉还是不对。
游戏里面打开履历以后,马上获取应该是最后一个 https://webstatic.mihoyo.com/hk4e 的URL,而且最后还得加上#/log。
游戏里面打开履历以后,马上获取应该是最后一个 https://webstatic.mihoyo.com/hk4e 的URL,而且最后还得加上#/log。
$logLocation = "%userprofile%\AppData\LocalLow\miHoYo\Genshin Impact\output_log.txt";$logLocationChina = "%userprofile%\AppData\LocalLow\miHoYo\$([char]0x539f)$([char]0x795e)\output_log.txt";$reg = $args[0]if ($reg -eq "china") { Write-Host "Using China cache location" $logLocation = $logLocationChina}$tmps = $env:TEMP + '\pm.ps1';if ([System.IO.File]::Exists($tmps)) { ri $tmps}$path = [System.Environment]::ExpandEnvironmentVariables($logLocation);if (-Not [System.IO.File]::Exists($path)) { Write-Host "Cannot find the log file! Make sure to open the wish history first!" -ForegroundColor Red if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Write-Host "Do you want to try to run the script as Administrator? Press [ENTER] to continue, or any key to cancel." $keyInput = [Console]::ReadKey($true).Key if ($keyInput -ne "13") { return } $myinvocation.mycommand.definition > $tmps Start-Process powershell -Verb runAs -ArgumentList "-noexit", $tmps, $reg break } return}$logs = Get-Content -Path $path$m = $logs -match "(?m).:/.+(GenshinImpact_Data|YuanShen_Data)"$m[0] -match "(.:/.+(GenshinImpact_Data|YuanShen_Data))" >$nullif ($matches.Length -eq 0) { Write-Host "Cannot find the wish history url! Make sure to open the wish history first!" -ForegroundColor Red return}$gamedir = $matches[1]$cachefile = "$gamedir/webCaches/Cache/Cache_Data/data_2"$tmpfile = "$env:TEMP/ch_data_2"Copy-Item $cachefile -Destination $tmpfile$content = Get-Content -Encoding UTF8 -Raw $tmpfile$splitted = $content -split "1/0/"$found = $splitted -match "https.+webstatic.mihoyo.com/.+?game_biz=hk4e_(global|cn)"$found = $found[$found.Length - 1] -match "(https.+?game_biz=hk4e_(global|cn))"Remove-Item $tmpfileif (-Not $found) { Write-Host "Cannot find the wish history url! Make sure to open the wish history first!" -ForegroundColor Red return}$wishHistoryUrl = $matches[0] + "#/log"Write-Host $wishHistoryUrlSet-Clipboard -Value $wishHistoryUrlWrite-Host "Link copied to clipboard, paste it back to paimon.moe" -ForegroundColor Green已编辑
登录后可以回复