Add ffmpeg executables and update project structure
This commit is contained in:
+11
-3
@@ -15,11 +15,14 @@
|
||||
.container {
|
||||
margin-top: 50px;
|
||||
}
|
||||
input[type="url"] {
|
||||
input[type="url"], select {
|
||||
width: 80%;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
select {
|
||||
width: auto;
|
||||
}
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
background-color: #ff0000;
|
||||
@@ -42,7 +45,11 @@
|
||||
<h1>YouTube Video Downloader</h1>
|
||||
<form id="downloadForm">
|
||||
<input type="url" id="videoUrl" placeholder="Enter YouTube URL" required>
|
||||
<button type="submit">Download Video</button>
|
||||
<select id="downloadType">
|
||||
<option value="video">Video</option>
|
||||
<option value="audio">Audio (MP3)</option>
|
||||
</select>
|
||||
<button type="submit">Download</button>
|
||||
</form>
|
||||
<div id="status"></div>
|
||||
</div>
|
||||
@@ -51,11 +58,12 @@
|
||||
document.getElementById('downloadForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const url = document.getElementById('videoUrl').value;
|
||||
const downloadType = document.getElementById('downloadType').value;
|
||||
const status = document.getElementById('status');
|
||||
|
||||
status.textContent = 'Starting download...';
|
||||
|
||||
fetch('http://localhost:5000/download?url=' + encodeURIComponent(url))
|
||||
fetch(`http://localhost:5000/download?url=${encodeURIComponent(url)}&type=${downloadType}`)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
return response.text().then(text => {
|
||||
|
||||
Reference in New Issue
Block a user