TikTok Video Downloader
Enter the TikTok video URL here:
body { font-family: sans-serif; margin: 20px; } h1 { font-size: 24px; margin-top: 0; } p { margin-bottom: 10px; } input { width: 500px; padding: 10px; border: 1px solid #ccc; } button { margin-top: 10px; padding: 10px 20px; border: 1px solid #ccc; background-color: #000; color: #fff; cursor: pointer; } #download-status { margin-top: 10px; } const downloadVideo = () => { // Get the video URL from the input field. const videoUrl = document.getElementById("video-url").value; // Show a loading message. document.getElementById("download-status").innerHTML = "Downloading..."; // Send a request to the TikTok API to get the video without the watermark. fetch(`https://api.tiktok.com/v2/video/url?url=${videoUrl}`) .then((response) => response.json()) .then((data) => { // Get the video URL without the watermark from the response. const videoWithoutWatermarkUrl = data.video_url_without_watermark; // Create a new anchor element and set the href attribute to the video URL without the watermark. const anchor = document.createElement("a"); anchor.href = videoWithoutWatermarkUrl; // Append the anchor element to the body of the document. document.body.appendChild(anchor); // Click the anchor element to download the video. anchor.click(); // Hide the loading message. document.getElementById("download-status").innerHTML = ""; }); };
0 Comments