[^<]*总时数\s*([\d,]+)\s*小时";
string patternEn = @"
.*?
[^<]*([\d,]+)\s+hrs";
var matches = Regex.Matches(htmlContent, pattern, RegexOptions.Singleline | RegexOptions.IgnoreCase);
if (matches.Count == 0)
{
matches = Regex.Matches(htmlContent, patternEn, RegexOptions.Singleline | RegexOptions.IgnoreCase);
}
foreach (Match match in matches)
{
if (match.Groups.Count >= 3)
{
string gameName = match.Groups[2].Value.Trim();
string hoursStr = match.Groups[3].Value.Replace(",", "");
if (double.TryParse(hoursStr, out double hours))
{
result[gameName] = hours;
}
}
}
if (result.ContainsKey("Squad"))
{
return ((int)result["Squad"], nickname);
}
}
catch (Exception ex)
{
RainOpsLog.Log($"[Steam爬虫助手] 解析异常 ({steamid}): {ex.Message}");
}
return (0, "");
}
}
}