Dk / templates /index.html
alige's picture
Upload 8 files
5efe4e4 verified
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>视频抓取器 — TikTok / YouTube</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { font-family: Arial, sans-serif; margin: 30px; background:#f7f7f7 }
.card { background:white; padding:20px; border-radius:8px; max-width:800px; margin:auto; box-shadow:0 4px 12px rgba(0,0,0,0.06)}
input[type=text]{width:100%; padding:10px; margin:8px 0; box-sizing:border-box}
button{padding:10px 18px; border:none; background:#007bff; color:white; border-radius:6px; cursor:pointer}
button:hover{background:#0056cc}
.note{color:#555; font-size:0.9em}
.flash{background:#fffae6; padding:10px; border-left:4px solid #ffd24d; margin-bottom:12px}
table{width:100%; border-collapse:collapse; margin-top:20px; font-size:0.95em}
th,td{padding:8px; border-bottom:1px solid #ddd; text-align:left}
th{background:#f0f0f0}
a.download-link{text-decoration:none; color:#007bff}
a.download-link:hover{text-decoration:underline}
</style>
</head>
<body>
<div class="card">
<h2>视频抓取器(TikTok / YouTube)</h2>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="flash">
{% for msg in messages %}
<div>{{msg}}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<form method="post">
<label>主页链接(TikTok 或 YouTube 主页 / Shorts 页面):</label>
<input type="text" name="profile_url" placeholder="例如:https://www.tiktok.com/@bayashi.tiktok 或 https://www.youtube.com/@AdrenalineRushReviews/shorts">
<button type="submit">抓取最新 30 条</button>
<p class="note">说明:每次抓取会跳过已采集过的视频。结果追加到 output.xlsx,并另存时间戳文件。</p>
</form>
<h3 style="margin-top:30px;">📂 当前目录中的数据文件:</h3>
{% if files %}
<table>
<tr><th>文件名</th><th>最后修改时间</th><th>大小</th><th>下载</th></tr>
{% for f in files %}
<tr>
<td>{{ f.name }}</td>
<td>{{ f.mtime }}</td>
<td>{{ f.size }}</td>
<td><a class="download-link" href="{{ url_for('download', filename=f.name) }}">下载</a></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无抓取结果文件。</p>
{% endif %}
</div>
</body>
</html>