AI 生成: 一个基于 Python Flask 的影视采集站,自动从公开采集接口抓取影视资源,提供现代风格的分类浏览页面和在线播放功能。
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}影视采集站{% endblock %}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<script src="https://cdn.jsdelivr.net/npm/hls.js@1.5.13/dist/hls.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<div class="container header-inner">
|
||||
<a href="/" class="logo">🎬 影视采集站</a>
|
||||
<form class="search" action="/" method="get">
|
||||
<input type="text" name="wd" placeholder="搜索影片..." value="{{ keyword or '' }}">
|
||||
<button type="submit">搜索</button>
|
||||
</form>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<nav class="nav">
|
||||
<div class="container nav-inner">
|
||||
<a href="/" class="{% if not current_cat %}active{% endif %}">全部</a>
|
||||
{% for c in categories %}
|
||||
<a href="/category/{{ c.id }}" class="{% if current_cat == c.id %}active{% endif %}">{{ c.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="container main">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
© {{ 2025 }} 影视采集站 · 仅供学习交流
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}{{ movie.name }} - 影视采集站{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="detail">
|
||||
<div class="detail-head">
|
||||
<img class="detail-poster" src="{{ movie.pic }}" alt="{{ movie.name }}" onerror="this.src='https://via.placeholder.com/300x420?text=No+Image'">
|
||||
<div class="detail-meta">
|
||||
<h1>{{ movie.name }}</h1>
|
||||
<p class="tags">
|
||||
{% if movie.year %}<span>{{ movie.year }}</span>{% endif %}
|
||||
{% if movie.area %}<span>{{ movie.area }}</span>{% endif %}
|
||||
{% if movie.type_name %}<span>{{ movie.type_name }}</span>{% endif %}
|
||||
{% if movie.remarks %}<span>{{ movie.remarks }}</span>{% endif %}
|
||||
</p>
|
||||
<p><strong>导演:</strong>{{ movie.director or '未知' }}</p>
|
||||
<p><strong>主演:</strong>{{ movie.actors or '未知' }}</p>
|
||||
<p class="intro">{{ movie.content or '' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="player-wrap">
|
||||
<div class="source-tabs">
|
||||
{% for s in movie.play_sources %}
|
||||
<button class="source-tab {% if loop.first %}active{% endif %}" data-idx="{{ loop.index0 }}">{{ s.source }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="player">
|
||||
<video id="video" controls playsinline></video>
|
||||
</div>
|
||||
|
||||
<div class="episodes">
|
||||
{% for s in movie.play_sources %}
|
||||
<div class="episode-group" data-idx="{{ loop.index0 }}" {% if not loop.first %}style="display:none"{% endif %}>
|
||||
{% for ep in s.episodes %}
|
||||
<button class="ep-btn" data-url="{{ ep.url }}">{{ ep.title }}</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.__PLAY_SOURCES__ = {{ movie.play_sources | tojson }};
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,35 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}首页 - 影视采集站{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if keyword %}
|
||||
<h2 class="section-title">搜索:{{ keyword }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{% if movies %}
|
||||
<div class="grid">
|
||||
{% for m in movies %}
|
||||
<a class="card" href="/detail/{{ m.vod_id }}">
|
||||
<div class="poster">
|
||||
<img src="{{ m.pic }}" alt="{{ m.name }}" loading="lazy" onerror="this.src='https://via.placeholder.com/300x420?text=No+Image'">
|
||||
{% if m.remarks %}<span class="badge">{{ m.remarks }}</span>{% endif %}
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">{{ m.name }}</div>
|
||||
<div class="meta">{{ m.year or '' }} {{ m.type_name or '' }}</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="pager">
|
||||
{% if page > 1 %}
|
||||
<a href="?page={{ page - 1 }}{% if keyword %}&wd={{ keyword }}{% endif %}">上一页</a>
|
||||
{% endif %}
|
||||
<span>第 {{ page }} 页</span>
|
||||
<a href="?page={{ page + 1 }}{% if keyword %}&wd={{ keyword }}{% endif %}">下一页</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty">暂无数据,请检查采集源配置。</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user