bk939448 commited on
Commit
490ce53
Β·
verified Β·
1 Parent(s): d54fb16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +53 -33
app.py CHANGED
@@ -140,66 +140,79 @@ HTML_UI = """
140
  <head>
141
  <meta charset="UTF-8">
142
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
143
- <title>Skynet DMCA Killer</title>
144
  <style>
145
- body { font-family: 'Courier New', Courier, monospace; background: #050505; color: #0f0; padding: 20px; max-width: 800px; margin: auto; }
146
- .card { background: #111; padding: 25px; border-radius: 8px; border: 1px solid #0f0; box-shadow: 0 0 15px rgba(0, 255, 0, 0.2); }
147
- h2 { color: #0f0; border-bottom: 1px dashed #0f0; padding-bottom: 10px; text-transform: uppercase; }
148
- .input-group { background: #1a1a1a; padding: 15px; border-radius: 5px; margin-bottom: 15px; border: 1px solid #333; }
149
- input[type="text"], input[type="file"], select { width: 100%; padding: 12px; margin: 8px 0; background: #000; color: #0f0; border: 1px solid #0f0; outline: none; box-sizing: border-box; }
150
- button { width: 100%; padding: 15px; background: #0f0; color: #000; font-weight: bold; border: none; cursor: pointer; text-transform: uppercase; margin-top: 10px; font-size: 16px; }
151
- button:hover { background: #fff; color: #000; }
152
- button:disabled { background: #333; color: #666; cursor: not-allowed; }
153
- #result { margin-top: 25px; padding: 15px; background: #002200; border-left: 4px solid #0f0; display: none; word-wrap: break-word; }
154
- .url-box { background: #000; padding: 10px; border: 1px dashed #0f0; margin: 10px 0; font-size: 14px; }
155
- .stats { display: flex; justify-content: space-between; font-weight: bold; font-size: 14px; margin-top: 10px; color: #fff; }
 
 
 
 
 
 
 
156
  </style>
157
  </head>
158
  <body>
159
  <div class="card">
160
- <h2>πŸ›‘οΈ DMCA Killer v4.0 (XOR Encrypted)</h2>
 
161
 
162
  <div class="input-group">
163
- <label><b>Option 1: Paste Image URL</b></label>
164
- <input type="text" id="imgUrl" placeholder="πŸ”— https://example.com/movie.jpg">
165
  </div>
166
 
 
 
167
  <div class="input-group">
168
- <label><b>Option 2: Direct File Upload</b></label>
169
  <input type="file" id="imgFile" accept="image/*">
170
  </div>
171
 
 
172
  <select id="level">
173
- <option value="none">πŸ’Ž None (Original Quality, Bypass Compression)</option>
174
- <option value="extreme" selected>πŸ‹ Extreme (Max Compression, ~60KB)</option>
175
- <option value="medium">🍎 Medium (~150KB)</option>
176
  </select>
177
 
178
- <button onclick="uploadImage()" id="btn">⚑ Encrypt & Deploy to HF</button>
179
 
180
  <div id="result">
181
- <h3 style="margin:0 0 10px 0;">βœ… DEPLOYMENT SUCCESSFUL</h3>
182
- <p style="margin: 0; color: #aaa;">Cloudflare Worker URL (Safe for DB):</p>
183
  <div class="url-box" id="resLink"></div>
 
 
184
  <div class="stats">
185
- <span id="oldSize">Original: -- KB</span>
186
- <span id="newSize" style="color:#0f0;">Encrypted: -- KB</span>
187
  </div>
188
- <p style="margin-top: 10px; font-size: 12px; color: yellow;">⚠️ Note: This URL will only work if your Cloudflare Worker is active!</p>
189
  </div>
190
  </div>
191
 
192
  <script>
193
- async function uploadImage() {
194
  const btn = document.getElementById('btn');
195
  const urlInput = document.getElementById('imgUrl').value;
196
  const fileInput = document.getElementById('imgFile').files[0];
197
  const level = document.getElementById('level').value;
198
  const resDiv = document.getElementById('result');
199
 
200
- if(!urlInput && !fileInput) { alert("Please provide a URL or select a File!"); return; }
201
 
202
- btn.innerText = "⏳ Encrypting Data & Uploading...";
203
  btn.disabled = true;
204
  resDiv.style.display = "none";
205
 
@@ -214,18 +227,25 @@ HTML_UI = """
214
 
215
  if(data.success) {
216
  document.getElementById('resLink').innerText = data.url;
217
- document.getElementById('oldSize').innerText = `Original: ${data.original_size_kb} KB`;
218
- document.getElementById('newSize').innerText = `Encrypted: ${data.encrypted_size_kb} KB`;
 
219
  resDiv.style.display = "block";
220
  } else {
221
- alert("❌ Error: " + data.error);
222
  }
223
  } catch (err) {
224
- alert("❌ Critical Network Error!");
225
  }
226
- btn.innerText = "⚑ Encrypt & Deploy to HF";
227
  btn.disabled = false;
228
  }
 
 
 
 
 
 
229
  </script>
230
  </body>
231
  </html>
 
140
  <head>
141
  <meta charset="UTF-8">
142
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
143
+ <title>OptiPix Pro | Smart Image Optimizer</title>
144
  <style>
