### Clone and Install Repository Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Initial steps to download the repository and install necessary build dependencies. ```bash git clone https://github.com/tapframe/nuvio-providers.git cd nuvio-providers ``` ```bash npm install ``` -------------------------------- ### Start Local Development Server Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Command to serve provider files and manifest for in-app testing. ```bash npm start ``` -------------------------------- ### Implement Multi-File Provider Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Example of using ES modules and async functions within the src directory. ```javascript // src/myprovider/index.js import { getStream } from './extractor.js'; async function getStreams(tmdbId, ...) { return await getStream(tmdbId); } ``` -------------------------------- ### Create New Provider from Template Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Command to duplicate the starter template for a new provider implementation. ```bash cp -r src/_template src/my-new-provider ``` -------------------------------- ### Build Source Providers via CLI Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Use these commands to bundle source files into the providers directory. ```bash # Build specific provider node build.js vixsrc # Build multiple node build.js vixsrc uhdmovies # Build all source providers node build.js ``` -------------------------------- ### Create Multi-File Provider Structure Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Commands and code structure for building complex providers with multiple files. ```bash mkdir -p src/myprovider ``` ```javascript import { fetchPage } from './http.js'; import { extractStreams } from './extractor.js'; // async/await is fully supported here async function getStreams(tmdbId, mediaType, season, episode) { const page = await fetchPage(tmdbId, mediaType, season, episode); return extractStreams(page); } module.exports = { getStreams }; ``` ```bash node build.js myprovider ``` -------------------------------- ### Build Multi-File Provider Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Bundles source files into a single distribution file. ```bash node build.js myprovider ``` -------------------------------- ### Execute Git and Build Commands Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Standard commands for managing provider development branches and building the project. ```bash git checkout -b add-myprovider ``` ```bash node build.js myprovider ``` ```bash git commit -m "Add MyProvider" ``` -------------------------------- ### Transpile Single-File Providers Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Transpile async/await code for compatibility using the build script. ```bash # Transpile specific file node build.js --transpile myprovider.js # Transpile all applicable files in providers/ node build.js --transpile ``` -------------------------------- ### Bundling Source Providers Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Commands to bundle files from the src/ directory into the providers/ folder. ```bash node build.js ``` ```bash node build.js vidlink ``` ```bash node build.js vidlink castle ``` -------------------------------- ### Enable Watch Mode Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Automatically trigger rebuilds upon file changes. ```bash npm run build:watch ``` -------------------------------- ### Execute Test Script Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Run the created test script using the Node.js runtime. ```bash node test-myprovider.js ``` -------------------------------- ### Create a Single-File Provider Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Define a provider using Promise chains to ensure compatibility with the Hermes engine. ```javascript // providers/myprovider.js function getStreams(tmdbId, mediaType, season, episode) { console.log(`[MyProvider] Fetching ${mediaType} ${tmdbId}`); return fetch(`https://api.example.com/streams/${tmdbId}`) .then(response => response.json()) .then(data => { return data.streams.map(s => ({ name: "MyProvider", title: s.title, url: s.url, quality: s.quality })); }) .catch(error => { console.error('[MyProvider] Error:', error.message); return []; }); } module.exports = { getStreams }; ``` -------------------------------- ### Implement getStreams Function Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Providers must export this asynchronous function to return a list of streams based on the provided media parameters. ```javascript /* * @param {string} tmdbId - The TMDB ID (e.g., "550") * @param {string} mediaType - "movie" or "tv" * @param {number} season - Season number (1-based), null for movies * @param {number} episode - Episode number (1-based), null for movies * @returns {Promise} - List of streams */ async function getStreams(tmdbId, mediaType, season, episode) { ... } ``` -------------------------------- ### Register a Provider in manifest.json Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Add the provider configuration to the manifest file to enable it within the application. ```json { "id": "myprovider", "name": "My Provider", "filename": "providers/myprovider.js", "supportedTypes": ["movie", "tv"], "enabled": true } ``` -------------------------------- ### Project Directory Structure Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Overview of the repository layout, separating source code from bundled provider files. ```text nuvio-providers/ ├── src/ # Source files (multi-file development) │ ├── vixsrc/ │ │ ├── index.js # Main entry point │ │ ├── extractor.js # Stream extraction │ │ ├── http.js # HTTP utilities │ │ └── ... │ └── uhdmovies/ │ └── ... │ ├── providers/ # Output directory (ready-to-use files) │ ├── vixsrc.js # Bundled from src/vixsrc/ │ ├── uhdmovies.js │ └── ... │ ├── manifest.json # Provider registry ├── build.js # Build script └── package.json ``` -------------------------------- ### Configure manifest.json Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Defines the provider metadata and capabilities. Ensure all required fields are present for the provider to be correctly registered. ```json { "id": "unique-id", "name": "Display Name", "description": "Short description", "version": "1.0.0", "author": "Your Name", "supportedTypes": ["movie", "tv"], "filename": "providers/file.js", "enabled": true, "logo": "https://url/to/logo.png", "contentLanguage": ["en", "hi"], "formats": ["mkv", "mp4"], "limited": false, "disabledPlatforms": ["ios"], "supportsExternalPlayer": true } ``` -------------------------------- ### Minifying Provider Builds Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Commands to build providers with minification enabled to reduce file size for production releases. ```bash node build.js --minify ``` ```bash node build.js --minify vidlink ``` ```bash node build.js --minify vidlink castle ``` -------------------------------- ### Commit and Push Changes Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Standard Git commands to stage, commit, and push provider updates to the repository. ```bash git add . git commit -m "Add new provider" git push ``` -------------------------------- ### Verify Provider Logic Locally Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Use a Node.js script to test scraping logic before deploying to the Nuvio application. ```javascript const { getStreams } = require('./providers/myprovider.js'); async function run() { console.log("Fetching streams..."); try { const streams = await getStreams('550', 'movie'); // Fight Club console.log(streams); } catch (e) { console.error(e); } } run(); ``` -------------------------------- ### Transpile Single-File Provider Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Converts legacy or single-file scripts into Hermes-compatible code. ```bash node build.js --transpile myprovider.js ``` -------------------------------- ### Execute Local Test Script Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Command to run the local verification script. ```bash node test.js ``` -------------------------------- ### Transpiling Async/Await Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md Commands to transpile standalone files in the providers/ directory from async/await to ES2016 Generators. Note that this operation is destructive and overwrites the original files. ```bash node build.js --transpile ``` ```bash node build.js --transpile old-scraper ``` ```bash node build.js --transpile file1 file2 ``` -------------------------------- ### Test Provider Streams Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Verify provider functionality by importing and executing the getStreams function. ```javascript // test-myprovider.js const { getStreams } = require('./providers/myprovider.js'); async function test() { console.log('Testing...'); const streams = await getStreams('872585', 'movie'); // Oppenheimer ID console.log('Streams found:', streams.length); } test(); ``` -------------------------------- ### Add Repository URL to Nuvio Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Use this URL in the Nuvio app settings to register the provider collection. ```text https://raw.githubusercontent.com/yoruix/nuvio-providers/refs/heads/main/manifest.json ``` -------------------------------- ### getStreams(tmdbId, mediaType, season, episode) Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md The getStreams function is the primary entry point for a Nuvio provider. It fetches a list of available streams based on the provided media identifiers. ```APIDOC ## async function getStreams(tmdbId, mediaType, season, episode) ### Description Fetches a list of media streams for a specific movie or TV show episode. ### Parameters - **tmdbId** (string) - Required - The TMDB ID (e.g., "550") - **mediaType** (string) - Required - "movie" or "tv" - **season** (number) - Optional - Season number (1-based), null for movies - **episode** (number) - Optional - Episode number (1-based), null for movies ### Returns - **Promise** - A list of Stream objects. ### Stream Object Structure - **name** (string) - Short identifier - **title** (string) - Display name - **url** (string) - Playable URL - **quality** (string) - Quality identifier (e.g., 4K, 1080p, 720p, CAM) - **headers** (object) - Optional - Key-value pairs for playback (e.g., User-Agent, Referer) ``` -------------------------------- ### Define Stream Object Schema Source: https://github.com/yoruix/nuvio-providers/blob/template/README.md Providers must return an array of objects matching this structure. ```javascript { name: "Provider Name", // Provider identifier title: "1080p Stream", // Stream description url: "https://...", // Direct stream URL (m3u8, mp4, mkv) quality: "1080p", // Quality label size: "2.5 GB", // Optional file size headers: { // Optional headers for playback "Referer": "https://source.com", "User-Agent": "Mozilla/5.0..." } } ``` -------------------------------- ### Define Stream Object Structure Source: https://github.com/yoruix/nuvio-providers/blob/template/DOCUMENTATION.md The expected schema for objects returned by the getStreams function. ```json { "name": "MyProvider", // Short identifier "title": "1080p Stream", // Display name "url": "https://server.com/...", // Playable URL "quality": "1080p", // 4K, 1080p, 720p, CAM "headers": { // (Optional) "User-Agent": "Key for playback", "Referer": "..." } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.