Skip to content

CtznSniiips/vod2m3u

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

101 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vod2m3u

Generate M3U playlists from Dispatcharr VOD content (movies + episodes). This repository contains a Dispatcharr plugin module that scans VOD entries and writes one or more M3U playlists pointing at Dispatcharr proxy endpoints (or direct provider URLs). Perfect for use with the Emby webstreams plugin, but can be used with anything that can read m3u files.

Features

  • Single atomic M3U write (reduces filesystem wear)
  • Optionally separate Movies and TV into two playlists
  • Prefer provider direct URLs when enabled
  • Celery task support for asynchronous playlist generation
  • Automatic scheduled playlist generation with cron expressions

Installation

Via Dispatcharr UI (recommended):

  1. Download the latest release ZIP from the releases page
  2. Go to Dispatcharr → Plugins page
  3. Click "Import" and upload the ZIP file
  4. Restart dispatcharr
  5. Go to Dispatcharr → Plugins page
  6. Enable the plugin and configure settings
  7. Click "Generate M3U" to create your playlists

Manual Installation:

  1. Create plugin directory in Dispatcharr:
    sudo mkdir -p /data/plugins/vod2m3u
  2. Copy all plugin files into the folder:
    sudo cp plugin.py plugin_m3u.py __init__.py tasks.py /data/plugins/vod2m3u/
  3. Restart Dispatcharr (or reload plugins via UI):
    sudo systemctl restart dispatcharr
  4. Configure settings in the plugin UI and click "Generate M3U" to generate the playlist(s).

Celery Task Integration

The plugin registers a Celery task named vod2m3u.generate_m3u that Dispatcharr's Celery worker can automatically discover and execute.

How it works:

  • When you click "Generate M3U" in the plugin UI, it queues a Celery task for background execution
  • The task is registered via tasks.py and __init__.py, making it discoverable by Dispatcharr's Celery autodiscovery
  • The plugin falls back to synchronous execution if the task cannot be queued

Task Registration: The plugin includes:

  • __init__.py - Makes vod2m3u a proper Python package
  • tasks.py - Imports and exports the Celery task for autodiscovery
  • plugin_m3u.py - Defines the actual task logic with @shared_task(name="vod2m3u.generate_m3u")

Dispatcharr's Celery instance should automatically discover tasks when the plugin is loaded. No manual Celery worker configuration is needed.

Usage

Manual Generation

You can generate M3U playlists at any time by clicking the "Generate M3U" button in the plugin settings. This will immediately create the playlist(s) based on your current configuration.

The manual generation works independently of the scheduler - you can use manual generation alone, or combine it with automatic scheduled generation.

Scheduler

The plugin supports automatic scheduled playlist generation using cron expressions. This feature is optional.

Note: The scheduler and manual generation work independently. You can:

  • Use manual generation only (click "Generate M3U" when needed)
  • Use scheduled generation only (set up a cron schedule)
  • Use both (schedule automatic updates AND manually trigger when needed)

Quick Setup

  1. Enable the Scheduler - Check the "Enable Scheduler" option in plugin settings
  2. Set Schedule - Enter a cron expression (default: 0 3 * * * = daily at 3am UTC)
  3. Save Settings - Click "Save Settings" to save your configuration
  4. Sync Schedule - Click "Sync Schedule" to create/update the scheduled task
  5. Verify - Click "View Active Schedule" to confirm the schedule is active

Cron Expression Format

Cron format: minute hour day month day_of_week

Common Examples:

  • 0 3 * * * - 3:00 AM every day (default example)
  • 0 */6 * * * - Every 6 hours starting from midnight (12am, 6am, 12pm, 6pm)
  • */30 * * * * - Every 30 minutes
  • 0 0 * * 0 - Midnight every Sunday
  • 0 2,14 * * * - 2:00 AM and 2:00 PM daily

Field Reference:

Field Values Special
minute 0-59 */5 = every 5 minutes
hour 0-23 */6 = every 6 hours
day 1-31 * = every day
month 1-12 * = every month
day_of_week 0-6 (Sun-Sat) * = every day

Special Characters:

  • * - Every value (any)
  • */X - Every X units
  • X-Y - Range from X to Y
  • X,Y,Z - Specific values

Actions

🔄 Sync Schedule - Creates or updates the scheduled task with your current settings. Use this after changing schedule settings.

📅 View Active Schedule - Shows the current scheduled task details including cron expression.

🗑️ Remove Schedule - Deletes the scheduled task. The scheduler must be re-synced to resume automatic generation.

  1. Follow the plugin installation steps above
  2. Install the Emby webstreams plugin from the Emby plugins catalog (under the "Channels" section) and restart Emby
  3. Modify your docker-compose.yml and map the /data/vod2m3u path to a location which is accessible for Emby. For example:
        services:
          dispatcharr:
            image: ghcr.io/dispatcharr/dispatcharr:latest
            container_name: dispatcharr
            ports:
              - 9191:9191
            volumes:
              - dispatcharr_data:/data
              - path_accessible_by_emby:/data/vod2m3u
            environment:
              - DISPATCHARR_ENV=aio
              - REDIS_HOST=localhost
              - CELERY_BROKER_URL=redis://localhost:6379/0
              - DISPATCHARR_LOG_LEVEL=info
  1. Open the dispatcharr web-ui, navigate to the plugins page, enable the plugin and configure to your liking, then click "Run" next to "Generate M3U".
  2. The plugin will take some time to generate the M3U file(s). When the files are available, open your Emby server dashboard and click "Web Streams" under the "Advanced" section
  3. Click "Add M3U source"
  4. Enter a name. Playlist location: Local file. Enter the file path for your generated m3u
  5. Finish configuration with the Emby webstreams plugin however you like.
  6. When you've finished, you can add a second, third, etc. m3u source with the Emby webstreams plugin (if you want to add tv.m3u and movies.m3u separately). Or, you can use the Emby webstreams plugin to add the same m3u source twice and use it's built-in filtering tool to separate the included streams.

License

  • MIT (see LICENSE file)

About

Generate a M3U playlist from Dispatcharr VOD content (movies + episodes). This repository contains a small Dispatcharr plugin module that scans VOD entries and writes one or more M3U playlists pointing at Dispatcharr proxy endpoints (or direct provider URLs).

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages