tommy811 commited on
Commit
e84d3db
·
verified ·
1 Parent(s): 706ed00

‏לא ניתן היה למצוא את כתובת ה-IP של השרת של ytdl-proxy.example.com. - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +313 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Mine
3
- emoji: 📚
4
- colorFrom: pink
5
- colorTo: blue
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: mine
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: purple
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,313 @@
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>YouTube to MP3 Converter</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, #4b5563 0%, #1f2937 100%);
12
+ }
13
+ .download-btn {
14
+ transition: all 0.3s ease;
15
+ }
16
+ .download-btn:hover {
17
+ transform: translateY(-2px);
18
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
19
+ }
20
+ .pulse {
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="gradient-bg min-h-screen flex flex-col">
37
+ <div class="container mx-auto px-4 py-12 flex-grow flex flex-col">
38
+ <header class="text-center mb-12">
39
+ <h1 class="text-4xl md:text-5xl font-bold text-white mb-4">YouTube to MP3 Converter</h1>
40
+ <p class="text-xl text-white opacity-90">Extract audio from YouTube videos</p>
41
+ </header>
42
+
43
+ <main class="max-w-2xl mx-auto w-full">
44
+ <div class="bg-white rounded-xl shadow-2xl overflow-hidden">
45
+ <div class="p-6 md:p-8">
46
+ <div class="flex items-center mb-6">
47
+ <i class="fas fa-lock text-gray-600 text-4xl mr-4"></i>
48
+ <h2 class="text-2xl font-semibold text-gray-800">Enter Media URL</h2>
49
+ </div>
50
+
51
+ <div class="mb-6">
52
+ <div class="flex">
53
+ <input
54
+ type="text"
55
+ id="youtubeUrl"
56
+ placeholder="Paste YouTube video URL here..."
57
+ class="flex-grow px-4 py-3 border border-gray-300 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-purple-500"
58
+ >
59
+ <button
60
+ id="checkBtn"
61
+ class="bg-gray-700 hover:bg-gray-800 text-white px-6 py-3 rounded-r-lg transition duration-300"
62
+ >
63
+ <i class="fas fa-search mr-2"></i> Check
64
+ </button>
65
+ </div>
66
+ <p class="text-sm text-gray-500 mt-2">Secure audio extraction in progress</p>
67
+ </div>
68
+
69
+ <div id="videoInfo" class="hidden mb-6">
70
+ <div class="flex items-start border border-gray-200 rounded-lg p-4">
71
+ <div class="mr-4">
72
+ <div id="thumbnail" class="w-20 h-20 bg-gray-200 rounded-lg overflow-hidden">
73
+ <img id="thumbnailImg" src="" alt="Video thumbnail" class="w-full h-full object-cover">
74
+ </div>
75
+ </div>
76
+ <div>
77
+ <h3 id="videoTitle" class="font-semibold text-gray-800"></h3>
78
+ <p id="videoDuration" class="text-sm text-gray-600 mt-1"></p>
79
+ <p id="videoChannel" class="text-sm text-gray-600 mt-1"></p>
80
+ </div>
81
+ </div>
82
+ </div>
83
+
84
+ <div id="downloadSection" class="hidden">
85
+ <div class="bg-purple-50 rounded-lg p-4 mb-6">
86
+ <div class="flex items-center">
87
+ <i class="fas fa-music text-purple-600 mr-3 text-xl"></i>
88
+ <div>
89
+ <h3 class="font-medium text-gray-800">Audio Quality Options</h3>
90
+ <p class="text-sm text-gray-600">Select your preferred quality</p>
91
+ </div>
92
+ </div>
93
+
94
+ <div class="mt-4 grid grid-cols-2 gap-3">
95
+ <button class="quality-btn bg-white border border-purple-200 rounded-lg px-4 py-2 text-sm font-medium hover:bg-purple-100 transition" data-quality="128">
96
+ <i class="fas fa-headphones-alt text-purple-600 mr-2"></i> 128 kbps
97
+ </button>
98
+ <button class="quality-btn bg-white border border-purple-200 rounded-lg px-4 py-2 text-sm font-medium hover:bg-purple-100 transition" data-quality="192">
99
+ <i class="fas fa-headphones-alt text-purple-600 mr-2"></i> 192 kbps
100
+ </button>
101
+ <button class="quality-btn bg-white border border-purple-200 rounded-lg px-4 py-2 text-sm font-medium hover:bg-purple-100 transition" data-quality="256">
102
+ <i class="fas fa-headphones-alt text-purple-600 mr-2"></i> 256 kbps
103
+ </button>
104
+ <button class="quality-btn bg-white border border-purple-200 rounded-lg px-4 py-2 text-sm font-medium hover:bg-purple-100 transition" data-quality="320">
105
+ <i class="fas fa-headphones-alt text-purple-600 mr-2"></i> 320 kbps
106
+ </button>
107
+ </div>
108
+ </div>
109
+
110
+ <button
111
+ id="downloadBtn"
112
+ class="download-btn w-full bg-gradient-to-r from-purple-600 to-indigo-600 text-white font-bold py-4 px-6 rounded-lg shadow-lg pulse"
113
+ >
114
+ <span class="download-text"><i class="fas fa-download mr-2"></i> Download MP3</span>
115
+ </button>
116
+ </div>
117
+ </div>
118
+
119
+ <div class="bg-gray-50 px-6 py-4 border-t border-gray-200">
120
+ <div class="flex items-center justify-between">
121
+ <p class="text-sm text-gray-600">
122
+ <i class="fas fa-info-circle mr-1"></i> No files are stored on our servers
123
+ </p>
124
+ <p class="text-sm text-gray-600">
125
+ <i class="fas fa-shield-alt mr-1"></i> Secure connection
126
+ </p>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </main>
131
+ </div>
132
+
133
+ <footer class="bg-white bg-opacity-10 py-6">
134
+ <div class="container mx-auto px-4 text-center text-white">
135
+ <p>© 2023 YouTube MP3 Converter</p>
136
+ <p class="text-sm opacity-80 mt-2">For personal use only. No files are stored on our servers.</p>
137
+ </div>
138
+ </footer>
139
+
140
+ <script>
141
+ document.addEventListener('DOMContentLoaded', function() {
142
+ const youtubeUrlInput = document.getElementById('youtubeUrl');
143
+ const checkBtn = document.getElementById('checkBtn');
144
+ const videoInfo = document.getElementById('videoInfo');
145
+ const downloadSection = document.getElementById('downloadSection');
146
+ const downloadBtn = document.getElementById('downloadBtn');
147
+ const qualityBtns = document.querySelectorAll('.quality-btn');
148
+
149
+ let currentVideoId = '';
150
+ let selectedQuality = '192';
151
+
152
+ // YouTube thumbnail and download URLs
153
+ function getYouTubeThumbnail(videoId, quality = 'mqdefault') {
154
+ return `https://img.youtube.com/vi/${videoId}/${quality}.jpg`;
155
+ }
156
+
157
+ function getDownloadUrl(videoId, quality) {
158
+ // This is just a placeholder for demo purposes
159
+ // In a real implementation, replace with your actual backend endpoint
160
+ console.warn("Demo mode: No actual download service is connected");
161
+ return '';
162
+ }
163
+
164
+ // Check button click handler
165
+ checkBtn.addEventListener('click', function() {
166
+ const url = youtubeUrlInput.value.trim();
167
+
168
+ if (!url) {
169
+ showError("Please enter a YouTube URL");
170
+ return;
171
+ }
172
+
173
+ // Simple URL validation
174
+ if (!url.includes('youtube.com') && !url.includes('youtu.be')) {
175
+ showError("Please enter a valid YouTube URL");
176
+ return;
177
+ }
178
+
179
+ // Extract video ID (simplified for demo)
180
+ const videoIdMatch = url.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);
181
+
182
+ if (!videoIdMatch || videoIdMatch.length < 2) {
183
+ showError("Could not extract video ID from URL");
184
+ return;
185
+ }
186
+
187
+ currentVideoId = videoIdMatch[1];
188
+
189
+ // Simulate API call with timeout
190
+ checkBtn.disabled = true;
191
+ checkBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Checking...';
192
+
193
+ setTimeout(() => {
194
+ // In a real app, you would make an API call here to get video info
195
+
196
+ // Display video info with actual YouTube data
197
+ document.getElementById('videoTitle').textContent = "Loading video info...";
198
+ document.getElementById('videoDuration').textContent = "";
199
+ document.getElementById('videoChannel').textContent = "";
200
+
201
+ // Set thumbnail from YouTube
202
+ const thumbnailImg = document.getElementById('thumbnailImg');
203
+ thumbnailImg.src = getYouTubeThumbnail(currentVideoId);
204
+
205
+ // Simulate fetching actual metadata
206
+ document.getElementById('videoTitle').textContent = "Selected Video";
207
+ document.getElementById('videoDuration').textContent = "Duration: 3:45";
208
+ document.getElementById('videoChannel').textContent = "Channel: Example Channel";
209
+
210
+ videoInfo.classList.remove('hidden');
211
+ downloadSection.classList.remove('hidden');
212
+
213
+ checkBtn.disabled = false;
214
+ checkBtn.innerHTML = '<i class="fas fa-search mr-2"></i> Check';
215
+
216
+ // Scroll to download section
217
+ downloadSection.scrollIntoView({ behavior: 'smooth' });
218
+ }, 1500);
219
+ });
220
+
221
+ // Quality selection
222
+ qualityBtns.forEach(btn => {
223
+ btn.addEventListener('click', function() {
224
+ qualityBtns.forEach(b => b.classList.remove('bg-purple-100', 'border-purple-400'));
225
+ this.classList.add('bg-purple-100', 'border-purple-400');
226
+ selectedQuality = this.dataset.quality;
227
+ });
228
+ });
229
+
230
+ // Download button click handler
231
+ downloadBtn.addEventListener('click', function() {
232
+ if (!currentVideoId) {
233
+ showError("No video selected");
234
+ return;
235
+ }
236
+
237
+ // In a real app, you would make an API call here to get the download link
238
+ // For demo purposes, we'll simulate a download
239
+
240
+ downloadBtn.disabled = true;
241
+ downloadBtn.querySelector('.download-text').innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Preparing download...';
242
+
243
+ setTimeout(() => {
244
+ try {
245
+ // In a real implementation, this would call your backend service
246
+ const downloadUrl = getDownloadUrl(currentVideoId, selectedQuality);
247
+
248
+ // Verify the URL is valid before attempting download
249
+ if (!downloadUrl || downloadUrl.includes('example.com')) {
250
+ throw new Error("Download service is not available in this demo");
251
+ }
252
+
253
+ // Create download link
254
+ const a = document.createElement('a');
255
+ a.href = downloadUrl;
256
+ a.download = `youtube_audio_${currentVideoId}_${selectedQuality}kbps.mp3`;
257
+ document.body.appendChild(a);
258
+ a.click();
259
+ document.body.removeChild(a);
260
+
261
+ // Show success message
262
+ showSuccess("Download started! Your audio will be saved shortly.");
263
+ } catch (error) {
264
+ showError("Demo limitation: This is a frontend demo only. In a real implementation, this would connect to a backend service.");
265
+ } finally {
266
+ downloadBtn.disabled = false;
267
+ downloadBtn.querySelector('.download-text').innerHTML = '<i class="fas fa-download mr-2"></i> Download MP3';
268
+ }
269
+ }, 2000);
270
+ });
271
+
272
+ // Helper functions
273
+ function showError(message) {
274
+ const existingAlert = document.querySelector('.alert-error');
275
+ if (existingAlert) existingAlert.remove();
276
+
277
+ const alert = document.createElement('div');
278
+ alert.className = 'alert-error fixed top-4 right-4 bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded max-w-md z-50';
279
+ alert.innerHTML = `
280
+ <div class="flex items-center">
281
+ <i class="fas fa-exclamation-circle mr-2"></i>
282
+ <span>${message}</span>
283
+ </div>
284
+ `;
285
+ document.body.appendChild(alert);
286
+
287
+ setTimeout(() => {
288
+ alert.remove();
289
+ }, 5000);
290
+ }
291
+
292
+ function showSuccess(message) {
293
+ const existingAlert = document.querySelector('.alert-success');
294
+ if (existingAlert) existingAlert.remove();
295
+
296
+ const alert = document.createElement('div');
297
+ alert.className = 'alert-success fixed top-4 right-4 bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded max-w-md z-50';
298
+ alert.innerHTML = `
299
+ <div class="flex items-center">
300
+ <i class="fas fa-check-circle mr-2"></i>
301
+ <span>${message}</span>
302
+ </div>
303
+ `;
304
+ document.body.appendChild(alert);
305
+
306
+ setTimeout(() => {
307
+ alert.remove();
308
+ }, 5000);
309
+ }
310
+ });
311
+ </script>
312
+ <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=tommy811/mine" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
313
+ </html>