Update index.js
Browse files
index.js
CHANGED
|
@@ -394,23 +394,22 @@ async function twitterDL(url) {
|
|
| 394 |
$('.dl-action a').each((index, element) => {
|
| 395 |
const format = $(element).text().trim();
|
| 396 |
const url = $(element).attr('href');
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
}
|
| 400 |
-
});
|
| 401 |
-
|
| 402 |
-
$('a').each((index, element) => {
|
| 403 |
-
const href = $(element).attr('href');
|
| 404 |
-
if (href && href !== '/' && href !== '#') {
|
| 405 |
-
downloads.push(href);
|
| 406 |
}
|
| 407 |
});
|
| 408 |
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 412 |
|
| 413 |
-
return {
|
| 414 |
} catch (error) {
|
| 415 |
return error;
|
| 416 |
}
|
|
|
|
| 394 |
$('.dl-action a').each((index, element) => {
|
| 395 |
const format = $(element).text().trim();
|
| 396 |
const url = $(element).attr('href');
|
| 397 |
+
if (url !== '#') {
|
| 398 |
+
downloads.push({ format, url });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
}
|
| 400 |
});
|
| 401 |
|
| 402 |
+
// Jika tidak ada unduhan dari load pertama, coba load kedua
|
| 403 |
+
if (downloads.length === 0) {
|
| 404 |
+
$('a').each((index, element) => {
|
| 405 |
+
const href = $(element).attr('href');
|
| 406 |
+
if (href && href !== '/' && href !== '#') {
|
| 407 |
+
downloads.push(href);
|
| 408 |
+
}
|
| 409 |
+
});
|
| 410 |
+
}
|
| 411 |
|
| 412 |
+
return { downloads };
|
| 413 |
} catch (error) {
|
| 414 |
return error;
|
| 415 |
}
|