Node.js SDK for the Plex Media Server API.
Tested on Plex Media Server v1.16.3.
$ npm install pavie
const Pavie = require("pavie")
const pavie = new Pavie({ username: "USERNAME", password: "PASSWORD" })
pavie
.signin()
.then(user => {
console.log(user)
})
.catch(err => {
console.error(err)
})
Authenticate user to Plex server. This is the first method to call, this instantiate your server and your token for the others methods !
Return user
<object>
if authentification is successfull.
Get the list of resources with connection settings. Conection : [name, protocol, address, port, uri, local, relay, IPv6].
Get user info. Return: [id, uuid, username, title, email, thumb, authToken, certificateVersion, rememberExpiresAt].
Get basic info about the Plex server. Return: [machineIdentifier, version]
Get the list actions availables. ie : platform, platformVersion, updatedAt, version, machineIdentifier, myPlexUsername. Return : [activities, butler, channels, clients, devices, diagnostics, hubs, library, livetv, media, player, playlists, resources, search, server, ...].
Get a list of servers. Return: [name, host, address, port, machineIdentifier, version].
Return all info about a media.
id
<number>
Identifiant
Return all children metadata for a specified media. ie: Return seasons metadata for a specified Tv Show.
id
<number>
Identifiantoptions
<object>
excludeAllLeaves
<number>
, default:1
Return a list of related media.
id
<number>
Identifiantoptions
<object>
excludeFields
<string>
, default:summary
includeExternalMetadata
<number>
, default:1
asyncAugmentMetadata
<number>
, default:1
Return a list of similar media.
id
<number>
Identifiant
Global search of media.
query
<string>
options
<object>
includeCollections
<number>
, default:1
sectionId
<number>
limit
<number>
, ie:30
Return tv shows.
options
<object>
unwatchedLeaves
<number>
, default:0
sort
<string>
, ie:rating:desc
Return tv shows seasons.
options
<object>
includeCollections
<number>
, default:1
sort
<string>
, ie:rating:desc
Return tv shows episodes.
options
<object>
includeCollections
<number>
, default:1
sort
<string>
, ie:rating:desc
Get synchronize info.
Synchronize Plex and Trakt.tv.
Get all playlists.
Get playlist basic info.
ratingKey
<string> | <number>
Identifiant
Get playlist video files.
ratingKey
<string> | <number>
Identifiant
Add new playlist.
data
<object>
uri
<string>
Path to a list of video files, ie :server://2c59cf8256eccd8629081638e98e27bf8349c3e7/com.plexapp.plugins.library/library/metadata/26082
title
<string>
Title of the playlistsmart
<number>
Default:0
type
<string>
Default:video
Update existing playlist.
ratingKey
<string> | <number>
Identifiantdata
<object>
title
<string>
Titlesummary
<string>
Description
Add files to an existing playlist.
ratingKey
<string> | <number>
Identifianturi
<string>
Path to a list of video files, ie:server://2c59cf8256eccd8629081638e98e27bf8349c3e7/com.plexapp.plugins.library/library/metadata/26082
Remove existing playlist.
ratingKey
<string> | <number>
Identifiant
Get the history of a TV Shows.
-
options
<object>
metadataItemID
<number>
Identifiantsort
<string>
Order by, default :viewed:desc
Return an image.
url
<string>
Path to the imageoptions
<object>
width
<number>
, default:170
height
<number>
, default:96
minSize
<number>
, default:1
upscale
<number>
, default:1
opacity
<number>
, ie:30
background
<hexadecimal>
, ie:36383b
format
<string>
, ie:png
blur
<number>
, ie:56