LibreTV
ApplicationLibreSpark/LibreTV
Free online video aggregation, search and streaming platform built with Next.js.
Overview
LibreTV is a self-hostable web app for aggregated movie and TV search across multiple sources, with HLS playback via ArtPlayer and hls.js. It supports live IPTV with M3U playlists and EPG, watch progress sync in IndexedDB, source health checks, and light/dark themes. Deployable via Docker with password protection.
README Preview
# LibreTV\n\nLibreTV Next.js 迁移版:免费在线视频聚合搜索与观看平台。基于 Next.js 15(App Router)+ TypeScript + Tailwind CSS,播放内核为 ArtPlayer + hls.js,支持亮暗双主题。\n\n> 🏠 **官网**:[LibreTV 官网](https://libretv.is-an.org/)\n>\n> 🌐 **演示站**:[tv.bagiinlink.eu.org](https://tv.bagiinlink.eu.org)(访问密码:`libretv`)\n>\n> 📖 **完整文档**:[文档首页](https://libretv.is-an.org/wiki/) · [架构](https://libretv.is-an.org/wiki/Architecture.html) · [部署](https://libretv.is-an.org/wiki/Deployment.html) · [配置](https://libretv.is-an.org/wiki/Configuration.html) · [数据源](https://libretv.is-an.org/wiki/Data-Sources.html) · [直播 / IPTV](https://libretv.is-an.org/wiki/Live-IPTV.html) · [首页推荐](https://libretv.is-an.org/wiki/Recommendations.html) · [播放器](https://libretv.is-an.org/wiki/Player.html) · [代理与安全](https://libretv.is-an.org/wiki/Proxy-Security.html) · [FAQ](https://libretv.is-an.org/wiki/FAQ.html)\n>\n\n\n \n\n\n## 核心特性\n\n- **聚合搜索**:多采集站服务端并行搜索\n- **跨源同名聚合**:同名影片合并为一张卡片,展开即可比较和选择各来源\n- **HLS 播放**:ArtPlayer + hls.js,广告分片过滤、自动连播、倍速、快捷键、移动端长按 3 倍速\n- **直播 / IPTV**:M3U 订阅解析,`/live` 页面按分组浏览、搜索频道并站内播放(HLS + HTTP-FLV),支持 XMLTV 节目单(EPG)与频道收藏;直播流经专用长连接代理(`/api/live/stream`)转发\n- **进度同步**:播放进度与观看历史存于本机 IndexedDB,精确到秒的续播\n- **换源测速**:跨源搜索同名资源并测速排序,一键切换保留集数位置\n- **源测试与订阅**:一键探活点播源与直播源(支持批量测活);搜索时自动记录各源健康度,连续失败的源按阶梯时长自动停用(30 分钟 → 24 小时 → 长期),可一键恢复;订阅远程源列表(一份 LibreTV-SourceList JSON 可同时下发点播源与直播源,也可直接填 TVBOX 配置地址,自动导入其中可直接使用的接口),可导出分享\n- **首页推荐**:豆瓣(电影/剧集分类浏览)、Bangumi 新番放送表或影视榜单(豆瓣周榜 + 百度热播,经 60s API),设置中切换;均服务端直连 + 缓存,Bangumi/榜单免 key 免配置(`60S_API_BASE` 可指向自部署 60s 实例)\n- **PWA**:可安装到桌面 / 主屏幕,亮暗双主题无首屏闪烁\n\n## 部署\n\n### Docker(推荐)\n\n```bash\n# 在 .env 中设置 PASSWORD\necho "PASSWORD=your-password" > .env\n\n# 方式一:拉取发布镜像(零构建)\ndocker compose pull && docker compose up -d\n\n# 方式二:源码构建\ndocker compose up -d --build\n```\n\n### Docker Compose\n\n```yaml\nservices:\n libretv:\n image: ghcr.io/librespark/libretv:latest\n container_name: libretv\n restart: unless-stopped\n ports:\n - "8080:8080"\n environment:\n - PASSWORD=ch
FAQ (1)
TroubleshootingWhy does login fail with correct password when accessing via http://server-ip:port?
In production mode the session cookie is set with the Secure flag, so browsers only store it over HTTPS or localhost. When you access the app via http://server-ip:port, the login actually succeeds but the browser silently drops the cookie, making it look like the password is wrong. Fix: serve the site over HTTPS by putting it behind a reverse proxy with TLS — e.g. Nginx, Caddy (auto HTTPS with a domain), or Traefik — or use Cloudflare (free Tunnel/Proxy) to terminate TLS. For local-only access, use http://localhost:port instead of the LAN IP, which is exempt from the Secure cookie restriction.