Skip to content

WatchBuddy-tv/ExampleProvider

Β 
Β 

Repository files navigation

WatchBuddy Provider Blueprint

Status Add example.watchbuddy.tv to WatchBuddy Python Version License

Official SDK and Boilerplate for WatchBuddy Content Providers Build decentralized scrapers, test them in isolation, and integrate seamlessly with the WatchBuddy ecosystem. πŸš€

πŸ‡ΉπŸ‡· TΓΌrkΓ§e β€’ πŸ‡«πŸ‡· FranΓ§ais β€’ πŸ‡·πŸ‡Ί Русский β€’ πŸ‡ΊπŸ‡¦ Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°


🚦 Overview

This blueprint provides a standardized environment for developing WatchBuddy Providers. A Provider is a standalone service that supplies content to WatchBuddy (Web/Mobile) through a decentralized network.

  • πŸ”Œ Plug & Play: Add your provider URL to WatchBuddy and start watching.
  • πŸ§ͺ Isolated Development: Local-first architecture allows you to test your plugins without affecting the core system.
  • 🎬 Unified Media Core: Powered by KekikStream for advanced link extraction.
  • πŸ›‘οΈ CORS Friendly: Works with standard CORS/proxy setups when needed.

πŸš€ Quick Start

Prerequisites: Python 3.11+. No external media players required for development.

# 1. Clone the repository
git clone https://github.com/keyiflerolsun/ExampleProvider.git
cd ExampleProvider

# 2. Install dependencies
pip install -r requirements.txt

# 3. Setup environment
cp .env.example .env

# 4. Start the engine
python run.py

πŸ‘‰ Access Provider: http://127.0.0.1:3310 πŸ‘‰ WatchBuddy Integration (Localhost): Add http://localhost:3310 to WatchBuddy

βœ… Add Your Provider to WatchBuddy

  1. Open WatchBuddy.
  2. Go to Providers.
  3. Paste your base URL (e.g. http://127.0.0.1:3310).
  4. Save and enable the provider.

Requirements:

  • Your provider must expose GET /api/v1/schema.
  • The response must include provider_name and description (plus optional proxy URLs).

πŸ“± Explore the Ecosystem

WatchBuddy is available on Android and iOS.

For more ways to discover titles and quickly send them into a room, you can also use one of these services:


πŸ“‚ Project Structure

.
β”œβ”€β”€ Stream/
β”‚   β”œβ”€β”€ Plugins/      # πŸ”Œ Your Website Scrapers (e.g., RareFilmm.py)
β”‚   └── Extractors/   # πŸ”— Your Link Resolvers (e.g., OneFichier.py)
β”œβ”€β”€ FastAPI/          # ⚑ Provider API Core
β”œβ”€β”€ run.py            # πŸš€ Main entry point
β”œβ”€β”€ validate.py       # πŸ§ͺ Plugin testing & validation tool
└── .env              # βš™οΈ Configuration

πŸ”Œ Component System

Component Responsibility Folder
Plugin Browsing the site, fetching metadata and embed URLs. Stream/Plugins/
Extractor Resolving final playable links from hosting providers. Stream/Extractors/

πŸ› οΈ Developer Guide

1. How to Create a Plugin

Creating a new plugin is as simple as adding a Python file to Stream/Plugins/. Here is a minimal boilerplate:

from KekikStream.Core import HTMLHelper, PluginBase, MainPageResult, SearchResult, MovieInfo, Episode, SeriesInfo, Subtitle, ExtractResult

class MyPlugin(PluginBase):
    name        = "MyPlugin"
    language    = "en"
    main_url    = "https://example.com"
    favicon     = f"https://www.google.com/s2/favicons?domain={main_url}&sz=64"
    description = "MyPlugin description"

    # Categories List on Main Page
    main_page   = {
      f"{main_url}/category/" : "Category Name"
    }

    async def get_main_page(self, page: int, url: str, category: str) -> list[MainPageResult]:
        # Scrape and return list of MainPageResult
        return results

    async def search(self, query: str) -> list[SearchResult]:
        # Return list of SearchResult
        return results

    async def load_item(self, url: str) -> MovieInfo | SeriesInfo:
        # Return MovieInfo or SeriesInfo
        return details

    async def load_links(self, url: str) -> list[ExtractResult]:
        # self.collect_results(results, data)  β€” collect extract results (handles list/single/None)
        # self.deduplicate(results)             β€” URL-based deduplication
        # await self.async_cf_get(url)          β€” Cloudflare bypass (async)
        # Engine auto-calls sync_subtitles(results) after load_links
        return links

2. Testing your Plugins

Use the built-in validator to ensure your plugins are compliant with the WatchBuddy models. It tests Discovery, Search, Metadata, and Stream extraction automatically.

# Test all local plugins
python validate.py

# Test specific plugins
python validate.py RareFilmm

3. Local-First Priority

This SDK uses a Local-First loader. When running from this directory:

  • Local Plugins (Stream/Plugins/) are loaded exclusively.
  • Local Extractors (Stream/Extractors/) can be used to override or extend core extractors.
  • This ensures your development environment is 100% reproducible and isolated.

πŸ“š Reference Implementations

Looking for inspiration? Explore the core KekikStream library for professional examples:

πŸ“‹ Standard Models

Your plugins MUST return these standard models to be compatible with WatchBuddy:

  • MainPageResult: For home screen galleries.
  • SearchResult: For search results.
  • MovieInfo / SeriesInfo: For metadata and episodes.
  • ExtractResult: For playable links (includes referer and user-agent).

✨ System Architecture

graph TB
    subgraph WatchBuddyApp[πŸ“± WatchBuddy Client]
        UI[User Interface]
        Player[Video Player]
    end

    subgraph Provider[🎬 Your Provider]
        FastAPI[⚑ FastAPI Entry]
        Loader[πŸ”Œ Loader Core]

        subgraph LocalCode[Local Development]
            P1[πŸ“Ί RareFilmm Plugin]
            E1[πŸ”— Custom Extractor]
        end
    end

    subgraph External[🌍 Web]
        Target[Media Website]
        CDN[Raw Stream CDN]
    end

    UI -->|Search/Load| FastAPI
    FastAPI --> Loader
    Loader --> P1
    P1 -->|Scrape| Target
    P1 -->|Request Link| E1
    E1 -->|Resolve| CDN
    CDN -->|Stream| Player

    style Provider fill:#2b2a29,stroke:#ef7f1a,stroke-width:2px
    style WatchBuddyApp fill:#242322,stroke:#0087a3,stroke-width:2px
Loading

🌐 Copyright & License

Copyright (C) 2026 by keyiflerolsun ❀️️ Licensed under GNU GENERAL PUBLIC LICENSE Version 3.


This project is developed by @keyiflerolsun for @KekikAkademi.

⭐ If you find this SDK useful, don't forget to give it a star!

About

A standardized boilerplate for developing and testing decentralized media providers for the WatchBuddy ecosystem. πŸš€

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • Python 98.2%
  • Dockerfile 1.8%