npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pavie

v1.0.7

Published

Node.js restful API for Plex Server

Downloads

35

Readme

pavie

Node.js SDK for the Plex Media Server API.

Tested on Plex Media Server v1.16.3.

License: MIT npm version Install size

Summary

Metadata

Tv Shows

Synchronize

Playlists

History

Images

Install

$ npm install pavie

Usage

const Pavie = require("pavie")

const pavie = new Pavie({ username: "USERNAME", password: "PASSWORD" })

pavie
  .signin()
  .then(user => {
    console.log(user)
  })
  .catch(err => {
    console.error(err)
  })

Documentation

signin()

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.

getResources()

Get the list of resources with connection settings. Conection : [name, protocol, address, port, uri, local, relay, IPv6].

getUser()

Get user info. Return: [id, uuid, username, title, email, thumb, authToken, certificateVersion, rememberExpiresAt].

getIdentity()

Get basic info about the Plex server. Return: [machineIdentifier, version]

getActions()

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, ...].

getServers()

Get a list of servers. Return: [name, host, address, port, machineIdentifier, version].

Metadata

getMetadata([id])

Return all info about a media.

  • id <number> Identifiant

getMetadataChildren([id], [options])

Return all children metadata for a specified media. ie: Return seasons metadata for a specified Tv Show.

  • id <number> Identifiant
  • options <object>
    • excludeAllLeaves <number>, default: 1

getRelated([id], [options])

Return a list of related media.

  • id <number> Identifiant
  • options <object>
    • excludeFields <string>, default: summary
    • includeExternalMetadata <number>, default: 1
    • asyncAugmentMetadata <number>, default: 1

getSimilar([id])

Return a list of similar media.

  • id <number> Identifiant

search([query], [options])

Global search of media.

  • query <string>
  • options <object>
    • includeCollections <number>, default: 1
    • sectionId <number>
    • limit <number>, ie: 30

Tv Shows

getTvShows([options])

Return tv shows.

  • options <object>
    • unwatchedLeaves <number>, default: 0
    • sort <string>, ie: rating:desc

getSeasons([options])

Return tv shows seasons.

  • options <object>
    • includeCollections <number>, default: 1
    • sort <string>, ie: rating:desc

getEpisodes([options])

Return tv shows episodes.

  • options <object>
    • includeCollections <number>, default: 1
    • sort <string>, ie: rating:desc

Synchronize

getSynchronize()

Get synchronize info.

synchronize([accounntId])

Synchronize Plex and Trakt.tv.

Playlists

getPlaylists()

Get all playlists.

getPlaylist([ratingKey])

Get playlist basic info.

  • ratingKey <string> | <number> Identifiant

getPlaylistFiles([ratingKey])

Get playlist video files.

  • ratingKey <string> | <number> Identifiant

addPlaylist([data])

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 playlist
    • smart <number> Default: 0
    • type <string> Default: video

updatePlaylist([ratingKey], [data])

Update existing playlist.

  • ratingKey <string> | <number> Identifiant
  • data <object>
    • title <string> Title
    • summary <string> Description

updatePlaylistFiles([ratingKey], [uri])

Add files to an existing playlist.

  • ratingKey <string> | <number> Identifiant
  • uri <string> Path to a list of video files, ie: server://2c59cf8256eccd8629081638e98e27bf8349c3e7/com.plexapp.plugins.library/library/metadata/26082

removePlaylist([ratingKey])

Remove existing playlist.

  • ratingKey <string> | <number> Identifiant

History

getHistory(options)

Get the history of a TV Shows.

  • options <object>

    • metadataItemID <number> Identifiant
    • sort <string> Order by, default : viewed:desc

Images

getImage([url], [options])

Return an image.

  • url <string> Path to the image
  • options <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