Update index.js
Browse files393 unmodified lines394395396397398399400401402403404405397398399400401409410411402403404405406407408409410411413412413414415393 unmodified lines $('.dl-action a').each((index, element) => { const format = $(element).text().trim(); const url = $(element).attr('href'); if (url !== '#') { downloads.push({ format, url }); } });
$('a').each((index, element) => { const href = $(element).attr('href'); if (href && href !== '/' && href !== '#') { downloads.push(href); if (url !== '#') { downloads.push({ format, url }); } });
const result = { downloads }; // Jika tidak ada unduhan dari load pertama, coba load kedua if (downloads.length === 0) { $('a').each((index, element) => { const href = $(element).attr('href'); if (href && href !== '/' && href !== '#') { downloads.push(href); } }); }
return { result }; return { downloads }; } catch (error) { return error; }index.js+12-13