Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54fdea4f84 |
No files matched your search
+1
-1
@@ -51,7 +51,7 @@ ENV NODE_ENV=production
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
ENV DOCKER_ENV=true
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed71
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed73
|
||||
|
||||
# 从构建器中复制 standalone 输出
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
if(!self.define){let e,s={};const a=(a,n)=>(a=new URL(a+".js",n).href,s[a]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()}).then(()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didn’t register its module`);return e}));self.define=(n,i)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(s[c])return;let t={};const r=e=>a(e,c),o={module:{uri:c},exports:t,require:r};s[c]=Promise.all(n.map(e=>o[e]||r(e))).then(e=>(i(...e),t))}}define(["./workbox-e9849328"],function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"d3c25753d011e80b2ccd5a754ac24ed9"},{url:"/_next/static/0MjBArWMO37oCPAjOorM5/_buildManifest.js",revision:"85aecd8a55db42fc901f52386fd2a680"},{url:"/_next/static/0MjBArWMO37oCPAjOorM5/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/151-8711dd3ec7fbfa61.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/234-b4915b11eb0bb661.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/242-5a0502f47346ed4a.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/273-fffc7e5390a1c642.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/547-65bdb23e16942a03.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/609-46d66c37b95adf6a.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/78-b091442d784a205f.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/866-7f5b3d6941560701.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/_not-found/page-2f2263c5b98c190a.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/admin/page-759806afdd5b7523.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/config/page-228e0af5a31948e0.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/douban/page-72adc56cdd9fa67a.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/filter/page-4cebc2f48c3257a1.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/ipv6/page-8a601c06ae5900e7.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/layout-abad67b72f2d607d.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/live/page-f9e105dfdc52a0d4.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/login/page-b2957b92254ae889.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/page-e5765bbccc00a155.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/play/page-5cfe996f3331a017.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/search/page-62b12f466a432302.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/settings/page-acdcc4f7e3aba36e.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/tvbox/page-b0ddd4e31a961ddc.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/app/warning/page-e6b20b93b37dc516.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/b145b63a-d75d6adf389a7589.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/c72274ce-909438a8a5dd87a5.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/da9543df-c2ce5269243dd748.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/framework-6e06c675866dc992.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/main-8daa958ee4a360c2.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/main-app-734bbab0f54e7373.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/pages/_app-3fcac1a2c632f1ef.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/pages/_error-d3fe151bf402c134.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-f732225cafd52a05.js",revision:"0MjBArWMO37oCPAjOorM5"},{url:"/_next/static/css/23100062f5d4aac0.css",revision:"23100062f5d4aac0"},{url:"/_next/static/css/da6e9b4a73108890.css",revision:"da6e9b4a73108890"},{url:"/_next/static/css/e93463efba6c08e2.css",revision:"e93463efba6c08e2"},{url:"/_next/static/media/19cfc7226ec3afaa-s.woff2",revision:"9dda5cfc9a46f256d0e131bb535e46f8"},{url:"/_next/static/media/21350d82a1f187e9-s.woff2",revision:"4e2553027f1d60eff32898367dd4d541"},{url:"/_next/static/media/8e9860b6e62d6359-s.woff2",revision:"01ba6c2a184b8cba08b0d57167664d75"},{url:"/_next/static/media/ba9851c3c22cd980-s.woff2",revision:"9e494903d6b0ffec1a1e14d34427d44d"},{url:"/_next/static/media/c5fe6dc8356a8c31-s.woff2",revision:"027a89e9ab733a145db70f09b8a18b42"},{url:"/_next/static/media/df0a9ae256c0569c-s.woff2",revision:"d54db44de5ccb18886ece2fda72bdfe0"},{url:"/_next/static/media/e4af272ccee01ff0-s.p.woff2",revision:"65850a373e258f1c897a2b3d75eb74de"},{url:"/favicon.ico",revision:"c5deLine truncated
|
||||
if(!self.define){let e,s={};const n=(n,a)=>(n=new URL(n+".js",a).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(a,i)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(s[c])return;let t={};const o=e=>n(e,c),r={module:{uri:c},exports:t,require:o};s[c]=Promise.all(a.map(e=>r[e]||o(e))).then(e=>(i(...e),t))}}define(["./workbox-e9849328"],function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"be9d54592fea46176d680a09da2f8b03"},{url:"/_next/static/6pApvoOMGhTBhMnIA6395/_buildManifest.js",revision:"85aecd8a55db42fc901f52386fd2a680"},{url:"/_next/static/6pApvoOMGhTBhMnIA6395/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/151-8711dd3ec7fbfa61.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/234-c7c5e76b3553af41.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/242-5a0502f47346ed4a.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/273-fffc7e5390a1c642.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/547-65bdb23e16942a03.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/609-46d66c37b95adf6a.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/78-b091442d784a205f.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/866-7f5b3d6941560701.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/_not-found/page-2f2263c5b98c190a.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/admin/page-759806afdd5b7523.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/config/page-e7450485f43e42b7.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/douban/page-72adc56cdd9fa67a.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/filter/page-4cebc2f48c3257a1.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/ipv6/page-4396f8cd57b55d3b.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/layout-abad67b72f2d607d.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/live/page-83b49175a0a9d775.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/login/page-b2957b92254ae889.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/page-984f6128015dda92.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/play/page-4b74435a3843991f.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/search/page-62b12f466a432302.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/settings/page-137dd16f391763b9.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/tvbox/page-125bca4b61639acb.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/app/warning/page-e6b20b93b37dc516.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/b145b63a-d75d6adf389a7589.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/c72274ce-909438a8a5dd87a5.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/da9543df-c2ce5269243dd748.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/framework-6e06c675866dc992.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/main-68795df77d27d928.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/main-app-734bbab0f54e7373.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/pages/_app-3fcac1a2c632f1ef.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/pages/_error-d3fe151bf402c134.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-f732225cafd52a05.js",revision:"6pApvoOMGhTBhMnIA6395"},{url:"/_next/static/css/083d238e0b356531.css",revision:"083d238e0b356531"},{url:"/_next/static/css/23100062f5d4aac0.css",revision:"23100062f5d4aac0"},{url:"/_next/static/css/da6e9b4a73108890.css",revision:"da6e9b4a73108890"},{url:"/_next/static/media/19cfc7226ec3afaa-s.woff2",revision:"9dda5cfc9a46f256d0e131bb535e46f8"},{url:"/_next/static/media/21350d82a1f187e9-s.woff2",revision:"4e2553027f1d60eff32898367dd4d541"},{url:"/_next/static/media/8e9860b6e62d6359-s.woff2",revision:"01ba6c2a184b8cba08b0d57167664d75"},{url:"/_next/static/media/ba9851c3c22cd980-s.woff2",revision:"9e494903d6b0ffec1a1e14d34427d44d"},{url:"/_next/static/media/c5fe6dc8356a8c31-s.woff2",revision:"027a89e9ab733a145db70f09b8a18b42"},{url:"/_next/static/media/df0a9ae256c0569c-s.woff2",revision:"d54db44de5ccb18886ece2fda72bdfe0"},{url:"/_next/static/media/e4af272ccee01ff0-s.p.woff2",revision:"65850a373e258f1c897a2b3d75eb74de"},{url:"/favicon.ico",revision:"c5deLine truncated
|
||||
@@ -0,0 +1,67 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
const SEARXNG = process.env.SEARXNG_URL || 'http://192.168.68.19:4000';
|
||||
|
||||
interface HotComment {
|
||||
title: string;
|
||||
content: string;
|
||||
url: string;
|
||||
source: string;
|
||||
}
|
||||
|
||||
// 评论聚合:SearXNG 全网搜“片名+评价/影评/观后感”,正文长的优先,取前 10 条
|
||||
export async function GET(req: NextRequest) {
|
||||
const { searchParams } = new URL(req.url);
|
||||
const title = (searchParams.get('title') || '').trim();
|
||||
if (!title) return NextResponse.json({ code: 0, msg: '缺少片名', list: [] });
|
||||
|
||||
const queries = [`${title} 评价`, `${title} 影评 观后感`];
|
||||
const seen = new Set<string>();
|
||||
const out: HotComment[] = [];
|
||||
|
||||
for (const q of queries) {
|
||||
if (out.length >= 10) break;
|
||||
let d: any = null;
|
||||
try {
|
||||
const r = await fetch(
|
||||
`${SEARXNG}/search?q=${encodeURIComponent(q)}&format=json&language=zh-CN`,
|
||||
{ signal: AbortSignal.timeout(15000) }
|
||||
);
|
||||
if (!r.ok) continue;
|
||||
d = await r.json();
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
const results: any[] = Array.isArray(d?.results) ? d.results : [];
|
||||
// 正文长的优先(一般是真实影评),顺带过滤纯导航/下载站
|
||||
results.sort(
|
||||
(a, b) => String(b?.content || '').length - String(a?.content || '').length
|
||||
);
|
||||
for (const x of results) {
|
||||
if (out.length >= 10) break;
|
||||
const url: string = String(x?.url || '');
|
||||
const content: string = String(x?.content || '').replace(/\s+/g, ' ').trim();
|
||||
if (!url || !content || content.length < 40) continue;
|
||||
if (/rarbg|torrent|magnet|bt\.| JAV|javhd|porn|赌场|博彩|贷款/i.test(url + content)) continue;
|
||||
let host = '';
|
||||
try {
|
||||
host = new URL(url).hostname.replace(/^www\.|^m\.|^wap\./, '');
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
const key = host + '|' + content.slice(0, 60);
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
out.push({
|
||||
title: String(x?.title || host).slice(0, 80),
|
||||
content: content.slice(0, 600),
|
||||
url,
|
||||
source: host,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return NextResponse.json({ code: 1, msg: 'ok', list: out.slice(0, 10) });
|
||||
}
|
||||
+6
-6
@@ -61,12 +61,6 @@ export default async function RootLayout({
|
||||
let announcement =
|
||||
process.env.ANNOUNCEMENT ||
|
||||
'本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。Link Me TG:@katelya77';
|
||||
// 授权中心公告优先(CardAuth):有则覆盖默认免责声明,失败开放保留原公告
|
||||
try {
|
||||
const hub = (global as any).__licenseHub || eval('require')('/app/license-hub.js');
|
||||
const n = hub.getNotice ? hub.getNotice() : '';
|
||||
if (n) announcement = String(n);
|
||||
} catch {}
|
||||
let enableRegister = process.env.NEXT_PUBLIC_ENABLE_REGISTER === 'true';
|
||||
let imageProxy = process.env.NEXT_PUBLIC_IMAGE_PROXY || '';
|
||||
let doubanProxy = process.env.NEXT_PUBLIC_DOUBAN_PROXY || '';
|
||||
@@ -81,6 +75,12 @@ export default async function RootLayout({
|
||||
imageProxy = config.SiteConfig.ImageProxy;
|
||||
doubanProxy = config.SiteConfig.DoubanProxy;
|
||||
}
|
||||
// 授权中心公告优先(CardAuth):有则覆盖 config 默认免责声明,失败开放保留原公告
|
||||
try {
|
||||
const hub = (global as any).__licenseHub || eval('require')('/app/license-hub.js');
|
||||
const n = hub.getNotice ? hub.getNotice() : '';
|
||||
if (n) announcement = String(n);
|
||||
} catch {}
|
||||
|
||||
// 将运行时配置注入到全局 window 对象,供客户端在运行时读取
|
||||
const runtimeConfig = {
|
||||
|
||||
@@ -22,7 +22,6 @@ import ContinueWatching from '@/components/ContinueWatching';
|
||||
import HkDramaRow from '@/components/HkDramaRow';
|
||||
import PageLayout from '@/components/PageLayout';
|
||||
import PaginatedRow from '@/components/PaginatedRow';
|
||||
import { useSite } from '@/components/SiteProvider';
|
||||
import VideoCard from '@/components/VideoCard';
|
||||
|
||||
// 主内容区大型 KatelyaTV Logo 组件
|
||||
@@ -81,7 +80,6 @@ function HomeClient() {
|
||||
const [hotTvShows, setHotTvShows] = useState<DoubanItem[]>([]);
|
||||
const [hotVarietyShows, setHotVarietyShows] = useState<DoubanItem[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const { announcement } = useSite();
|
||||
|
||||
// 分页状态管理
|
||||
const [moviePage, setMoviePage] = useState(0);
|
||||
@@ -98,20 +96,6 @@ function HomeClient() {
|
||||
varietyShows: true,
|
||||
});
|
||||
|
||||
const [showAnnouncement, setShowAnnouncement] = useState(false);
|
||||
|
||||
// 检查公告弹窗状态
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined' && announcement) {
|
||||
const hasSeenAnnouncement = localStorage.getItem('hasSeenAnnouncement');
|
||||
if (hasSeenAnnouncement !== announcement) {
|
||||
setShowAnnouncement(true);
|
||||
} else {
|
||||
setShowAnnouncement(Boolean(!hasSeenAnnouncement && announcement));
|
||||
}
|
||||
}
|
||||
}, [announcement]);
|
||||
|
||||
// 收藏夹数据
|
||||
type FavoriteItem = {
|
||||
id: string;
|
||||
@@ -311,11 +295,6 @@ function HomeClient() {
|
||||
return unsubscribe;
|
||||
}, [activeTab]);
|
||||
|
||||
const handleCloseAnnouncement = (announcement: string) => {
|
||||
setShowAnnouncement(false);
|
||||
localStorage.setItem('hasSeenAnnouncement', announcement); // 记录已查看弹窗
|
||||
};
|
||||
|
||||
return (
|
||||
<PageLayout>
|
||||
<div className='px-4 sm:px-8 lg:px-12 py-4 sm:py-8 overflow-visible'>
|
||||
@@ -553,40 +532,6 @@ function HomeClient() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{announcement && showAnnouncement && (
|
||||
<div
|
||||
className={`fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm dark:bg-black/70 p-4 transition-opacity duration-300 ${
|
||||
showAnnouncement ? '' : 'opacity-0 pointer-events-none'
|
||||
}`}
|
||||
>
|
||||
<div className='w-full max-w-md rounded-xl bg-white p-6 shadow-xl dark:bg-gray-900 transform transition-all duration-300 hover:shadow-2xl'>
|
||||
<div className='flex justify-between items-start mb-4'>
|
||||
<h3 className='text-2xl font-bold tracking-tight text-gray-800 dark:text-white border-b border-purple-500 pb-1'>
|
||||
提示
|
||||
</h3>
|
||||
<button
|
||||
onClick={() => handleCloseAnnouncement(announcement)}
|
||||
className='text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-white transition-colors'
|
||||
aria-label='关闭'
|
||||
></button>
|
||||
</div>
|
||||
<div className='mb-6'>
|
||||
<div className='relative overflow-hidden rounded-lg mb-4 bg-purple-50 dark:bg-purple-900/20'>
|
||||
<div className='absolute inset-y-0 left-0 w-1.5 bg-purple-500 dark:bg-purple-400'></div>
|
||||
<p className='ml-4 text-gray-600 dark:text-gray-300 leading-relaxed'>
|
||||
{announcement}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => handleCloseAnnouncement(announcement)}
|
||||
className='w-full rounded-lg bg-gradient-to-r from-purple-600 to-purple-700 px-4 py-3 text-white font-medium shadow-md hover:shadow-lg hover:from-purple-700 hover:to-purple-800 dark:from-purple-600 dark:to-purple-700 dark:hover:from-purple-700 dark:hover:to-purple-800 transition-all duration-300 transform hover:-translate-y-0.5'
|
||||
>
|
||||
我知道了
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import { getVideoResolutionFromM3u8, processImageUrl } from '@/lib/utils';
|
||||
|
||||
import EpisodeSelector from '@/components/EpisodeSelector';
|
||||
import PageLayout from '@/components/PageLayout';
|
||||
import VideoMetaExtra from '@/components/VideoMetaExtra';
|
||||
import SkipController, { SkipSettingsButton } from '@/components/SkipController';
|
||||
|
||||
// 扩展 HTMLVideoElement 类型以支持 hls 属性
|
||||
@@ -1701,6 +1702,20 @@ function PlayPageClient() {
|
||||
{detail.desc}
|
||||
</div>
|
||||
)}
|
||||
{/* 演员 / 评分 / 全网热评 */}
|
||||
{detail && (
|
||||
<VideoMetaExtra
|
||||
title={detail.title}
|
||||
actor={detail.actor}
|
||||
director={detail.director}
|
||||
score={detail.score}
|
||||
scoreNum={detail.score_num}
|
||||
doubanScore={detail.douban_score}
|
||||
doubanId={detail.douban_id}
|
||||
area={detail.area}
|
||||
lang={detail.lang}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,10 +29,8 @@ export default function HubBell({ forceShow = false }: { forceShow?: boolean })
|
||||
<button
|
||||
onClick={() => {
|
||||
try {
|
||||
localStorage.removeItem('hasSeenAnnouncement');
|
||||
window.dispatchEvent(new CustomEvent('open-hub-notice'));
|
||||
} catch {}
|
||||
if (location.pathname === '/') location.reload();
|
||||
else location.href = '/';
|
||||
}}
|
||||
title='公告通知'
|
||||
className={
|
||||
|
||||
@@ -16,6 +16,30 @@ export default function HubNotice() {
|
||||
const [mode, setMode] = useState<'ann' | 'upd'>('ann');
|
||||
|
||||
useEffect(() => {
|
||||
const openHandler = () => {
|
||||
// 铃铛手动打开:有授权公告就显示公告,无公告则显示版本信息兜底
|
||||
fetch('/api/license-config', { cache: 'no-store' })
|
||||
.then((r) => r.json())
|
||||
.then((j) => {
|
||||
if (!j || j.code !== 200 || !j.data) return;
|
||||
const d = j.data as LicenseData;
|
||||
setData(d);
|
||||
if (d.announcement) {
|
||||
setMode('ann');
|
||||
setVisible(true);
|
||||
} else if (Array.isArray((d as any).announcements) && (d as any).announcements.length) {
|
||||
const first = (d as any).announcements[0];
|
||||
setData({ ...d, announcement: first });
|
||||
setMode('ann');
|
||||
setVisible(true);
|
||||
} else {
|
||||
setMode('upd');
|
||||
setVisible(true);
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
window.addEventListener('open-hub-notice', openHandler);
|
||||
const t = setTimeout(() => {
|
||||
fetch('/api/license-config', { cache: 'no-store' })
|
||||
.then((r) => r.json())
|
||||
@@ -42,7 +66,10 @@ export default function HubNotice() {
|
||||
})
|
||||
.catch(() => {});
|
||||
}, 1500);
|
||||
return () => clearTimeout(t);
|
||||
return () => {
|
||||
clearTimeout(t);
|
||||
window.removeEventListener('open-hub-notice', openHandler);
|
||||
};
|
||||
}, []);
|
||||
|
||||
if (!visible || !data) return null;
|
||||
@@ -50,11 +77,13 @@ export default function HubNotice() {
|
||||
const title =
|
||||
mode === 'ann' && data.announcement
|
||||
? String(data.announcement.title || '📢 公告')
|
||||
: '发现新版本 v' + String(data.latest || '');
|
||||
: data.latest
|
||||
? '发现新版本 v' + String(data.latest || '')
|
||||
: '米视TV v' + String(data.version || '');
|
||||
const body =
|
||||
mode === 'ann' && data.announcement
|
||||
? String(data.announcement.content || '')
|
||||
: String(data.changelog || '').slice(0, 600);
|
||||
: String(data.changelog || '当前已是最新版本,暂无授权中心公告。').slice(0, 600);
|
||||
|
||||
const close = (dismissVer = false) => {
|
||||
try {
|
||||
|
||||
@@ -23,6 +23,12 @@ const MobileHeader = ({ showBackButton = false }: MobileHeaderProps) => {
|
||||
|
||||
{/* 右侧按钮 */}
|
||||
<div className='flex items-center gap-2'>
|
||||
<span
|
||||
className='shrink-0 select-none rounded-md px-1.5 py-0.5 text-[10px] font-bold tracking-wide text-purple-600 dark:text-purple-400 bg-purple-500/10 border border-purple-500/20'
|
||||
title='米视TV 当前版本'
|
||||
>
|
||||
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed73'}
|
||||
</span>
|
||||
<ThemeToggle />
|
||||
<UserMenu />
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,12 @@ export default function TopRightButtons({ variant = 'bar' }: TopRightButtonsProp
|
||||
if (variant === 'float') {
|
||||
return (
|
||||
<div className='fixed top-2 right-2 z-50 flex items-center gap-1.5 rounded-xl bg-black/55 px-2 py-1.5 backdrop-blur-md border border-white/10'>
|
||||
<span
|
||||
className='shrink-0 select-none rounded-md px-1.5 py-1 text-[10px] font-bold tracking-wide text-purple-300 bg-purple-500/20 border border-purple-400/30'
|
||||
title='米视TV 当前版本'
|
||||
>
|
||||
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed73'}
|
||||
</span>
|
||||
<HubBell forceShow />
|
||||
<TvboxButton forceShow compact />
|
||||
<Ipv6Button forceShow compact />
|
||||
@@ -37,7 +43,7 @@ export default function TopRightButtons({ variant = 'bar' }: TopRightButtonsProp
|
||||
className='hidden lg:inline-flex shrink-0 items-center select-none rounded-lg px-2 py-1.5 text-xs font-bold tracking-wide text-purple-600 dark:text-purple-400 bg-purple-500/10 border border-purple-500/20'
|
||||
title='米视TV 当前版本'
|
||||
>
|
||||
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed71'}
|
||||
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed73'}
|
||||
</span>
|
||||
<HubBell />
|
||||
<TvboxButton />
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
interface HotComment {
|
||||
title: string;
|
||||
content: string;
|
||||
url: string;
|
||||
source: string;
|
||||
}
|
||||
|
||||
// 演员 / 评分 / 全网热评(详情页简介下方)
|
||||
export default function VideoMetaExtra({
|
||||
title,
|
||||
actor,
|
||||
director,
|
||||
score,
|
||||
scoreNum,
|
||||
doubanScore,
|
||||
doubanId,
|
||||
area,
|
||||
lang,
|
||||
}: {
|
||||
title: string;
|
||||
actor?: string;
|
||||
director?: string;
|
||||
score?: string;
|
||||
scoreNum?: number;
|
||||
doubanScore?: string;
|
||||
doubanId?: number;
|
||||
area?: string;
|
||||
lang?: string;
|
||||
}) {
|
||||
const [comments, setComments] = useState<HotComment[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!title) return;
|
||||
let alive = true;
|
||||
setLoading(true);
|
||||
fetch(`/api/hot-comments?title=${encodeURIComponent(title)}`)
|
||||
.then((r) => r.json())
|
||||
.then((d) => {
|
||||
if (alive && d?.code === 1) setComments(d.list || []);
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
if (alive) setLoading(false);
|
||||
});
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
}, [title]);
|
||||
|
||||
const actors = (actor || '')
|
||||
.split(/[,,、\/|]/)
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
.slice(0, 20);
|
||||
const scoreNum1 = parseFloat(score || '') || 0;
|
||||
const dbNum = parseFloat(doubanScore || '') || 0;
|
||||
const showScore = scoreNum1 > 0 ? scoreNum1.toFixed(1) : dbNum > 0 ? dbNum.toFixed(1) : '';
|
||||
|
||||
if (!actors.length && !director && !showScore && !area && !loading && !comments.length) return null;
|
||||
|
||||
return (
|
||||
<div className='mt-4 space-y-4'>
|
||||
{/* 导演 / 地区 / 语言 */}
|
||||
{(director || area || lang) && (
|
||||
<div className='text-sm opacity-80 space-x-4'>
|
||||
{director && (
|
||||
<span>
|
||||
导演:<span className='font-medium'>{director}</span>
|
||||
</span>
|
||||
)}
|
||||
{area && <span>地区:{area}</span>}
|
||||
{lang && <span>语言:{lang}</span>}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 评分 */}
|
||||
{showScore && (
|
||||
<div className='flex items-center gap-2'>
|
||||
<span className='text-sm opacity-80'>评分</span>
|
||||
<span className='text-2xl font-bold text-amber-500'>{showScore}</span>
|
||||
<span className='flex text-amber-500'>
|
||||
{[1, 2, 3, 4, 5].map((i) => (
|
||||
<span key={i} className={i <= Math.round(Number(showScore) / 2) ? '' : 'opacity-30'}>
|
||||
★
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
{scoreNum && scoreNum > 0 && <span className='text-xs opacity-60'>({scoreNum}人评)</span>}
|
||||
{doubanId ? (
|
||||
<a
|
||||
href={`https://movie.douban.com/subject/${doubanId}/`}
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
className='text-xs text-green-600 hover:underline ml-1'
|
||||
>
|
||||
豆瓣详情 →
|
||||
</a>
|
||||
) : null}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 演员列表 */}
|
||||
{actors.length > 0 && (
|
||||
<div>
|
||||
<div className='text-sm font-semibold mb-2 opacity-80'>演员({actors.length})</div>
|
||||
<div className='flex flex-wrap gap-2'>
|
||||
{actors.map((a) => (
|
||||
<Link
|
||||
key={a}
|
||||
href={`/search?q=${encodeURIComponent(a)}`}
|
||||
title={`搜索${a}的全部作品`}
|
||||
className='px-3 py-1 rounded-full bg-gray-200/70 dark:bg-gray-700/70 text-sm hover:bg-green-500 hover:text-white dark:hover:bg-green-600 transition-colors cursor-pointer'
|
||||
>
|
||||
{a}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 全网热评 Top10 */}
|
||||
<div>
|
||||
<div className='text-sm font-semibold mb-2 opacity-80'>
|
||||
全网热评 Top10 <span className='font-normal opacity-60'>(来自网上公开影评聚合)</span>
|
||||
</div>
|
||||
{loading && comments.length === 0 && (
|
||||
<div className='space-y-2'>
|
||||
{[0, 1, 2].map((i) => (
|
||||
<div key={i} className='animate-pulse h-14 rounded-lg bg-gray-200/70 dark:bg-gray-700/50' />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{!loading && comments.length === 0 && (
|
||||
<div className='text-sm opacity-50'>暂无全网热评,换个片名或稍后再试。</div>
|
||||
)}
|
||||
<div className='space-y-2'>
|
||||
{comments.map((c, i) => (
|
||||
<a
|
||||
key={i}
|
||||
href={c.url}
|
||||
target='_blank'
|
||||
rel='noreferrer'
|
||||
className='block rounded-lg bg-gray-100/80 dark:bg-gray-800/60 p-3 hover:bg-gray-200/80 dark:hover:bg-gray-700/60 transition-colors'
|
||||
>
|
||||
<div className='flex items-center gap-2 mb-1'>
|
||||
<span className='text-xs font-bold text-white bg-amber-500 rounded px-1.5 py-0.5'>
|
||||
{i + 1}
|
||||
</span>
|
||||
<span className='text-sm font-medium truncate flex-1'>{c.title}</span>
|
||||
<span className='text-xs opacity-50 flex-shrink-0'>{c.source}</span>
|
||||
</div>
|
||||
<div className='text-sm opacity-80 leading-relaxed line-clamp-3'>{c.content}</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -266,6 +266,13 @@ export async function getDetailFromApi(
|
||||
desc: cleanHtmlTags(videoDetail.vod_content),
|
||||
type_name: videoDetail.type_name,
|
||||
douban_id: videoDetail.vod_douban_id,
|
||||
actor: videoDetail.vod_actor || '',
|
||||
director: videoDetail.vod_director || '',
|
||||
score: String(videoDetail.vod_score ?? ''),
|
||||
score_num: Number(videoDetail.vod_score_num ?? 0) || 0,
|
||||
douban_score: String(videoDetail.vod_douban_score ?? ''),
|
||||
area: videoDetail.vod_area || '',
|
||||
lang: videoDetail.vod_lang || '',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,13 @@ export interface SearchResult {
|
||||
desc?: string;
|
||||
type_name?: string;
|
||||
douban_id?: number;
|
||||
actor?: string;
|
||||
director?: string;
|
||||
score?: string;
|
||||
score_num?: number;
|
||||
douban_score?: string;
|
||||
area?: string;
|
||||
lang?: string;
|
||||
}
|
||||
|
||||
// 豆瓣数据结构
|
||||
|
||||
Reference in new issue
Block a user