Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Wifsimster committed Aug 7, 2019
1 parent afae17f commit a88bada
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.vscode/
.git
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 | BATTISTELLA Damien <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
112 changes: 111 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,112 @@
# pavie
Node.js restfull API for Plex Server

Node.js restfull API for Plex Media Server.

Tested on Plex Media Server v1.16.3.

## Install

```
$ npm install pavie
```

## Usage

```js
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

### Instance methods

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

## getLibraries()

Get a list of libraries.
Return: [section, recentlyAdded, onDeck].

## getLibrary([library = 'sections'])

Get a list of sections in the library.
Return: [Movies, Music, TV Shows].

## getDirectoriesFromSection([library = 'sections'], [sectionId = 2])

Get list of directory in a specified section.
Default : TV Shows section.
Return : [all, unwatched, newest, recentlyAdded, recenntlyViewed, recentlyViewedShows, onDeck, folder, ...]

## getDirectory([library = 'sections'], [sectionId = 2], [directory = 'all'])

Get a list of TV Shows by directory.
Default : TV Shows and all.
Return : [studio, type, title, contentRating, summary, index, rating, year, thumb, art, duration, originallyAvailableAt, ...].

## search([library = 'sections'], [sectionId = 2], [filters = { type: 2}])

Search Tv Shows, episodes, movies or musics.
Default : [sectionId : Tv Shows, type: Tv Shows]
For Tv Shows, type: [2: Tv Shows, 3: Seasonn, 4 : Episode]

## refresh([library = 'sections'], [sectionId = 2])

Refresh a section.

## getMedatadata([id])

Get metdata of a media.

## getServers()

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

## getSynchronize()

Get synchronize info.

## synchronize([accounntId])

Synchronize Plex and Trakt.tv.

## getHubs([action = 'continueWatching'])

Hubs actions [continueWatching, onDeck]
48 changes: 48 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "pavie",
"version": "1.0.0",
"description": "Node.js restfull API for Plex Server",
"main": "server.js",
"author": "BATTISTELLA Damien <[email protected]>",
"license": "MIT",
"scripts": {
"start": "node server.js",
"patch": "npm version patch && npm publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Wifsimster/pavie.git"
},
"bugs": {
"url": "https://github.com/Wifsimster/pavie/issues"
},
"keywords": [
"javascript",
"rest",
"plex",
"movie",
"restfull",
"node.js",
"tv shows"
],
"homepage": "https://github.com/Wifsimster/pavie#readme",
"dependencies": {
"axios": "^0.19.0",
"uuid": "^3.3.2"
}
}
Loading

0 comments on commit a88bada

Please sign in to comment.