-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDAWNLOAD FROM NET.html
138 lines (128 loc) · 4.12 KB
/
DAWNLOAD FROM NET.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>GMAV COLLECTION </head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video to MP3/MP4 Converter</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f4f4f9;
}
.container {
text-align: center;
background: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
max-width: 400px;
}
input {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 10px 20px;
background-color: #28a745;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #218838;
}
table {
width: 100%;
margin-top: 20px;
border-collapse: collapse;
}
th, td {
border: 1px solid #ccc;
padding: 8px;
text-align: left;
}
th {
background-color: #f4f4f9;
}
.footer {
margin-top: 20px;
font-size: 12px;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>Video to MP3/MP4 Converter</h1>
<form id="converterForm">
<input type="url" id="videoUrl" placeholder="Enter video URL" required>
<select id="format">
<option value="mp3">MP3</option>
<option value="mp4">MP4</option>
</select>
<button type="submit">Convert</button>
</form>
<div id="result" style="margin-top: 20px;"></div>
<h2>Most Downloaded</h2>
<table>
<thead>
<tr>
<th>Video Title</th>
<th>Downloads</th>
</tr>
</thead>
<tbody id="mostDownloaded">
<!-- Rows will be dynamically added here -->
<tr>
<td>Sample Video 1</td>
<td>1234</td>
</tr>
<tr>
<td>Sample Video 2</td>
<td>987</td>
</tr>
</tbody>
</table>
</div>
<script>
const form = document.getElementById('converterForm');
const resultDiv = document.getElementById('result');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const videoUrl = document.getElementById('videoUrl').value;
const format = document.getElementById('format').value;
resultDiv.innerHTML = 'Processing...';
try {
const response = await fetch('https://your-backend-api.com/convert', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: videoUrl, format: format })
});
if (!response.ok) {
throw new Error('Failed to process the video.');
}
const data = await response.json();
resultDiv.innerHTML = `<a href="${data.downloadUrl}" download>Download ${format.toUpperCase()}</a>`;
} catch (error) {
resultDiv.innerHTML = `Error: ${error.message}`;
}
});
</script>
<div class="footer">
<p>© GIHOZO MIREMBE- All rights reserved. Based in Rwanda.</p>
</div>
</body>
</html>