### Basic Playback and Initial Setup Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Guide for first-time users to start playing videos and configure basic settings like remote media libraries. ```text 1. 启动 NipaPlay。 2. 直接播放本地文件(任选一种方式): - 拖拽视频文件到播放界面,即刻开始播放 - 进入"媒体库" → 添加本地目录 → 选择视频 3. 播放中可在底部控制栏: - 切换弹幕(开启/关闭/样式调整) - 切换字幕轨道(ASS/SRT/内嵌) - 调整倍速播放(0.5x - 2.0x) - 调节音量与进度 4. 连接远程媒体库(可选): 设置 → 远程媒体库 → 填写 Emby/Jellyfin 服务器地址 → 保存 ⚠️ 选择媒体库后务必滑动到底部点击"保存"按钮,否则设置不会生效。 ``` -------------------------------- ### OpenMediaVault Docker Setup Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/DEPLOYMENT_GUIDE.md Steps to set up NipaPlay on OpenMediaVault, involving installing the Docker plugin and using Portainer for container management after creating a docker-compose.yml file. ```bash # 1. 安装Docker插件 omv-extras-org # 2. 创建docker-compose.yml # 3. 使用Portainer管理容器 ``` -------------------------------- ### Install NipaPlay-Reload on Gentoo Linux Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/installation.md Install NipaPlay-Reload on Gentoo Linux using an ebuild file. ```bash ebuild gentoo/media-video/nipaplay-bin/nipaplay-bin-1.8.11.ebuild merge ``` -------------------------------- ### Install NipaPlay-Reload on Gentoo Linux Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Install NipaPlay-Reload on Gentoo Linux using ebuild. Ensure you have the correct overlay configured. ```bash # Gentoo Linux ebuild gentoo/media-video/nipaplay-bin/nipaplay-bin-1.8.11.ebuild merge ``` -------------------------------- ### Install Git on Linux Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/01-Environment-Setup.md Commands to install Git on Debian/Ubuntu, Fedora, and Arch Linux distributions. ```bash sudo apt-get install git ``` ```bash sudo dnf install git ``` ```bash sudo pacman -S git ``` -------------------------------- ### Install NipaPlay-Reload on Arch Linux Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/installation.md Install NipaPlay-Reload on Arch Linux using either paru or yay AUR helpers. ```bash paru -S nipaplay-reload-bin # 或 yay -S nipaplay-reload-bin ``` -------------------------------- ### Install NipaPlay-Reload with Homebrew on macOS Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/installation.md Use Homebrew to tap the repository and install NipaPlay-Reload as a cask. This method simplifies future updates. ```bash brew tap AimesSoft/nipaplay-reload brew install --cask nipaplay-reload ``` -------------------------------- ### Install NipaPlay-Reload on Arch Linux (AUR) Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Install NipaPlay-Reload from the Arch User Repository (AUR) using an AUR helper like paru or yay. ```bash # Arch Linux (AUR) paru -S nipaplay-reload-bin # 或 yay -S nipaplay-reload-bin ``` -------------------------------- ### Prompting Codex for Style Compliance Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/04-Coding-Style.md Example prompt to guide Codex in generating Flutter code that adheres to specific style requirements, such as naming conventions and documentation. This helps ensure generated code aligns with project standards from the outset. ```text > "Please help me create a Flutter page to display a list of users. Please ensure all variables and functions use `lowerCamelCase` naming, and add documentation comments for the main classes and functions." ``` -------------------------------- ### Example Danmaku List Response (XML) Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html This is an example of the danmaku list returned by the API, formatted as XML. It includes details for each danmaku item such as ID, user, time, mode, color, size, and timestamp. ```xml 没什么 人气 这台词太恶意了 安心的音效 ``` -------------------------------- ### PKCE Implementation Example (JavaScript) Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/OAuthController.md Provides functions to generate a code verifier and code challenge for PKCE. Save the verifier for the token request and use the challenge in the authorization URL. ```javascript // 生成 code_verifier function generateCodeVerifier() { const array = new Uint8Array(32); crypto.getRandomValues(array); return base64UrlEncode(array); } ``` ```javascript // 生成 code_challenge async function generateCodeChallenge(verifier) { const encoder = new TextEncoder(); const data = encoder.encode(verifier); const hash = await crypto.subtle.digest('SHA-256', data); return base64UrlEncode(new Uint8Array(hash)); } ``` ```javascript function base64UrlEncode(buffer) { return btoa(String.fromCharCode(...buffer)) .replace(/\+\/g, '-') .replace(/\//g, '_') .replace(/=+$/, ''); } ``` ```javascript // 使用 const verifier = generateCodeVerifier(); const challenge = await generateCodeChallenge(verifier); // 保存 verifier,在 /token 请求时使用 // 在授权 URL 中使用 challenge ``` -------------------------------- ### Example API Response Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html This is an example of a typical API response, indicating the Dandanplay version, current time, and whether API authentication is required. ```json { "message": "Hello dandanplay user!", "version": "9.4.7.517", "time": "05/19/2019 11:45:45", "tokenRequired": true } ``` -------------------------------- ### Define Plugin Manifest with Permissions Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/js-plugin-api.md Example of a plugin manifest including a list of declared permissions. Permissions must be strings from the allowed list. ```javascript const pluginManifest = { id: 'com.example.myplugin', name: '我的插件', version: '1.0.0', minHostVersion: '1.11.0', description: '描述', author: '作者', permissions: [ 'player.control', 'danmaku.modify', 'ui.dialog' ] }; ``` -------------------------------- ### Synology NAS Docker Auto-Start Script Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/DEPLOYMENT_GUIDE.md A user-defined script to be configured in Synology's Task Scheduler to automatically start the NipaPlay Docker container on system boot. ```bash # 在控制面板 -> 任务计划中添加 # 类型: 用户定义的脚本 # 计划: 开机时运行 #!/bin/bash docker start nipaplay-server ``` -------------------------------- ### Plugin Initialization Lifecycle Hook Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/js-plugin-api.md Called when the plugin is enabled. Use this hook for setup tasks, like showing a notification. ```javascript function pluginOnInitialize() { // 插件启用时调用 ui.showSnackBar('插件已启用'); } ``` -------------------------------- ### Get Welcome Information Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves welcome information from the API. This endpoint can be used to check if token authentication is required. ```APIDOC ## GET /api/v1/welcome and /welcome ### Description Retrieves welcome information, including whether token authentication is required. ### Method GET ### Endpoint /api/v1/welcome or /welcome ### Parameters None ### Request Example GET /api/v1/welcome ### Response #### Success Response (200) - **tokenRequired** (boolean) - Indicates if token authentication is enabled. ``` -------------------------------- ### Get Welcome Information Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a welcome message from the API. This endpoint can be accessed via `/api/v1/welcome` or `/welcome`. ```APIDOC ## GET /api/v1/welcome or /welcome ### Description Retrieves a welcome message from the API. ### Method GET ### Endpoint /api/v1/welcome or /welcome ### Response #### Success Response (200) - **message** (string) - The welcome message. ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/01-Environment-Setup.md Change your current directory to the newly cloned NipaPlay-Reload project folder. ```bash cd NipaPlay-Reload ``` -------------------------------- ### Install NipaPlay-Reload via Homebrew on macOS Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Use Homebrew to install NipaPlay-Reload on macOS. Ensure you have Homebrew installed and the AimesSoft tap added. ```bash # macOS (Homebrew,推荐) brew tap AimesSoft/nipaplay-reload brew install --cask nipaplay-reload ``` -------------------------------- ### 暂存修改 Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/05-Example-Add-A-New-Page.md 使用 `git add` 命令暂存新增或修改的文件,为提交做准备。 ```bash git add lib/themes/nipaplay/pages/settings/contributors_page.dart git add lib/themes/nipaplay/pages/settings_page.dart ``` -------------------------------- ### Get Subtitle File Content Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Get the content of a specific subtitle file for a video. ```APIDOC ## Get Subtitle File Content ### Description Get the content of a specific subtitle file for a video. ### Method GET ### Endpoint /api/v1/subtitle/file/{id}?fileName={fileName} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the video. #### Query Parameters - **fileName** (string) - Required - The name of the subtitle file. ### Response #### Success Response (200) - **content** (string) - The content of the subtitle file. ``` -------------------------------- ### Initialize Git Configuration Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/01-Environment-Setup.md Configure your Git username and email. Ensure these match your GitHub account information for proper commit tracking. ```bash git config --global user.name "[你的用户名]" git config --global user.email [你的邮箱] ``` -------------------------------- ### Get Subtitle File List for Video Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Get a list of subtitle files associated with a specific video. ```APIDOC ## Get Subtitle File List for Video ### Description Get a list of subtitle files associated with a specific video. ### Method GET ### Endpoint /api/v1/subtitle/info/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the video. ### Response #### Success Response (200) - **subtitles** (array) - A list of subtitle file names. ``` -------------------------------- ### Configure Bangumi (bgm.tv) Watch Progress Sync Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Instructions for setting up synchronization with Bangumi (bgm.tv) to manage your watch progress and collection across platforms. Requires generating an access token. ```text 配置步骤: 1. 访问 https://next.bgm.tv/demo/access-token 2. 创建新令牌(权限选择:read, write) 3. 复制令牌值 4. 打开 NipaPlay:设置 → 账号 → Bangumi同步 → 输入令牌 同步功能: - 观看记录自动同步到 Bangumi 收藏 - 观看进度和评分实时更新 - 收藏状态自动管理(在看/看完/搁置等) - 动画详情页可撰写 Bangumi 短评 - 支持一键同步历史观看记录 ``` -------------------------------- ### Linux 命令行设置文件关联 Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/FILE_ASSOCIATION_SETUP.md 使用 xdg-mime 命令为 NipaPlay 设置多种视频格式的默认打开方式。确保 nipaplay.desktop 文件已正确安装。 ```bash xdg-mime default nipaplay.desktop video/mp4 xdg-mime default nipaplay.desktop video/x-matroska xdg-mime default nipaplay.desktop video/avi xdg-mime default nipaplay.desktop video/quicktime xdg-mime default nipaplay.desktop video/webm ``` -------------------------------- ### Complete Plugin Manifest Example Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Defines the essential metadata for a JS plugin, including its unique ID, name, version, required host version, and optional details like description, author, and permissions. Ensure all required fields (id, name, version, minHostVersion) are non-empty to avoid plugin invalidation. ```javascript const pluginManifest = { id: 'com.example.my_plugin', // 必填,全局唯一标识 name: '我的插件', // 必填,展示名称 version: '1.0.0', // 必填,插件版本号 minHostVersion: '1.11.0', // 必填,要求宿主 NipaPlay 最低版本 description: '插件功能描述', // 可选 author: 'Your Name', // 可选 github: 'https://github.com/...', // 可选 permissions: [ // 可选,声明所需权限 'player.control', // 控制播放器(播放/暂停/跳转) 'danmaku.modify', // 修改弹幕显示和过滤规则 'ui.dialog', // 显示弹窗和提示信息 'library.read', // 读取媒体库信息 'library.write', // 修改媒体库内容 'settings.read', // 读取应用设置 'settings.modify', // 修改应用设置 'storage', // 使用本地存储 'system.override' // 覆盖系统级设置(如解锁下载器) ] }; // 若 id/name/version/minHostVersion 任一为空,插件将被判定为无效 ``` -------------------------------- ### Arch Linux - 使用 yay 更新 NipaPlay Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/release-channels.md 通过 yay AUR 助手更新 NipaPlay。首先检查所有可更新的 AUR 包,然后单独更新 NipaPlay。 ```bash # 检查可更新的 AUR 包 yay -Sua # 更新 NipaPlay yay -S nipaplay-reload-bin ``` -------------------------------- ### UI Entry Configuration Example Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Defines UI elements for plugin settings, supporting clickable items, toggles (Switches), and text input fields. The `enabled` field renders a Switch, and `textSetting` renders a text input. User input for text fields is persisted by the host. ```javascript const pluginManifest = { id: 'com.example.ui_demo', name: 'UI 入口示例', version: '1.0.0', minHostVersion: '1.11.0', permissions: ['ui.dialog'] }; var pluginUIEntries = [ // 1. 普通点击项(id/title 必填,description 可选) { id: 'preview', title: '词库预览', description: '查看当前生效的屏蔽词列表' }, // 2. 开关项(提供 enabled 字段时渲染为 Switch) // 用户切换开关后,宿主调用 pluginHandleUIAction(entry.id) { id: 'filter_spam', title: '过滤刷屏弹幕', description: '自动过滤重复发送的弹幕', enabled: true // 初始开关状态 }, // 3. 文本输入框(提供 textSetting 时渲染为输入框) // 用户输入的值由宿主持久化,插件通过 settings.getText(id) 读取 { id: 'api_url', title: 'API 地址', description: '弹幕数据接口地址', textSetting: { hintText: 'https://example.com/api', default: '' } }, { id: 'max_retries', title: '最大重试次数', description: '请求失败时的重试次数(0-10)', textSetting: { hintText: '3', default: '3' } } // 注意:enabled 与 textSetting 同时存在时,enabled 优先(渲染为开关) ]; ``` -------------------------------- ### Player Kernel Comparison and Configuration Source: https://context7.com/aimessoft/nipaplay-reload/llms.txt Compares the three available player kernels (Libmpv, MDK, Video Player) and provides instructions for manually replacing the libmpv.dll on Windows for enhanced codec support. ```text 内核对比: ┌─────────────────┬──────────────────────────────────────────┬──────────────┐ │ 内核 │ 特性 │ 推荐场景 │ ├─────────────────┼──────────────────────────────────────────┼──────────────┤ │ Libmpv(推荐) │ 硬件解码、兼容性强、字幕完整 │ 首选,所有场景│ │ MDK (FVP) │ 跨平台、硬解优先(不可用时软解回落) │ 备选 │ │ Video Player │ Flutter 官方、稳定但功能基础 │ 最终备选 │ └─────────────────┴──────────────────────────────────────────┴──────────────┘ 切换路径:设置 → 播放器内核 → 选择对应内核 Windows 平台完整解码能力(自编译场景手动替换 libmpv): 1. 访问 https://sourceforge.net/projects/mpv-player-windows/files/libmpv/ 2. 下载 mpv-dev-x86_64-v3(需 CPU 支持 AVX2,Intel 4代酷睿+) 3. 关闭 NipaPlay,备份原 libmpv-2.dll 4. 将下载的 libmpv-2.dll 替换到安装目录 5. 重新启动 NipaPlay 替换后改善项: - HDR10、10bit 视频黑屏问题 - H.264/H.265 高级格式播放失败 - PGS/SUP 字幕无法显示 - 杜比视界等高级格式不支持 ``` -------------------------------- ### Add Contributor Name to About Page (Example) Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/03-How-To-Contribute.md This is an example of code modification suggested by Codex. It adds a text widget to display contributor information below the application version. ```dart // ... existing code ... Text('Version: ${packageInfo.version}'), const SizedBox(height: 8), // Might add spacing const Text('由 MCDF 贡献'), // ... other existing code ... ``` -------------------------------- ### Arch Linux - 使用 paru 更新 NipaPlay Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/release-channels.md 通过 paru AUR 助手更新 NipaPlay。首先检查所有可更新的 AUR 包,然后单独更新 NipaPlay。 ```bash # 检查可更新的 AUR 包 paru -Sua # 更新 NipaPlay paru -S nipaplay-reload-bin ``` -------------------------------- ### Get Download Tasks Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a list of current download tasks. ```APIDOC ## Get Download Tasks ### Description Fetches the list of all active download tasks. ### Method GET ### Endpoint /api/v1/download/tasks ``` -------------------------------- ### Get Playlist Content Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves the content of the current playback playlist. ```APIDOC ## GET /api/v1/playlist ### Description Retrieves the content of the current playback playlist. ### Method GET ### Endpoint /api/v1/playlist ### Response #### Success Response (200) - **playlist** (array) - An array of objects, where each object represents a video in the playlist. ``` -------------------------------- ### Get Video Thumbnail by Hash Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a video thumbnail using its hash. ```APIDOC ## GET /api/v1/image/{hash} ### Description Retrieves a video thumbnail using its hash. ### Method GET ### Endpoint /api/v1/image/{hash} ### Parameters #### Path Parameters - **hash** (string) - Required - The hash of the video for which to retrieve the thumbnail. ``` -------------------------------- ### Get Download Task List Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieve a list of all current download tasks. ```APIDOC ## Get Download Task List ### Description Retrieve a list of all current download tasks. ### Method GET ### Endpoint /api/v1/download/tasks ### Response #### Success Response (200) - **tasks** (array) - A list of download tasks. ``` -------------------------------- ### macOS - Homebrew 更新 NipaPlay Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/release-channels.md 使用 Homebrew 更新 NipaPlay 到最新版本。此方法会自动处理依赖关系和旧版本清理,并且无需手动在隐私与安全性设置中允许应用。 ```bash # 1. 更新 Homebrew 软件源 brew update # 2. 升级 NipaPlay 到最新版本 brew upgrade nipaplay-reload ``` -------------------------------- ### Get Media Library Content Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves all content available in the media library. ```APIDOC ## GET /api/v1/library ### Description Retrieves all content available in the media library. ### Method GET ### Endpoint /api/v1/library ### Response #### Success Response (200) - **library** (array) - An array of objects, where each object represents a media item in the library. ``` -------------------------------- ### Get Current Video Information Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves information about the video that is currently playing. ```APIDOC ## GET /api/v1/current/video ### Description Retrieves information about the video that is currently playing. ### Method GET ### Endpoint /api/v1/current/video ### Response #### Success Response (200) - **title** (string) - The title of the video. - **duration** (integer) - The duration of the video in seconds. - **progress** (integer) - The current playback progress in seconds. ``` -------------------------------- ### Get Video Thumbnail by ID Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a video thumbnail using its unique ID. ```APIDOC ## GET /api/v1/image/id/{id} ### Description Retrieves a video thumbnail using its unique ID. ### Method GET ### Endpoint /api/v1/image/id/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique ID of the video for which to retrieve the thumbnail. ``` -------------------------------- ### 解决 Git 合并冲突 Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/06-FAQ.md 当你的分支与主分支发生冲突时,使用此命令同步并解决冲突。 ```bash git checkout main git pull upstream main git checkout [你的分支名] git merge main ``` ```bash git add [你刚刚解决冲突的文件] git commit -m "fix: Merge main and resolve conflicts" git push origin [你的分支名] ``` -------------------------------- ### Get All Library Content Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a list of all video files available in the media library. ```APIDOC ## GET /api/v1/library ### Description Retrieves a list of all video files available in the media library. ### Method GET ### Endpoint /api/v1/library ### Response #### Success Response (200) - A list of video objects, each containing detailed information about a video file. ### Response Example ```json [ { "AnimeId": 14198, "EpisodeId": 141980003, "AnimeTitle": "佐贺偶像是传奇", "EpisodeTitle": "第3话 DEAD OR LIVE SAGA", "Id": "c004e475-d9bb-41e1-976b-7fce00997f3a", "Hash": "03778309A0E8A09C2F43603A490F2E98", "Name": "[Zombieland Saga][03][BIG5][1080P].mp4", "Path": "Y:\\[Zombieland Saga][03][BIG5][1080P].mp4", "Size": 518754774, "Rate": 0, "IsStandalone": false, "Created": "2018-10-21T23:14:59", "LastMatch": "0001-01-01T00:00:00", "LastPlay": "2019-04-25T18:00:22", "LastThumbnail": "2019-03-05T22:03:20", "Duration": 1420 }, { "AnimeId": 11167, "EpisodeId": 111670021, "AnimeTitle": "命运石之门 0", "EpisodeTitle": "第21话 結像のリナシメント Return of Phoenix", "Id": "686b4d07-d8de-4f2e-b716-3cf0843cc903", "Hash": "334763177A0B9A5647B263AA74E0A013", "Name": "[Nekomoe kissaten][Steins;Gate 0][21][GB][720P].mp4", "Path": "Y:\\[Nekomoe kissaten][Steins;Gate 0][21][GB][720P].mp4", "Size": 128023969, "Rate": 0, "IsStandalone": false, "Created": "2018-09-23T23:30:38", "LastMatch": "0001-01-01T00:00:00", "LastPlay": null, "LastThumbnail": "2019-03-05T22:03:22", "Duration": 1420 }, { "AnimeId": 13031, "EpisodeId": 130310010, "AnimeTitle": "Princess Principal", "EpisodeTitle": "第10话 Comfort Comrade", "Id": "07c0d08a-6191-49aa-866c-5ea91cf91f23", "Hash": "432A9EC48627FFA2F092B418840A5D98", "Name": "[HYSUB]Princess Principal[10][GB_MP4][1280X720].mp4", "Path": "Y:\\Princess Principal\[HYSUB]Princess Principal[10][GB_MP4][1280X720].mp4", "Size": 158818535, "Rate": 0, "IsStandalone": false, "Created": "2017-10-08T17:09:31", "LastMatch": "0001-01-01T00:00:00", "LastPlay": null, "LastThumbnail": "2019-03-05T22:03:23", "Duration": 1470 } ] ``` ``` -------------------------------- ### Example Current Video Info Response Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html This JSON object represents the current video playback status, including episode details, duration, position, seekability, volume, and playing state. ```json { "EpisodeId": "136290001", "AnimeTitle": "不受欢迎者之家", "EpisodeTitle": "第1话 ロマンティックあげるよ", "Duration": 720052, "Position": 0.455077559, "Seekable": true, "Volume": 100, "Playing": true } ``` -------------------------------- ### Get Video Thumbnail Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a thumbnail image for a video, identified by its hash or ID. ```APIDOC ## GET /api/v1/image/{hash} or /api/v1/image/id/{id} ### Description Retrieves a thumbnail image for a video. ### Method GET ### Endpoint /api/v1/image/{hash} or /api/v1/image/id/{id} ### Parameters #### Path Parameters - **hash** (string) - Optional - The hash of the video. - **id** (string) - Optional - The ID of the video. ``` -------------------------------- ### Get Current Playlist Content Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves the list of video files currently in the playback playlist. ```APIDOC ## GET /api/v1/playlist ### Description Retrieves the list of video files currently in the playback playlist. ### Method GET ### Endpoint /api/v1/playlist ### Response #### Success Response (200) - An array of strings, where each string is the full path to a video file on the local disk. ### Response Example ```json [ "Y:\\不受欢迎者之家\[HYSUB]Himote House[01][GB_MP4][1280X720].mp4", "Y:\\不受欢迎者之家\[HYSUB]Himote House[02][GB_MP4][1280X720]V2.mp4", "Y:\\不受欢迎者之家\[HYSUB]Himote House[03][GB_MP4][1280X720].mp4", "Y:\\不受欢迎者之家\[HYSUB]Himote House[04][GB_MP4][1280X720].mp4", "Y:\\不受欢迎者之家\[HYSUB]Himote House[05][GB_MP4][1280X720].mp4", "Y:\\不受欢迎者之家\[HYSUB]Himote House[06][GB_MP4][1280X720].mp4", "Y:\\不受欢迎者之家\[HYSUB]Himote House[07][GB_MP4][1280X720].mp4" ] ``` ``` -------------------------------- ### Get Download Tasks List Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves a list of all current download tasks managed by 弹弹play. ```APIDOC ## Get Download Tasks List ### Description Retrieves a list of all current download tasks managed by 弹弹play. ### Method GET ### Endpoint /api/v1/download/tasks ### Response #### Success Response (200) - Returns a list of download task objects, each containing details about the task. ``` -------------------------------- ### Get Specific Download Task Info Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieve information about a specific download task by its ID. ```APIDOC ## Get Specific Download Task Info ### Description Retrieve information about a specific download task by its ID. ### Method GET ### Endpoint /api/v1/download/tasks/{taskId} ### Parameters #### Path Parameters - **taskId** (string) - Required - The ID of the download task. ### Response #### Success Response (200) - **task** (object) - Information about the specified download task. ``` -------------------------------- ### Dockerfile for NipaPlay Container Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/DEPLOYMENT_GUIDE.md This Dockerfile sets up an Ubuntu environment, installs system dependencies and Flutter, builds the NipaPlay application for Linux and Web, and configures runtime environment variables for headless operation. ```dockerfile # Dockerfile FROM ubuntu:22.04 # 安装系统依赖 RUN apt-get update && apt-get install -y \ curl \ git \ unzip \ xz-utils \ zip \ libglu1-mesa \ libc6-dev \ libstdc++6 \ libgcc1 \ libatomic1 \ fonts-noto-cjk \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # 安装Flutter RUN git clone https://github.com/flutter/flutter.git -b stable --depth 1 /flutter ENV PATH="/flutter/bin:${PATH}" # 设置工作目录 WORKDIR /app # 复制项目文件 COPY . . # 构建应用 RUN flutter doctor RUN flutter pub get RUN flutter build linux --release # 构建Web版本 RUN flutter build web --release --web-renderer canvaskit RUN mkdir -p build/linux/x64/release/bundle/data/flutter_assets/web RUN cp -r build/web/* build/linux/x64/release/bundle/data/flutter_assets/web/ # 设置运行时环境 ENV NIPAPLAY_HEADLESS=true ENV NIPAPLAY_WEB_PORT=1180 ENV NIPAPLAY_DATA_DIR=/data ENV NIPAPLAY_MEDIA_DIR=/media # 创建数据目录 RUN mkdir -p /data /media # 暴露端口 EXPOSE 1180 # 设置启动命令 CMD ["./build/linux/x64/release/bundle/nipaplay", "--headless"] ``` -------------------------------- ### Get Subtitle File Content Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/弹弹play远程访问API(PC版) _ 弹弹play.html Retrieves the content of a specific subtitle file for a given video ID. ```APIDOC ## Get Subtitle File Content ### Description Retrieves the content of a specific subtitle file for a given video ID. ### Method GET ### Endpoint /api/v1/subtitle/file/{id}?fileName={fileName} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the video file. #### Query Parameters - **fileName** (string) - Required - The name of the subtitle file to retrieve. ### Response #### Success Response (200) - The response body contains the content of the requested subtitle file. ``` -------------------------------- ### Define Plugin UI Entries with Text Settings Source: https://github.com/aimessoft/nipaplay-reload/blob/main/Documentation/js-plugin-api.md Example of plugin UI entries configured with text settings, allowing users to input custom values like API URLs or retry counts. The 'default' field provides an initial value. ```javascript const pluginUIEntries = [ { id: 'api_url', title: 'API 地址', description: '输入远程接口地址', textSetting: { hintText: 'https://example.com/api', default: '' } }, { id: 'max_retries', title: '最大重试次数', description: '请求失败时的重试次数(0-10)', textSetting: { hintText: '3', default: '3' } } ]; ``` -------------------------------- ### NipaPlay Docker Build and Deploy Script Source: https://github.com/aimessoft/nipaplay-reload/blob/main/docs/DEPLOYMENT_GUIDE.md A bash script to automate the Docker image build, data directory creation, and NipaPlay service startup using Docker Compose. It also displays the service status and access URL. ```bash #!/bin/bash # deploy.sh echo "🚀 开始构建NipaPlay Docker镜像..." # 构建镜像 docker build -t nipaplay:latest . # 检查构建结果 if [ $? -eq 0 ]; then echo "✅ 镜像构建成功" else echo "❌ 镜像构建失败" exit 1 fi # 创建数据目录 mkdir -p ./data ./cache # 启动服务 echo "🚀 启动NipaPlay服务..." docker-compose up -d # 显示状态 echo "📊 服务状态:" docker-compose ps echo "🌐 访问地址: http://$(hostname -I | awk '{print $1}'):1180" echo "📁 请将媒体文件放置在绑定的媒体目录中" ``` -------------------------------- ### 添加 url_launcher 依赖 Source: https://github.com/aimessoft/nipaplay-reload/blob/main/CONTRIBUTING_GUIDE/05-Example-Add-A-New-Page.md 如果 `url_launcher` 库缺失,使用 `flutter pub add` 命令进行安装。请先确认依赖是否已存在于 `pubspec.yaml`。 ```bash flutter pub add url_launcher ```