Rianofc commited on
Commit
2eef2c0
·
verified ·
1 Parent(s): 88690bd

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +155 -59
index.html CHANGED
@@ -1,72 +1,168 @@
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>AIO Downloader</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  </head>
9
- <body class="min-h-screen bg-gray-100 flex items-center justify-center p-4">
10
- <div class="w-full max-w-lg bg-white rounded-2xl shadow-lg p-6">
11
- <h1 class="text-2xl font-bold text-gray-800 mb-4">✨ AIO Downloader</h1>
12
- <form id="downloadForm" class="space-y-4">
13
- <div>
14
- <label for="url" class="block text-gray-700 mb-1">Target URL</label>
15
- <input type="url" id="url" placeholder="https://example.com/video.mp4" required
16
- class="w-full p-3 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-400" />
17
- </div>
18
- <div>
19
- <label for="ttl" class="block text-gray-700 mb-1">TTL (seconds) <span class="text-sm text-gray-500">optional</span></label>
20
- <input type="number" id="ttl" placeholder="3600"
21
- class="w-full p-3 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-400" />
22
- </div>
23
- <button type="submit"
24
- class="w-full py-3 bg-blue-600 text-white font-semibold rounded-xl shadow hover:bg-blue-700 transition">Generate Short URL</button>
25
  </form>
26
- <div id="result" class="mt-6 hidden">
27
- <p class="text-gray-800">Your short URL:</p>
28
- <div class="mt-2 flex items-center space-x-2">
29
- <input type="text" id="shortUrl" readonly
30
- class="flex-1 p-3 border border-gray-300 rounded-xl bg-gray-100" />
31
- <button id="copyBtn" class="px-4 py-2 bg-green-500 text-white rounded-xl hover:bg-green-600 transition">Copy</button>
 
32
  </div>
33
- <a id="downloadLink" href="#" target="_blank"
34
- class="block mt-4 text-center text-white bg-indigo-600 py-3 rounded-xl hover:bg-indigo-700 transition">Download Now</a>
35
  </div>
 
 
 
 
 
 
 
 
36
 
37
- <script>
38
- const form = document.getElementById('downloadForm');
39
- const resultBox = document.getElementById('result');
40
- const shortUrlInput = document.getElementById('shortUrl');
41
- const copyBtn = document.getElementById('copyBtn');
42
- const downloadLink = document.getElementById('downloadLink');
43
-
44
- form.addEventListener('submit', async (e) => {
45
- e.preventDefault();
46
- const url = document.getElementById('url').value;
47
- const ttl = document.getElementById('ttl').value;
48
- const params = new URLSearchParams({ url });
49
- if (ttl) params.append('ttlSeconds', ttl);
50
 
51
- try {
52
- const res = await fetch(`/proxy-url?${params.toString()}`);
53
- if (!res.ok) throw new Error('Failed to generate');
54
- const { shortUrl } = await res.json();
 
 
 
 
55
 
56
- shortUrlInput.value = shortUrl;
57
- downloadLink.href = shortUrl;
58
- resultBox.classList.remove('hidden');
59
- } catch (err) {
60
- alert(err.message);
61
- }
62
- });
 
63
 
64
- copyBtn.addEventListener('click', () => {
65
- navigator.clipboard.writeText(shortUrlInput.value);
66
- copyBtn.textContent = 'Copied!';
67
- setTimeout(() => copyBtn.textContent = 'Copy', 2000);
68
- });
69
- </script>
70
- </div>
71
  </body>
72
  </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">
