C50BARZ commited on
Commit
3c0c84b
·
verified ·
1 Parent(s): 3b2e057

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +241 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Yt
3
- emoji: 🌖
4
- colorFrom: red
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: yt
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
+ colorTo: green
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,241 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Universal Video Downloader</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #6e8efb, #a777e3);
12
+ }
13
+ .video-preview {
14
+ transition: all 0.3s ease;
15
+ }
16
+ .video-preview:hover {
17
+ transform: translateY(-5px);
18
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
19
+ }
20
+ .pulse-animation {
21
+ animation: pulse 2s infinite;
22
+ }
23
+ @keyframes pulse {
24
+ 0% {
25
+ transform: scale(1);
26
+ }
27
+ 50% {
28
+ transform: scale(1.05);
29
+ }
30
+ 100% {
31
+ transform: scale(1);
32
+ }
33
+ }
34
+ </style>
35
+ </head>
36
+ <body class="min-h-screen bg-gray-100">
37
+ <div class="gradient-bg text-white py-8 px-4 shadow-lg">
38
+ <div class="container mx-auto max-w-4xl">
39
+ <div class="flex items-center justify-between">
40
+ <div>
41
+ <h1 class="text-3xl font-bold"><i class="fas fa-video mr-3"></i>Universal Video Downloader</h1>
42
+ <p class="mt-2 opacity-90">Download videos from any website with one click</p>
43
+ </div>
44
+ <div class="w-16 h-16 bg-white bg-opacity-20 rounded-full flex items-center justify-center">
45
+ <i class="fas fa-download text-3xl"></i>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+
51
+ <div class="container mx-auto max-w-4xl px-4 py-8">
52
+ <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
53
+ <div class="flex flex-col md:flex-row gap-4">
54
+ <input
55
+ type="url"
56
+ id="videoUrl"
57
+ placeholder="Paste video URL here (e.g. YouTube, Vimeo, etc.)"
58
+ class="flex-grow px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"
59
+ >
60
+ <button
61
+ id="fetchBtn"
62
+ class="px-6 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors flex items-center justify-center gap-2"
63
+ >
64
+ <i class="fas fa-search"></i> Find Videos
65
+ </button>
66
+ </div>
67
+ <div class="mt-4 text-sm text-gray-500 flex items-center">
68
+ <i class="fas fa-info-circle mr-2"></i>
69
+ Works with most video hosting platforms including YouTube, Vimeo, Dailymotion, etc.
70
+ </div>
71
+ </div>
72
+
73
+ <div id="loading" class="hidden text-center py-12">
74
+ <div class="inline-block p-6 bg-white rounded-full shadow-lg pulse-animation">
75
+ <i class="fas fa-spinner fa-spin text-4xl text-purple-600"></i>
76
+ </div>
77
+ <p class="mt-4 text-gray-600">Scanning the webpage for videos...</p>
78
+ </div>
79
+
80
+ <div id="error" class="hidden bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-8 rounded">
81
+ <div class="flex items-center">
82
+ <i class="fas fa-exclamation-circle mr-3 text-xl"></i>
83
+ <p id="error-message"></p>
84
+ </div>
85
+ </div>
86
+
87
+ <div id="results" class="hidden">
88
+ <h2 class="text-2xl font-semibold mb-6 text-gray-800 flex items-center">
89
+ <i class="fas fa-film mr-3 text-purple-600"></i> Found Videos
90
+ </h2>
91
+ <div id="videoList" class="grid grid-cols-1 md:grid-cols-2 gap-6">
92
+ <!-- Videos will be added here dynamically -->
93
+ </div>
94
+ </div>
95
+
96
+ <div id="instructions" class="mt-12 bg-blue-50 border-l-4 border-blue-500 text-blue-800 p-4 rounded-lg">
97
+ <h3 class="font-bold text-lg mb-2 flex items-center">
98
+ <i class="fas fa-question-circle mr-2"></i> How to use
99
+ </h3>
100
+ <ol class="list-decimal pl-5 space-y-2">
101
+ <li>Copy the URL of any webpage containing video(s)</li>
102
+ <li>Paste it in the input field above</li>
103
+ <li>Click "Find Videos" to scan the page</li>
104
+ <li>Select your preferred quality and download</li>
105
+ </ol>
106
+ </div>
107
+ </div>
108
+
109
+ <footer class="bg-gray-800 text-white py-6 mt-12">
110
+ <div class="container mx-auto max-w-4xl px-4 text-center">
111
+ <p>© 2023 Universal Video Downloader. For educational purposes only.</p>
112
+ <p class="mt-2 text-sm text-gray-400">Respect copyright laws and only download videos you have permission to.</p>
113
+ </div>
114
+ </footer>
115
+
116
+ <script>
117
+ document.addEventListener('DOMContentLoaded', function() {
118
+ const videoUrl = document.getElementById('videoUrl');
119
+ const fetchBtn = document.getElementById('fetchBtn');
120
+ const loading = document.getElementById('loading');
121
+ const error = document.getElementById('error');
122
+ const errorMessage = document.getElementById('error-message');
123
+ const results = document.getElementById('results');
124
+ const videoList = document.getElementById('videoList');
125
+
126
+ // Mock video data for demonstration
127
+ const mockVideos = [
128
+ {
129
+ title: "Sample Video 1",
130
+ thumbnail: "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
131
+ duration: "4:32",
132
+ qualities: [
133
+ { resolution: "1080p", size: "45MB", url: "#" },
134
+ { resolution: "720p", size: "28MB", url: "#" },
135
+ { resolution: "480p", size: "15MB", url: "#" }
136
+ ]
137
+ },
138
+ {
139
+ title: "Sample Video 2",
140
+ thumbnail: "https://i.ytimg.com/vi/9bZkp7q19f0/hqdefault.jpg",
141
+ duration: "3:45",
142
+ qualities: [
143
+ { resolution: "720p", size: "32MB", url: "#" },
144
+ { resolution: "480p", size: "18MB", url: "#" }
145
+ ]
146
+ }
147
+ ];
148
+
149
+ fetchBtn.addEventListener('click', function() {
150
+ const url = videoUrl.value.trim();
151
+
152
+ if (!url) {
153
+ showError("Please enter a valid URL");
154
+ return;
155
+ }
156
+
157
+ // Validate URL format
158
+ try {
159
+ new URL(url);
160
+ } catch (e) {
161
+ showError("Please enter a valid URL format (e.g. https://example.com)");
162
+ return;
163
+ }
164
+
165
+ // Show loading state
166
+ loading.classList.remove('hidden');
167
+ error.classList.add('hidden');
168
+ results.classList.add('hidden');
169
+
170
+ // Simulate API call with timeout
171
+ setTimeout(() => {
172
+ loading.classList.add('hidden');
173
+
174
+ // For demo purposes, we'll use mock data
175
+ // In a real app, you would call your backend service here
176
+ // that would scrape the URL and find videos
177
+
178
+ if (url.includes('error')) {
179
+ showError("Could not find any videos at this URL. Try another one.");
180
+ } else {
181
+ displayVideos(mockVideos);
182
+ }
183
+ }, 2000);
184
+ });
185
+
186
+ function showError(message) {
187
+ errorMessage.textContent = message;
188
+ error.classList.remove('hidden');
189
+ }
190
+
191
+ function displayVideos(videos) {
192
+ videoList.innerHTML = '';
193
+
194
+ if (videos.length === 0) {
195
+ showError("No videos found at this URL");
196
+ return;
197
+ }
198
+
199
+ videos.forEach(video => {
200
+ const videoCard = document.createElement('div');
201
+ videoCard.className = 'bg-white rounded-xl overflow-hidden shadow-md video-preview';
202
+ videoCard.innerHTML = `
203
+ <div class="relative">
204
+ <img src="${video.thumbnail}" alt="${video.title}" class="w-full h-48 object-cover">
205
+ <span class="absolute bottom-2 right-2 bg-black bg-opacity-70 text-white px-2 py-1 text-sm rounded">
206
+ ${video.duration}
207
+ </span>
208
+ </div>
209
+ <div class="p-4">
210
+ <h3 class="font-semibold text-lg mb-2 truncate">${video.title}</h3>
211
+ <div class="space-y-2">
212
+ ${video.qualities.map(quality => `
213
+ <div class="flex items-center justify-between bg-gray-50 p-2 rounded">
214
+ <div>
215
+ <span class="font-medium">${quality.resolution}</span>
216
+ <span class="text-sm text-gray-500 ml-2">${quality.size}</span>
217
+ </div>
218
+ <a href="${quality.url}" class="px-3 py-1 bg-purple-600 text-white text-sm rounded hover:bg-purple-700 transition-colors flex items-center">
219
+ <i class="fas fa-download mr-1"></i> Download
220
+ </a>
221
+ </div>
222
+ `).join('')}
223
+ </div>
224
+ </div>
225
+ `;
226
+ videoList.appendChild(videoCard);
227
+ });
228
+
229
+ results.classList.remove('hidden');
230
+ }
231
+
232
+ // Demo: Auto-fill URL on click for testing
233
+ videoUrl.addEventListener('click', function() {
234
+ if (!this.value) {
235
+ this.value = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
236
+ }
237
+ });
238
+ });
239
+ </script>
240
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=C50BARZ/yt" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
241
+ </html>