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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>{{ title }}</title>
|
| 7 |
+
<link rel="stylesheet" href="/static/css/style.css">
|
| 8 |
+
<!-- Google Fonts -->
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
| 10 |
+
</head>
|
| 11 |
+
<body>
|
| 12 |
+
<!-- ============================================ -->
|
| 13 |
+
<!-- HEADER -->
|
| 14 |
+
<!-- ============================================ -->
|
| 15 |
+
<header class="header">
|
| 16 |
+
<div class="header-content">
|
| 17 |
+
<h1>📚 {{ title }}</h1>
|
| 18 |
+
<div class="header-status" id="headerStatus">
|
| 19 |
+
<span class="status-dot" id="statusDot"></span>
|
| 20 |
+
<span id="statusText">Initializing...</span>
|
| 21 |
+
</div>
|
| 22 |
+
</div>
|
| 23 |
+
</header>
|
| 24 |
+
|
| 25 |
+
<!-- ============================================ -->
|
| 26 |
+
<!-- MAIN CONTENT -->
|
| 27 |
+
<!-- ============================================ -->
|
| 28 |
+
<main class="container">
|
| 29 |
+
|
| 30 |
+
<!-- ======= INTERVENTION ALERT BANNER ======= -->
|
| 31 |
+
<div class="alert-banner" id="interventionBanner" style="display:none;">
|
| 32 |
+
<div class="alert-content">
|
| 33 |
+
<span class="alert-icon">🚨</span>
|
| 34 |
+
<span class="alert-text">Captcha detected! Manual intervention needed.</span>
|
| 35 |
+
<button class="btn btn-warning" onclick="scrollToIntervention()">Go to Captcha →</button>
|
| 36 |
+
</div>
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
<!-- ======= ADD NOVELS SECTION ======= -->
|
| 40 |
+
<section class="card" id="addNovelSection">
|
| 41 |
+
<div class="card-header">
|
| 42 |
+
<h2>➕ Add Novels</h2>
|
| 43 |
+
<button class="btn btn-sm btn-secondary" onclick="toggleBatchMode()">
|
| 44 |
+
<span id="batchToggleText">Switch to Batch Mode</span>
|
| 45 |
+
</button>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<!-- Single Novel Form -->
|
| 49 |
+
<div id="singleNovelForm">
|
| 50 |
+
<div class="form-grid">
|
| 51 |
+
<div class="form-group">
|
| 52 |
+
<label for="novelTitle">Novel Title</label>
|
| 53 |
+
<input type="text" id="novelTitle" placeholder="e.g., Solo Leveling" required>
|
| 54 |
+
</div>
|
| 55 |
+
<div class="form-group">
|
| 56 |
+
<label for="novelUrl">Starting Chapter URL</label>
|
| 57 |
+
<input type="url" id="novelUrl" placeholder="https://example.com/novel/chapter-1" required>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="form-group">
|
| 60 |
+
<label for="loginEmail">Login Email <span class="optional">(optional)</span></label>
|
| 61 |
+
<input type="email" id="loginEmail" placeholder="your@email.com">
|
| 62 |
+
</div>
|
| 63 |
+
<div class="form-group">
|
| 64 |
+
<label for="loginPassword">Login Password <span class="optional">(optional)</span></label>
|
| 65 |
+
<input type="password" id="loginPassword" placeholder="••••••••">
|
| 66 |
+
</div>
|
| 67 |
+
<div class="form-group">
|
| 68 |
+
<label for="contentSelector">Content CSS Selector <span class="optional">(optional)</span></label>
|
| 69 |
+
<input type="text" id="contentSelector" placeholder=".chapter-content, .reading-content">
|
| 70 |
+
</div>
|
| 71 |
+
<div class="form-group">
|
| 72 |
+
<label for="nextBtnSelector">Next Button CSS Selector <span class="optional">(optional)</span></label>
|
| 73 |
+
<input type="text" id="nextBtnSelector" placeholder="a.next_page, a[rel='next']">
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
<button class="btn btn-primary" onclick="addSingleNovel()">
|
| 77 |
+
➕ Add Novel
|
| 78 |
+
</button>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
<!-- Batch Mode Form (Hidden by default) -->
|
| 82 |
+
<div id="batchNovelForm" style="display:none;">
|
| 83 |
+
<div class="form-group">
|
| 84 |
+
<label>Shared Login (applies to all novels below)</label>
|
| 85 |
+
<div class="form-row">
|
| 86 |
+
<input type="email" id="batchEmail" placeholder="Shared email">
|
| 87 |
+
<input type="password" id="batchPassword" placeholder="Shared password">
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
<div class="form-group">
|
| 91 |
+
<label>Novel URLs (one per line: Title | URL)</label>
|
| 92 |
+
<textarea id="batchInput" rows="10" placeholder="Solo Leveling | https://example.com/novel/sl/ch-1
|
| 93 |
+
Overgeared | https://example.com/novel/og/ch-1
|
| 94 |
+
The Beginning After The End | https://example.com/novel/tbate/ch-1"></textarea>
|
| 95 |
+
</div>
|
| 96 |
+
<button class="btn btn-primary" onclick="addBatchNovels()">
|
| 97 |
+
➕ Add All Novels
|
| 98 |
+
</button>
|
| 99 |
+
</div>
|
| 100 |
+
</section>
|
| 101 |
+
|
| 102 |
+
<!-- ======= CONTROL PANEL ======= -->
|
| 103 |
+
<section class="card">
|
| 104 |
+
<div class="card-header">
|
| 105 |
+
<h2>🎮 Control Panel</h2>
|
| 106 |
+
<div class="control-buttons">
|
| 107 |
+
<button class="btn btn-success" onclick="startAllScraping()">
|
| 108 |
+
▶️ Start All
|
| 109 |
+
</button>
|
| 110 |
+
<button class="btn btn-danger" onclick="stopAllScraping()">
|
| 111 |
+
⏹️ Stop All
|
| 112 |
+
</button>
|
| 113 |
+
<button class="btn btn-secondary" onclick="refreshStatus()">
|
| 114 |
+
🔄 Refresh
|
| 115 |
+
</button>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
<div class="system-info">
|
| 119 |
+
<div class="info-item">
|
| 120 |
+
<span class="info-label">Active Browsers:</span>
|
| 121 |
+
<span class="info-value" id="activeBrowsers">0</span>
|
| 122 |
+
<span class="info-label">/ </span>
|
| 123 |
+
<span class="info-value" id="maxBrowsers">3</span>
|
| 124 |
+
</div>
|
| 125 |
+
<div class="info-item">
|
| 126 |
+
<span class="info-label">Browser Status:</span>
|
| 127 |
+
<span class="info-value" id="browserStatus">⏳ Loading...</span>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
</section>
|
| 131 |
+
|
| 132 |
+
<!-- ======= NOVELS LIST / STATUS DASHBOARD ======= -->
|
| 133 |
+
<section class="card">
|
| 134 |
+
<div class="card-header">
|
| 135 |
+
<h2>📊 Novels Dashboard</h2>
|
| 136 |
+
</div>
|
| 137 |
+
<div id="novelsList" class="novels-grid">
|
| 138 |
+
<div class="empty-state">
|
| 139 |
+
<p>No novels added yet. Add some above! ☝️</p>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
</section>
|
| 143 |
+
|
| 144 |
+
<!-- ======= CAPTCHA INTERVENTION SECTION ======= -->
|
| 145 |
+
<section class="card" id="interventionSection" style="display:none;">
|
| 146 |
+
<div class="card-header">
|
| 147 |
+
<h2>🔓 Captcha Intervention</h2>
|
| 148 |
+
</div>
|
| 149 |
+
<div id="interventionContent">
|
| 150 |
+
<!-- Dynamically populated -->
|
| 151 |
+
</div>
|
| 152 |
+
</section>
|
| 153 |
+
|
| 154 |
+
</main>
|
| 155 |
+
|
| 156 |
+
<!-- ============================================ -->
|
| 157 |
+
<!-- TOAST NOTIFICATIONS -->
|
| 158 |
+
<!-- ============================================ -->
|
| 159 |
+
<div class="toast-container" id="toastContainer"></div>
|
| 160 |
+
|
| 161 |
+
<!-- ============================================ -->
|
| 162 |
+
<!-- SCRIPTS -->
|
| 163 |
+
<!-- ============================================ -->
|
| 164 |
+
<script src="/static/js/app.js"></script>
|
| 165 |
+
<script src="/static/js/intervention.js"></script>
|
| 166 |
+
<script src="/static/js/download.js"></script>
|
| 167 |
+
</body>
|
| 168 |
+
</html>
|