samfred2 commited on
Commit
c0942b9
·
verified ·
1 Parent(s): 402fdc7

Upload index (6).html

Browse files
Files changed (1) hide show
  1. index (6).html +91 -0
index (6).html ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Movie Downloader & Uploader</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ </head>
9
+ <body class="bg-gray-100 min-h-screen flex items-center justify-center">
10
+ <div class="bg-white p-8 rounded-lg shadow-md w-full max-w-md">
11
+ <h1 class="text-2xl font-bold mb-6 text-center text-blue-600">Movie Transfer Tool</h1>
12
+ <form id="downloadForm" class="space-y-4">
13
+ <div>
14
+ <label for="url" class="block text-sm font-medium text-gray-700">DownloadWella URL</label>
15
+ <input type="url" id="url" name="url" required
16
+ class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500"
17
+ placeholder="https://downloadwella.com/...">
18
+ </div>
19
+ <button type="submit" id="submitBtn"
20
+ class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
21
+ Start Process
22
+ </button>
23
+ </form>
24
+ <div id="status" class="mt-6 hidden">
25
+ <h2 class="text-sm font-semibold text-gray-600 uppercase tracking-wider">Status</h2>
26
+ <div id="statusList" class="mt-2 text-sm text-gray-500 space-y-1">
27
+ <!-- Status messages will appear here -->
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <script>
33
+ const form = document.getElementById('downloadForm');
34
+ const statusDiv = document.getElementById('status');
35
+ const statusList = document.getElementById('statusList');
36
+ const submitBtn = document.getElementById('submitBtn');
37
+
38
+ function addStatus(message, isError = false) {
39
+ const p = document.createElement('p');
40
+ p.textContent = message;
41
+ if (isError) p.classList.add('text-red-500', 'font-bold');
42
+ statusList.appendChild(p);
43
+ statusDiv.classList.remove('hidden');
44
+ }
45
+
46
+ form.onsubmit = async (e) => {
47
+ e.preventDefault();
48
+ const url = document.getElementById('url').value;
49
+
50
+ submitBtn.disabled = true;
51
+ submitBtn.classList.add('opacity-50', 'cursor-not-allowed');
52
+ statusList.innerHTML = '';
53
+ addStatus('Initiating process...');
54
+
55
+ try {
56
+ const response = await fetch('/process', {
57
+ method: 'POST',
58
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
59
+ body: new URLSearchParams({ 'url': url })
60
+ });
61
+
62
+ const reader = response.body.getReader();
63
+ const decoder = new TextDecoder();
64
+
65
+ while (true) {
66
+ const { value, done } = await reader.read();
67
+ if (done) break;
68
+
69
+ const text = decoder.decode(value);
70
+ const lines = text.split('\n');
71
+ for (const line of lines) {
72
+ if (line.trim()) {
73
+ try {
74
+ const data = JSON.parse(line);
75
+ addStatus(data.message, data.error);
76
+ } catch (e) {
77
+ // Not JSON, skip
78
+ }
79
+ }
80
+ }
81
+ }
82
+ } catch (error) {
83
+ addStatus('Network error: ' + error.message, true);
84
+ } finally {
85
+ submitBtn.disabled = false;
86
+ submitBtn.classList.remove('opacity-50', 'cursor-not-allowed');
87
+ }
88
+ };
89
+ </script>
90
+ </body>
91
+ </html>