145
+ :root { --primary: #3b82f6; --bg: #0f172a; --card: #1e293b; --text: #f1f5f9; }
146
+ body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); padding: 20px; max-width: 700px; margin: auto; }
147
+ .card { background: var(--card); padding: 30px; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); border: 1px solid #334155; }
148
+ h2 { color: #fff; margin-top: 0; font-size: 24px; text-align: center; }
149
+ p.sub { text-align: center; color: #94a3b8; font-size: 14px; margin-bottom: 25px; }
150
+ .input-group { background: #0f172a; padding: 15px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #334155; }
151
+ label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; color: #3b82f6; }
152
+ input[type="text"], input[type="file"], select { width: 100%; padding: 12px; background: #1e293b; color: #fff; border: 1px solid #475569; border-radius: 8px; outline: none; box-sizing: border-box; font-size: 14px; }
153
+ input:focus { border-color: var(--primary); }
154
+ button { width: 100%; padding: 14px; background: var(--primary); color: white; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; transition: 0.3s; margin-top: 10px; }
155
+ button:hover { background: #2563eb; transform: translateY(-1px); }
156
+ button:disabled { background: #475569; cursor: not-allowed; transform: none; }
157
+ #result { margin-top: 30px; padding: 20px; background: #064e3b; border-radius: 12px; display: none; animation: fadeIn 0.5s ease; }
158
+ .url-box { background: #0f172a; padding: 12px; border: 1px solid #059669; border-radius: 6px; margin: 10px 0; font-family: monospace; font-size: 13px; color: #34d399; overflow-x: auto; white-space: nowrap; }
159
+ .stats { display: flex; justify-content: space-between; font-size: 13px; margin-top: 15px; background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 6px; }
160
+ .preview-img { max-width: 100%; border-radius: 8px; margin-top: 15px; border: 1px solid #334155; display: block; }
161
+ @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
162
+ .copy-btn { background: #334155; color: #fff; padding: 5px 10px; font-size: 11px; border-radius: 4px; border: none; cursor: pointer; float: right; margin-top: -35px; margin-right: 5px; }
163
  </style>
164
  </head>
165
  <body>
166
  <div class="card">
167
+ <h2>πŸš€ OptiPix Pro</h2>
168
+ <p class="sub">High-performance AI image compression and cloud hosting.</p>
169
 
170
  <div class="input-group">
171
+ <label>Remote Image URL</label>
172
+ <input type="text" id="imgUrl" placeholder="https://example.com/image.jpg">
173
  </div>
174
 
175
+ <div style="text-align: center; margin-bottom: 20px; color: #475569; font-size: 12px;">β€” OR β€”</div>
176
+
177
  <div class="input-group">
178
+ <label>Upload Local Image</label>
179
  <input type="file" id="imgFile" accept="image/*">
180
  </div>
181
 
182
+ <label>Compression Level</label>
183
  <select id="level">
184
+ <option value="none">Original (No Compression)</option>
185
+ <option value="extreme" selected>Web-Ready (Max Optimization)</option>
186
+ <option value="medium">Standard (Balanced)</option>
187
  </select>
188
 
189
+ <button onclick="processImage()" id="btn">Optimize & Host Image</button>
190
 
191
  <div id="result">
192
+ <h3 style="margin:0 0 10px 0; font-size: 18px; color: #34d399;">βœ… Processing Complete</h3>
193
+ <p style="margin: 0; color: #a7f3d0; font-size: 13px;">CDN Optimized Link:</p>
194
  <div class="url-box" id="resLink"></div>
195
+ <button class="copy-btn" onclick="copyUrl()">Copy URL</button>
196
+
197
  <div class="stats">
198
+ <span>Original: <span id="oldSize">--</span> KB</span>
199
+ <span style="color: #34d399;">Optimized: <span id="newSize">--</span> KB</span>
200
  </div>
201
+ <img id="resImg" class="preview-img" src="" alt="Preview">
202
  </div>
203
  </div>
204
 
205
  <script>
206
+ async function processImage() {
207
  const btn = document.getElementById('btn');
208
  const urlInput = document.getElementById('imgUrl').value;
209
  const fileInput = document.getElementById('imgFile').files[0];
210
  const level = document.getElementById('level').value;
211
  const resDiv = document.getElementById('result');
212
 
213
+ if(!urlInput && !fileInput) { alert("Please provide an image source!"); return; }
214
 
215
+ btn.innerText = "⚑ Processing on Cloud...";
216
  btn.disabled = true;
217
  resDiv.style.display = "none";
218
 
 
227
 
228
  if(data.success) {
229
  document.getElementById('resLink').innerText = data.url;
230
+ document.getElementById('oldSize').innerText = data.original_size_kb;
231
+ document.getElementById('newSize').innerText = data.encrypted_size_kb;
232
+ document.getElementById('resImg').src = data.url;
233
  resDiv.style.display = "block";
234
  } else {
235
+ alert("Processing Error: " + data.error);
236
  }
237
  } catch (err) {
238
+ alert("Cloud connection failed!");
239
  }
240
+ btn.innerText = "Optimize & Host Image";
241
  btn.disabled = false;
242
  }
243
+
244
+ function copyUrl() {
245
+ const url = document.getElementById('resLink').innerText;
246
+ navigator.clipboard.writeText(url);
247
+ alert("Link copied to clipboard!");
248
+ }
249
  </script>
250
  </body>
251
  </html>