ilhamdev commited on
Commit
ebd63ec
·
verified ·
1 Parent(s): b4a8dd2

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +12 -13
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
- if (url !== '#') {
398
- downloads.push({ format, url });
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
- const result = {
410
- downloads
411
- };
 
 
 
 
 
 
412
 
413
- return { result };
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
  }