plex-media-server

n8n nodes for interacting with Plex Media Server API

Package Information

Downloads: 21 weekly / 65 monthly
Latest Version: 1.0.1
Author: Martien

Documentation

n8n-nodes-plex-media-server

This is an n8n community node that lets you interact with the Plex Media Server API in your n8n workflows.

Plex is a media server that organizes video, music, and photos from personal media libraries and streams them to smart TVs, streaming boxes, and mobile devices.

n8n is a fair-code licensed workflow automation platform.

Installation

Follow the installation guide in the n8n community nodes documentation.

npm install n8n-nodes-plex-media-server

Credentials

To use this node, you need to configure the following credentials:

  • Server URL: The URL of your Plex Media Server (e.g., http://localhost:32400)
  • X-Plex-Token: Your Plex authentication token

Finding Your Plex Token

  1. Sign in to your Plex account in a web browser
  2. Open any media item and click "Get Info"
  3. Click "View XML"
  4. Look for X-Plex-Token in the URL

Or find it in your Plex preferences file:

  • Windows: %LOCALAPPDATA%\Plex Media Server\Preferences.xml
  • macOS: ~/Library/Application Support/Plex Media Server/Preferences.xml
  • Linux: $PLEX_HOME/Library/Application Support/Plex Media Server/Preferences.xml

Resources & Operations

Server

  • Get Identity: Get server identity information
  • Get Info: Get server information
  • Get Preferences: Get server preferences
  • Get Active Sessions: Get all active playback sessions
  • Get Transcode Sessions: Get all active transcode sessions
  • Get Butler Tasks: Get scheduled butler tasks
  • Run Butler Task: Run a specific butler task
  • Stop Butler Task: Stop a specific butler task

Library

  • Get All: Get all library sections
  • Get: Get a specific library section
  • Get Contents: Get all items in a library section
  • Get Recently Added: Get recently added items in a library
  • Get On Deck: Get on deck items in a library
  • Refresh: Refresh/scan a library section
  • Empty Trash: Empty the trash for a library section
  • Analyze: Analyze all items in a library section

Media

  • Get: Get metadata for a specific media item
  • Get Children: Get children of a media item (e.g., episodes of a show)
  • Get Related: Get related media items
  • Get Similar: Get similar media items
  • Update: Update metadata for a media item
  • Delete: Delete a media item
  • Refresh: Refresh metadata for a media item
  • Analyze: Analyze a media item
  • Mark Watched: Mark a media item as watched (scrobble)
  • Mark Unwatched: Mark a media item as unwatched (unscrobble)

Playlist

  • Get All: Get all playlists
  • Get: Get a specific playlist
  • Get Items: Get items in a playlist
  • Create: Create a new playlist
  • Update: Update a playlist
  • Delete: Delete a playlist
  • Add Items: Add items to a playlist
  • Remove Items: Remove items from a playlist

Collection

  • Get All: Get all collections in a library
  • Get: Get a specific collection
  • Get Items: Get items in a collection
  • Add Items: Add items to a collection
  • Remove Items: Remove items from a collection
  • Delete: Delete a collection

Search

  • Search: Search across all libraries
  • Search in Library: Search within a specific library

Session

  • Get All: Get all active playback sessions
  • Get History: Get playback history
  • Terminate: Terminate a playback session

Compatibility

  • Requires n8n version 1.0.0 or later
  • Tested with Plex Media Server 1.40.x

Development

# Install dependencies
npm install

# Build the node
npm run build

# Watch for changes during development
npm run dev

# Lint the code
npm run lint

License

MIT

Discussion