6
+ <title>Spotify Downloader</title>
7
+ <style>
8
+ :root {
9
+ --spotify-green: #1DB954;
10
+ --bg: #f9f9f9;
11
+ --card: #fff;
12
+ --text: #333;
13
+ --muted: #666;
14
+ }
15
+ * { box-sizing: border-box; margin: 0; padding: 0; }
16
+ body {
17
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
18
+ background: var(--bg);
19
+ color: var(--text);
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ min-height: 100vh;
24
+ padding: 1rem;
25
+ }
26
+ .container {
27
+ background: var(--card);
28
+ border-radius: 12px;
29
+ box-shadow: 0 4px 12px rgba(0,0,0,0.05);
30
+ max-width: 360px;
31
+ width: 100%;
32
+ padding: 2rem;
33
+ text-align: center;
34
+ }
35
+ .logo {
36
+ width: 64px;
37
+ margin-bottom: 1rem;
38
+ }
39
+ h1 {
40
+ font-size: 1.25rem;
41
+ margin-bottom: 1.5rem;
42
+ color: var(--spotify-green);
43
+ }
44
+ form input {
45
+ width: 100%;
46
+ padding: 0.75rem;
47
+ border: 1px solid #ddd;
48
+ border-radius: 8px;
49
+ font-size: 1rem;
50
+ margin-bottom: 1rem;
51
+ }
52
+ form button {
53
+ width: 100%;
54
+ padding: 0.75rem;
55
+ background: var(--spotify-green);
56
+ color: #fff;
57
+ border: none;
58
+ border-radius: 8px;
59
+ font-size: 1rem;
60
+ cursor: pointer;
61
+ transition: background 0.2s;
62
+ }
63
+ form button:hover {
64
+ background: #17a44c;
65
+ }
66
+ .result {
67
+ margin-top: 1.5rem;
68
+ text-align: left;
69
+ }
70
+ .media-item {
71
+ display: block;
72
+ margin: 0.5rem 0;
73
+ padding: 0.75rem;
74
+ background: var(--bg);
75
+ border-radius: 6px;
76
+ text-decoration: none;
77
+ color: var(--spotify-green);
78
+ font-weight: 500;
79
+ font-size: 0.95rem;
80
+ transition: background 0.2s;
81
+ }
82
+ .media-item:hover {
83
+ background: #e6f7ee;
84
+ }
85
+ .info {
86
+ display: flex;
87
+ align-items: center;
88
+ margin-bottom: 1rem;
89
+ }
90
+ .info img {
91
+ width: 64px;
92
+ height: 64px;
93
+ border-radius: 8px;
94
+ margin-right: 1rem;
95
+ }
96
+ .info div {
97
+ flex: 1;
98
+ }
99
+ .info .title {
100
+ font-size: 1rem;
101
+ font-weight: 600;
102
+ margin-bottom: 0.25rem;
103
+ }
104
+ .info .author {
105
+ font-size: 0.85rem;
106
+ color: var(--muted);
107
+ }
108
+ </style>
109
  </head>
110
+ <body>
111
+ <div class="container">
112
+ <img src="https://cdn.jsdelivr.net/gh/edent/SuperTinyIcons/images/svg/spotify.svg" alt="Spotify" class="logo">
113
+ <h1>Spotify Downloader</h1>
114
+ <form id="download-form">
115
+ <input type="url" id="track-url" placeholder="Enter Spotify track URL..." required>
116
+ <button type="submit">Fetch Links</button>
 
 
 
 
 
 
 
 
 
117
  </form>
118
+ <div id="output" class="result" hidden>
119
+ <div class="info">
120
+ <img id="thumb" src="" alt="Thumbnail">
121
+ <div>
122
+ <div id="track-title" class="title"></div>
123
+ <div id="track-author" class="author"></div>
124
+ </div>
125
  </div>
126
+ <div id="links"></div>
 
127
  </div>
128
+ </div>
129
+ <script>
130
+ const form = document.getElementById('download-form');
131
+ const output = document.getElementById('output');
132
+ const thumb = document.getElementById('thumb');
133
+ const trackTitle = document.getElementById('track-title');
134
+ const trackAuthor = document.getElementById('track-author');
135
+ const linksDiv = document.getElementById('links');
136
 
137
+ form.addEventListener('submit', async e => {
138
+ e.preventDefault();
139
+ const url = document.getElementById('track-url').value.trim();
140
+ output.hidden = true;
141
+ linksDiv.innerHTML = '';
 
 
 
 
 
 
 
 
142
 
143
+ try {
144
+ const res = await fetch(`/proxy-url?url=${encodeURIComponent(url)}`);
145
+ if (!res.ok) throw new Error('Failed to fetch');
146
+ const data = await res.json();
147
+ const info = data.data;
148
+ thumb.src = info.thumbnail;
149
+ trackTitle.textContent = info.title;
150
+ trackAuthor.textContent = info.author;
151
 
152
+ info.medias.forEach(item => {
153
+ const a = document.createElement('a');
154
+ a.href = item.url;
155
+ a.textContent = `Download ${item.quality}`;
156
+ a.className = 'media-item';
157
+ a.setAttribute('download', '');
158
+ linksDiv.appendChild(a);
159
+ });
160
 
161
+ output.hidden = false;
162
+ } catch (err) {
163
+ alert(err.message);
164
+ }
165
+ });
166
+ </script>
 
167
  </body>
168
  </html>