video
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YouTube Video Downloader</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<style>
body {
background: linear-gradient(to right, #ff4b2b, #ff416c);
min-height: 100vh;
font-family: Arial, sans-serif;
}
.container {
padding-top: 20px;
}
.card {
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.card-header {
background-color: #007bff;
color: white;
text-align: center;
border-radius: 10px 10px 0 0;
}
.btn-custom {
background-color: #28a745;
color: white;
border: none;
}
.btn-custom:hover {
background-color: #218838;
}
.download-links {
margin-top: 20px;
}
.download-links iframe {
width: 100%;
height: 60px;
border: none;
overflow: hidden;
}
</style>
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5>YouTube Video Downloader</h5>
</div>
<div class="card-body">
<div class="form-group">
<label for="videoUrl">Enter YouTube Video URL:</label>
<input type="text" class="form-control" id="videoUrl" placeholder="https://www.youtube.com/watch?v=VIDEO_ID">
</div>
<button class="btn btn-custom btn-block" onclick="generateDownloadLinks()">Generate Download Links</button>
<div class="download-links" id="downloadLinks"></div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
function generateDownloadLinks() {
const videoUrl = document.getElementById('videoUrl').value;
const downloadLinksDiv = document.getElementById('downloadLinks');
downloadLinksDiv.innerHTML = '';
// Basic URL validation
if (!videoUrl.includes('youtube.com') && !videoUrl.includes('youtu.be')) {
downloadLinksDiv.innerHTML = '<p class="text-danger">Please enter a valid YouTube URL.</p>';
return;
}
// Using a third-party loader API (example placeholder)
// Replace with a working API endpoint if available
const formats = ['mp4', 'webm', 'mp3'];
formats.forEach(format => {
const iframe = document.createElement('iframe');
iframe.src = `https://loader.to/api/button/?url=${encodeURIComponent(videoUrl)}&f=${format}`;
iframe.style.width = '100%';
iframe.style.height = '60px';
iframe.style.border = 'none';
iframe.style.marginBottom = '10px';
downloadLinksDiv.appendChild(iframe);
});
}
</script>
</body>
</html>
Comments
Post a Comment