chore: bump version to 1.3.2
This commit is contained in:
@@ -57,17 +57,23 @@ const scrapeCooldown = async (steamId, steamLoginSecure) => {
|
||||
let expirationDate = undefined;
|
||||
$('table').each((_, table) => {
|
||||
const headers = $(table).find('th').map((_, th) => $(th).text().trim()).get();
|
||||
const expirationIndex = headers.findIndex(h => h.includes('Competitive Cooldown Expiration'));
|
||||
const expirationIndex = headers.findIndex(h => h.includes('Competitive Cooldown Expiration') || h.includes('Cooldown Expiration'));
|
||||
if (expirationIndex !== -1) {
|
||||
const firstRow = $(table).find('tr').not(':has(th)').first();
|
||||
const dateText = firstRow.find('td').eq(expirationIndex).text().trim();
|
||||
if (dateText && dateText !== '') {
|
||||
const cleanDateText = dateText.replace(' GMT', ' UTC');
|
||||
const parsed = new Date(cleanDateText);
|
||||
if (!isNaN(parsed.getTime())) {
|
||||
expirationDate = parsed;
|
||||
const rows = $(table).find('tr').not(':has(th)');
|
||||
rows.each((_, row) => {
|
||||
const dateText = $(row).find('td').eq(expirationIndex).text().trim();
|
||||
if (dateText && dateText !== '') {
|
||||
// Steam uses 'GMT' which some JS engines don't parse well, replace with 'UTC'
|
||||
const cleanDateText = dateText.replace(' GMT', ' UTC');
|
||||
const parsed = new Date(cleanDateText);
|
||||
if (!isNaN(parsed.getTime())) {
|
||||
// We want the newest expiration date found
|
||||
if (!expirationDate || parsed > expirationDate) {
|
||||
expirationDate = parsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (expirationDate && expirationDate.getTime() > Date.now()) {
|
||||
|
||||
Reference in New Issue
Block a user