Coder Social home page Coder Social logo

psplex's Introduction

About

This project started out as a script to copy a playlist from my account as a Plex Server owner to another user's account (on the same server). Slowly it got broken up into separate functions and became a simple PowerShell module.

Getting Started:

  1. Save the folder PSPlex into a module path for PowerShell.
    • Example: C:\Program Files\PowerShell\Modules
  2. Open PowerShell.
  3. Run Get-PlexAuthenticationToken. You will be prompted to enter your Plex account name and password.
  4. Run Save-PlexConfiguration and provide your Plex server name, the Plex hostname, protocol and port.
    • Example: Save-PlexConfiguration -PlexServer myserver -PlexServerHostname namaste.yourdomain.com -protocol https -port 32400

After this step, in future when you open PowerShell you can just run Import-PlexConfiguration to work with your Plex server.

In the event that your token should become invalid and you receive 401 errors, try running steps 3 and 4 again. It is step 3 that retrieves an access token from Plex. Refreshing tokens is not catered for, yet.

Examples:

Get a list of users with access to your server:

Get-PlexUser

Get a user and their access token:

$User = Get-PlexUser -Username '[email protected] -IncludeToken $User.Token

Copy a playlist from your account to another account (e.g. a friend you have shared content with):

Copy-PlexPlaylist -PlaylistName 'Family' -Username '[email protected]' -verbose

Copy all playlists from your account to another account:

Get-PlexPlaylist | Foreach-Object { Copy-PlexPlaylist -PlaylistName $_.title -Username '[email protected]' }

Copy a single playlist to all users:

$Users = Get-PlexUser $Users | Foreach-Object { Copy-PlexPlaylist -PlaylistName 'Family' -Username $_.username }

Remove a playlist for your account:

Remove-PlexPlaylist -ID 12345

Remove a playlist for a different account:

$User = Get-PlexUser -Username '[email protected] -IncludeToken Remove-PlexPlaylist -ID 54321 -AlternativeToken $User.Token

Get collections and show only the title and ID:

Get-PlexCollection | select title,key

Limitations:

  • Currently only written to work against a single Plex Server.

To do:

  • Syntax block for all functions.
  • Write the following playlist functions: New-PlexPlaylist. Add name parameter support to all?
  • Write the following collection: Get-PlexCollection, Add-PlexItemToCollection.
  • Write Helper Script to create IMDB Top 250 (where present in the library).

psplex's People

Contributors

bifa2 avatar technotone avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.