Advertisement
ghiwar

Douyin video downloader

Jan 19th, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Array untuk menyimpan URL
  2. const videoUrls = [];
  3.  
  4. // Cari semua baris dalam tabel
  5. document.querySelectorAll('tbody tr').forEach(row => {
  6.     // Cek apakah kolom pertama mengandung teks "Video URL-No Watermark"
  7.     const firstCell = row.querySelector('td span');
  8.     if (firstCell && firstCell.textContent.trim() === 'Video URL-No Watermark') {
  9.         // Ambil elemen <a> di kolom kedua
  10.         const linkElement = row.querySelector('td a');
  11.         if (linkElement) {
  12.             // URL dari atribut href
  13.             const videoUrl = linkElement.getAttribute('href');
  14.             console.log("Video URL (No Watermark):", videoUrl);
  15.            
  16.             // Tambahkan URL ke array
  17.             videoUrls.push(videoUrl);
  18.         }
  19.     }
  20. });
  21.  
  22. // Simpan URL ke file teks dan unduh
  23. if (videoUrls.length > 0) {
  24.     const blob = new Blob([videoUrls.join('\n')], { type: 'text/plain' });
  25.     const link = document.createElement('a');
  26.     link.href = URL.createObjectURL(blob);
  27.     link.download = 'video_urls.txt';
  28.     link.click();
  29.     console.log('File berhasil dibuat dan siap diunduh!');
  30. } else {
  31.     console.log('Tidak ada URL yang ditemukan.');
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement