Files
plexjs/codeSamples.yaml

8061 lines
249 KiB
YAML

overlay: 1.0.0
info:
title: CodeSamples overlay for typescript target
version: 0.0.0
actions:
- target: $["paths"]["/"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.general.getServerInfo({});
console.log(result);
}
run();
- target: $["paths"]["/:/eventsource/notifications"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.events.getNotifications({});
console.log(result);
}
run();
- target: $["paths"]["/:/prefs"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.preferences.getAllPreferences();
console.log(result);
}
run();
- target: $["paths"]["/:/prefs"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.preferences.setPreferences({
prefs: {},
});
}
run();
- target: $["paths"]["/:/prefs/get"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.preferences.getPreference({});
console.log(result);
}
run();
- target: $["paths"]["/:/rate"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.rate.setRating({
identifier: "<value>",
key: "<key>",
rating: 8722.46,
});
}
run();
- target: $["paths"]["/:/scrobble"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.timeline.markPlayed({
identifier: "<value>",
});
}
run();
- target: $["paths"]["/:/timeline"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { ReportState } from "@lukehagar/plexjs/models/operations";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.timeline.report({
key: "/foo",
ratingKey: "xyz",
state: ReportState.Playing,
playQueueItemID: "123",
time: 0,
duration: 10000,
continuing: BoolInt.True,
updated: 14200000,
offline: BoolInt.True,
timeToFirstFrame: 1000,
timeStalled: 1000,
bandwidth: 100,
bufferedTime: 100,
bufferedSize: 1024,
});
console.log(result);
}
run();
- target: $["paths"]["/:/unscrobble"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.timeline.unscrobble({
identifier: "<value>",
});
}
run();
- target: $["paths"]["/:/websocket/notifications"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.events.connectWebSocket({});
console.log(result);
}
run();
- target: $["paths"]["/activities"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.activities.listActivities();
console.log(result);
}
run();
- target: $["paths"]["/activities/{activityId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.activities.cancelActivity({
activityId: "d6199ba1-fb5e-4cae-bf17-1a5369c1cf1e",
});
}
run();
- target: $["paths"]["/butler"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.butler.stopTasks();
}
run();
- target: $["paths"]["/butler"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.butler.getTasks();
console.log(result);
}
run();
- target: $["paths"]["/butler"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.butler.startTasks();
}
run();
- target: $["paths"]["/butler/{butlerTask}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { StopTaskButlerTask } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.butler.stopTask({
butlerTask: StopTaskButlerTask.CleanOldBundles,
});
}
run();
- target: $["paths"]["/butler/{butlerTask}"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { StartTaskButlerTask } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.butler.startTask({
butlerTask: StartTaskButlerTask.RefreshLocalMedia,
});
}
run();
- target: $["paths"]["/downloadQueue"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.createDownloadQueue();
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getDownloadQueue({
queueId: 922802,
});
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/add"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, AdvancedSubtitles, BoolInt, LocationParameter, ProtocolParameter } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.addDownloadQueueItems({
queueId: 984925,
keys: [
"/library/metadata/3",
"/library/metadata/6",
],
advancedSubtitles: AdvancedSubtitles.Burn,
audioBoost: 50,
audioChannelCount: 5,
autoAdjustQuality: BoolInt.True,
autoAdjustSubtitle: BoolInt.True,
directPlay: BoolInt.True,
directStream: BoolInt.True,
directStreamAudio: BoolInt.True,
disableResolutionRotation: BoolInt.True,
hasMDE: BoolInt.True,
location: LocationParameter.Wan,
mediaBufferSize: 102400,
mediaIndex: 0,
musicBitrate: 5000,
offset: 90.5,
partIndex: 0,
path: "/library/metadata/151671",
peakBitrate: 12000,
photoResolution: "1080x1080",
protocol: ProtocolParameter.Dash,
secondsPerSegment: 5,
subtitleSize: 50,
videoBitrate: 12000,
videoQuality: 50,
videoResolution: "1080x1080",
});
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/item/{itemId}/decision"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getItemDecision({
queueId: 231605,
itemId: 32,
});
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/item/{itemId}/media"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getDownloadQueueMedia({
queueId: 663184,
itemId: 32,
});
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/items"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.listDownloadQueueItems({
queueId: 524138,
});
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/items/{itemId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.downloadQueue.removeDownloadQueueItems({
queueId: 946275,
itemId: [
32,
345,
23,
],
});
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/items/{itemId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.downloadQueue.getDownloadQueueItems({
queueId: 809886,
itemId: [
32,
345,
23,
],
});
console.log(result);
}
run();
- target: $["paths"]["/downloadQueue/{queueId}/items/{itemId}/restart"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.downloadQueue.restartProcessingDownloadQueueItems({
queueId: 713001,
itemId: [
32,
345,
23,
],
});
}
run();
- target: $["paths"]["/hubs"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getAllHubs({
onlyTransient: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/continueWatching"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getContinueWatching({});
console.log(result);
}
run();
- target: $["paths"]["/hubs/items"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getHubItems({
identifier: [
"<value 1>",
"<value 2>",
"<value 3>",
],
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/metadata/{metadataId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getMetadataHubs({
metadataId: 605482,
onlyTransient: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/metadata/{metadataId}/postplay"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getPostplayHubs({
metadataId: 441419,
onlyTransient: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/metadata/{metadataId}/related"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getRelatedHubs({
metadataId: 8858,
onlyTransient: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/promoted"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getPromotedHubs({});
console.log(result);
}
run();
- target: $["paths"]["/hubs/search"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.search.searchHubs({
query: "<value>",
sectionId: 1,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/search/voice"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.search.voiceSearchHubs({
query: "<value>",
type: MediaType.TvShow,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.getSectionHubs({
sectionId: 336924,
onlyTransient: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}/manage"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.hubs.resetSectionDefaults({
sectionId: 383022,
});
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}/manage"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.listHubs({
sectionId: 442546,
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}/manage"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.hubs.createCustomHub({
sectionId: 869922,
metadataItemId: 703843,
promotedToRecommended: BoolInt.True,
promotedToOwnHome: BoolInt.True,
promotedToSharedHome: BoolInt.True,
});
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}/manage/move"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.hubs.moveHub({
sectionId: 755710,
identifier: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}/manage/{identifier}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.hubs.deleteCustomHub({
sectionId: 625677,
identifier: "<value>",
});
}
run();
- target: $["paths"]["/hubs/sections/{sectionId}/manage/{identifier}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.hubs.updateHubVisibility({
sectionId: 341650,
identifier: "<value>",
promotedToRecommended: BoolInt.True,
promotedToOwnHome: BoolInt.True,
promotedToSharedHome: BoolInt.True,
});
}
run();
- target: $["paths"]["/identity"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.general.getIdentity();
console.log(result);
}
run();
- target: $["paths"]["/library/all"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getLibraryItems({
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
});
console.log(result);
}
run();
- target: $["paths"]["/library/caches"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteCaches();
}
run();
- target: $["paths"]["/library/clean/bundles"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.cleanBundles();
}
run();
- target: $["paths"]["/library/collections"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.collections.createCollection({
sectionId: "<id>",
type: MediaType.TvShow,
});
console.log(result);
}
run();
- target: $["paths"]["/library/collections/{collectionId}/composite/{updatedAt}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getCollectionImage({
collectionId: 474227,
updatedAt: 759379,
});
console.log(result);
}
run();
- target: $["paths"]["/library/collections/{collectionId}/items"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getCollectionItems({
collectionId: 314585,
});
console.log(result);
}
run();
- target: $["paths"]["/library/collections/{collectionId}/items"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryCollections.addCollectionItems({
collectionId: 338144,
uri: "https://expensive-bakeware.com",
});
console.log(result);
}
run();
- target: $["paths"]["/library/collections/{collectionId}/items/{itemId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryCollections.deleteCollectionItem({
collectionId: 320928,
itemId: 406983,
});
console.log(result);
}
run();
- target: $["paths"]["/library/collections/{collectionId}/items/{itemId}/move"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryCollections.moveCollectionItem({
collectionId: 239532,
itemId: 513864,
});
console.log(result);
}
run();
- target: $["paths"]["/library/file"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.ingestTransientItem({
url: "file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv",
virtualFilePath: "/Avatar.mkv",
computeHashes: BoolInt.True,
ingestNonMatches: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/matches"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getLibraryMatches({
type: MediaType.TvShow,
includeFullMetadata: BoolInt.True,
includeAncestorMetadata: BoolInt.True,
includeAlternateMetadataSources: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/media/{mediaId}/chapterImages/{chapter}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getChapterImage({
mediaId: 892563,
chapter: 48348,
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/augmentations/{augmentationId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.getAugmentationStatus({
augmentationId: "<id>",
wait: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteMetadataItem({
ids: "<value>",
proxy: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getMetadataItem({
ids: [],
asyncCheckFiles: BoolInt.True,
asyncRefreshLocalMediaAgent: BoolInt.True,
asyncRefreshAnalysis: BoolInt.True,
checkFiles: BoolInt.True,
skipRefresh: BoolInt.True,
checkFileAvailability: BoolInt.True,
asyncAugmentMetadata: BoolInt.True,
augmentCount: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.editMetadataItem({
ids: [
"<value 1>",
"<value 2>",
],
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/addetect"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.detectAds({
ids: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/allLeaves"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getAllItemLeaves({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/analyze"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.analyzeMetadata({
ids: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/chapterThumbs"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.generateThumbs({
ids: "<value>",
force: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/credits"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.detectCredits({
ids: "<value>",
force: BoolInt.True,
manual: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/extras"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getExtras({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/extras"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.addExtras({
ids: "<value>",
url: "https://super-mortise.biz/",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/file"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getFile({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/index"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.startBifGeneration({
ids: "<value>",
force: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/intro"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.detectIntros({
ids: "<value>",
force: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/marker"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.createMarker({
ids: "<value>",
type: 248391,
startTimeOffset: 535191,
attributes: {},
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/marker/{marker}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteMarker({
ids: "<value>",
marker: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/marker/{marker}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.editMarker({
ids: "<value>",
marker: "<value>",
type: 884347,
startTimeOffset: 517251,
attributes: {},
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/match"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.matchItem({
ids: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/matches"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.listMatches({
ids: "<value>",
manual: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/media/{mediaItem}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteMediaItem({
ids: "<value>",
mediaItem: "<value>",
proxy: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/merge"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.mergeItems({
idsPathParameter: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/nearest"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.listSonicallySimilar({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/prefs"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.setItemPreferences({
ids: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/refresh"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.refreshItemsMetadata({
ids: "<value>",
markUpdated: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/related"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getRelatedItems({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/similar"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.listSimilar({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/split"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.splitItem({
ids: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/subtitles"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.addSubtitles({
ids: "<value>",
forced: BoolInt.True,
hearingImpaired: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/tree"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getItemTree({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/unmatch"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.unmatch({
ids: "<value>",
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/users/top"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.listTopUsers({
ids: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ids}/voiceActivity"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.detectVoiceActivity({
ids: "<value>",
force: BoolInt.True,
manual: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/{element}"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { SetItemArtworkElement } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.setItemArtwork({
ids: "<value>",
element: SetItemArtworkElement.Banner,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/{element}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { UpdateItemArtworkElement } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.updateItemArtwork({
ids: "<value>",
element: UpdateItemArtworkElement.ClearLogo,
});
}
run();
- target: $["paths"]["/library/metadata/{ids}/{element}/{timestamp}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetItemArtworkElement } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getItemArtwork({
ids: "<value>",
element: GetItemArtworkElement.Poster,
timestamp: 999555,
});
console.log(result);
}
run();
- target: $["paths"]["/library/optimize"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.optimizeDatabase({
async: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/parts/{partId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.setStreamSelection({
partId: 360489,
allParts: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/parts/{partId}/indexes/{index}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetPartIndexIndex } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getPartIndex({
partId: 724750,
index: GetPartIndexIndex.Sd,
});
console.log(result);
}
run();
- target: $["paths"]["/library/parts/{partId}/indexes/{index}/{offset}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetImageFromBifIndex } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getImageFromBif({
partId: 304273,
index: GetImageFromBifIndex.Sd,
offset: 939569,
});
console.log(result);
}
run();
- target: $["paths"]["/library/parts/{partId}/{changestamp}/{filename}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getMediaPart({
partId: 877105,
changestamp: 970622,
filename: "example.file",
download: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/people/{personId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getPerson({
personId: "<id>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/people/{personId}/media"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.listPersonMedia({
personId: "<id>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/randomArtwork"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getRandomArtwork({
sections: [
5,
6,
],
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/all"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getSections();
console.log(result);
}
run();
- target: $["paths"]["/library/sections/all"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.addSection({
name: "<value>",
type: 39544,
agent: "<value>",
language: "<value>",
locations: [
"O:\fatboy\\Media\\Ripped\\Music",
"O:\fatboy\\Media\\My Music",
],
prefs: {},
relative: BoolInt.True,
importFromiTunes: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/all/refresh"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.stopAllRefreshes();
console.log(result);
}
run();
- target: $["paths"]["/library/sections/prefs"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getSectionsPrefs({
type: 460221,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/refresh"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.refreshSectionsMetadata({});
}
run();
- target: $["paths"]["/library/sections/{sectionId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteLibrarySection({
sectionId: "<id>",
async: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getLibraryDetails({
sectionId: "<id>",
includeDetails: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.editSection({
sectionId: "<id>",
agent: "<value>",
locations: [
"O:\fatboy\\Media\\Ripped\\Music",
"O:\fatboy\\Media\\My Music",
],
prefs: {},
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/albums"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getAlbums({
sectionId: 817133,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/all"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.listContent({
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
includeMeta: BoolInt.True,
includeGuids: BoolInt.True,
sectionId: "<id>",
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/all"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.updateItems({
sectionId: "<id>",
fieldLocked: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/allLeaves"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getAllLeaves({
sectionId: 633197,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/analyze"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.startAnalysis({
sectionId: 158829,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/arts"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getArts({
sectionId: 859200,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/autocomplete"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.autocomplete({
sectionId: 942007,
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/categories"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getCategories({
sectionId: 21841,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/cluster"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getCluster({
sectionId: 138560,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/collection/{collectionId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteCollection({
sectionId: 283619,
collectionId: 680895,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/collections"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getCollections({
sectionId: 348838,
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/common"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getCommon({
sectionId: 298154,
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/composite/{updatedAt}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.getSectionImage({
sectionId: 925611,
updatedAt: 117413,
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/computePath"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getSonicPath({
sectionId: 914549,
startID: 629990,
endID: 687740,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/emptyTrash"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.emptyTrash({
sectionId: 30052,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/filters"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getSectionFilters({
sectionId: 380557,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/firstCharacters"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getFirstCharacters({
sectionId: 3947,
mediaQuery: {
type: MediaType.Episode,
sourceType: 2,
sort: "duration:desc,index",
},
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/indexes"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteIndexes({
sectionId: 588437,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/intros"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteIntros({
sectionId: 498656,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/location"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getFolders({
sectionId: 892532,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/moment"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.listMoments({
sectionId: 403239,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/nearest"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.content.getSonicallySimilar({
sectionId: 525956,
values: [],
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/prefs"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getSectionPreferences({
sectionId: 754869,
});
console.log(result);
}
run();
- target: $["paths"]["/library/sections/{sectionId}/prefs"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.setSectionPreferences({
sectionId: 349936,
prefs: {},
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/refresh"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.cancelRefresh({
sectionId: 326852,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/refresh"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.refreshSection({
sectionId: 450300,
force: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/sections/{sectionId}/sorts"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getAvailableSorts({
sectionId: 212498,
});
console.log(result);
}
run();
- target: $["paths"]["/library/streams/{streamId}.{ext}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.deleteStream({
streamId: 841510,
ext: "<value>",
});
}
run();
- target: $["paths"]["/library/streams/{streamId}.{ext}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.getStream({
streamId: 314506,
ext: "<value>",
autoAdjustSubtitle: BoolInt.True,
});
}
run();
- target: $["paths"]["/library/streams/{streamId}.{ext}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.library.setStreamOffset({
streamId: 606295,
ext: "<value>",
});
}
run();
- target: $["paths"]["/library/streams/{streamId}/levels"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getStreamLevels({
streamId: 447611,
});
console.log(result);
}
run();
- target: $["paths"]["/library/streams/{streamId}/loudness"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getStreamLoudness({
streamId: 277271,
});
console.log(result);
}
run();
- target: $["paths"]["/library/tags"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, MediaType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getTags({
type: MediaType.TvShow,
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.listDVRs();
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.createDVR({
lineup: "lineup://tv.plex.providers.epg.onconnect/USA-HI51418-DEFAULT",
deviceQueryParameter: [
"d",
"e",
"v",
"i",
"c",
"e",
"[",
"]",
"=",
"d",
"e",
"v",
"i",
"c",
"e",
":",
"/",
"/",
"t",
"v",
".",
"p",
"l",
"e",
"x",
".",
"g",
"r",
"a",
"b",
"b",
"e",
"r",
"s",
".",
"h",
"d",
"h",
"o",
"m",
"e",
"r",
"u",
"n",
"/",
"1",
"0",
"5",
"3",
"C",
"0",
"C",
"A",
],
language: "eng",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.dvRs.deleteDVR({
dvrId: 855088,
});
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.getDVR({
dvrId: 973518,
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/channels/{channel}/tune"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.tuneChannel({
dvrId: 834281,
channel: "2.1",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/devices/{deviceId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.removeDeviceFromDVR({
dvrId: 945416,
deviceId: 260761,
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/devices/{deviceId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.addDeviceToDVR({
dvrId: 334755,
deviceId: 852930,
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/lineups"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.deleteLineup({
dvrId: 454470,
lineup: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/lineups"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.addLineup({
dvrId: 945235,
lineup: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/prefs"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.setDVRPreferences({
dvrId: 116357,
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/reloadGuide"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.dvRs.stopDVRReload({
dvrId: 348053,
});
}
run();
- target: $["paths"]["/livetv/dvrs/{dvrId}/reloadGuide"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.dvRs.reloadGuide({
dvrId: 140753,
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/channelmap"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.computeChannelMap({
deviceQueryParameter: "<value>",
lineup: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/channels"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getChannels({
lineup: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/countries"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getCountries();
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/countries/{country}/{epgId}/lineups"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getCountriesLineups({
country: "Malawi",
epgId: "<id>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/countries/{country}/{epgId}/regions"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getCountryRegions({
country: "Morocco",
epgId: "<id>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/countries/{country}/{epgId}/regions/{region}/lineups"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.listLineups({
country: "Vanuatu",
epgId: "<id>",
region: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/languages"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getAllLanguages();
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/lineup"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getLineup({
deviceQueryParameter: "<value>",
lineupGroup: "<value>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/epg/lineupchannels"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.epg.getLineupChannels({
lineup: [
"<value 1>",
"<value 2>",
],
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/sessions"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.liveTV.getSessions();
console.log(result);
}
run();
- target: $["paths"]["/livetv/sessions/{sessionId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.liveTV.getLiveTVSession({
sessionId: "<id>",
});
console.log(result);
}
run();
- target: $["paths"]["/livetv/sessions/{sessionId}/{consumerId}/index.m3u8"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.liveTV.getSessionPlaylistIndex({
sessionId: "<id>",
consumerId: "<id>",
});
}
run();
- target: $["paths"]["/livetv/sessions/{sessionId}/{consumerId}/{segmentId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.liveTV.getSessionSegment({
sessionId: "<id>",
consumerId: "<id>",
segmentId: "<id>",
});
}
run();
- target: $["paths"]["/log"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { openAsBlob } from "node:fs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.log.writeLog(await openAsBlob("example.file"));
}
run();
- target: $["paths"]["/log"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.log.writeMessage({});
}
run();
- target: $["paths"]["/log/networked"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.log.enablePapertrail({});
}
run();
- target: $["paths"]["/media/grabbers"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.getAvailableGrabbers({
protocol: "livetv",
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.listDevices();
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.addDevice({
uri: "http://10.0.0.5",
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/discover"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.discoverDevices();
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.removeDevice({
deviceId: 685908,
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.getDeviceDetails({
deviceId: 170949,
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.modifyDevice({
deviceId: 879135,
enabled: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}/channelmap"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.setChannelmap({
deviceId: 937661,
channelMapping: {},
channelMappingByKey: {},
channelsEnabled: [
"4",
"6",
".",
"1",
",",
"4",
"4",
".",
"1",
",",
"4",
"5",
".",
"1",
],
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}/channels"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.getDevicesChannels({
deviceId: 517209,
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}/prefs"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.devices.setDevicePreferences({
deviceId: 420973,
});
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}/scan"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.stopScan({
deviceId: 576494,
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}/scan"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.devices.scan({
deviceId: 57391,
source: "Cable",
});
console.log(result);
}
run();
- target: $["paths"]["/media/grabbers/devices/{deviceId}/thumb/{version}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.devices.getThumb({
deviceId: 960617,
versionPathParameter: 1025,
});
}
run();
- target: $["paths"]["/media/grabbers/operations/{operationId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.subscriptions.cancelGrab({
operationId: "<id>",
});
}
run();
- target: $["paths"]["/media/providers"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.provider.listProviders();
console.log(result);
}
run();
- target: $["paths"]["/media/providers"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.provider.addProvider({
url: "https://steep-obedience.name/",
});
}
run();
- target: $["paths"]["/media/providers/refresh"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.provider.refreshProviders();
}
run();
- target: $["paths"]["/media/providers/{provider}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.provider.deleteMediaProvider({
provider: "<value>",
});
}
run();
- target: $["paths"]["/media/subscriptions"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.getAllSubscriptions({
includeGrabs: BoolInt.True,
includeStorage: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.createSubscription({
targetLibrarySectionID: 1,
targetSectionLocationID: 3,
type: 2,
hints: {},
prefs: {},
params: {},
});
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions/process"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.processSubscriptions();
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions/scheduled"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.getScheduledRecordings();
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions/template"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.getTemplate({
guid: "plex://episode/5fc70265c40548002d539d23",
});
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions/{subscriptionId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.subscriptions.deleteSubscription({
subscriptionId: 974618,
});
}
run();
- target: $["paths"]["/media/subscriptions/{subscriptionId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.getSubscription({
subscriptionId: 186713,
includeGrabs: BoolInt.True,
includeStorage: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions/{subscriptionId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.editSubscriptionPreferences({
subscriptionId: 673918,
prefs: {},
});
console.log(result);
}
run();
- target: $["paths"]["/media/subscriptions/{subscriptionId}/move"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.subscriptions.reorderSubscription({
subscriptionId: 440634,
});
console.log(result);
}
run();
- target: $["paths"]["/photo/:/transcode"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.transcoder.transcodeImage({
url: "/library/metadata/265/thumb/1715112705",
background: "#ff5522",
upscale: BoolInt.True,
minSize: BoolInt.True,
rotate: BoolInt.True,
blendColor: "#ff5522",
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { CreatePlayQueueType } from "@lukehagar/plexjs/models/operations";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.createPlayQueue({
type: CreatePlayQueueType.Audio,
shuffle: BoolInt.True,
repeat: BoolInt.True,
continuous: BoolInt.True,
recursive: BoolInt.True,
onDeck: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.getPlayQueue({
playQueueId: 210646,
own: BoolInt.True,
includeBefore: BoolInt.True,
includeAfter: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.addToPlayQueue({
playQueueId: 919248,
next: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}/items"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.clearPlayQueue({
playQueueId: 86357,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}/items/{playQueueItemId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.deletePlayQueueItem({
playQueueId: 285738,
playQueueItemId: 464354,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}/items/{playQueueItemId}/move"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.movePlayQueueItem({
playQueueId: 31341,
playQueueItemId: 495865,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}/reset"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.resetPlayQueue({
playQueueId: 581891,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}/shuffle"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.shuffle({
playQueueId: 316150,
});
console.log(result);
}
run();
- target: $["paths"]["/playQueues/{playQueueId}/unshuffle"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playQueue.unshuffle({
playQueueId: 484388,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playlist.listPlaylists({});
console.log(result);
}
run();
- target: $["paths"]["/playlists"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.createPlaylist({});
console.log(result);
}
run();
- target: $["paths"]["/playlists/upload"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.libraryPlaylists.uploadPlaylist({
path: "/home/barkley/playlist.m3u",
force: BoolInt.True,
});
}
run();
- target: $["paths"]["/playlists/{playlistId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.libraryPlaylists.deletePlaylist({
playlistId: 343293,
});
}
run();
- target: $["paths"]["/playlists/{playlistId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playlist.getPlaylist({
playlistId: 841953,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.libraryPlaylists.updatePlaylist({
playlistId: 157966,
});
}
run();
- target: $["paths"]["/playlists/{playlistId}/generators"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.getPlaylistGenerators({
playlistId: 162342,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.clearPlaylistItems({
playlistId: 552140,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.playlist.getPlaylistItems({
playlistId: 118195,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.addPlaylistItems({
playlistId: 533723,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items/{generatorId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.deletePlaylistItem({
playlistId: 981646,
generatorId: 194010,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items/{generatorId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.getPlaylistGenerator({
playlistId: 744880,
generatorId: 322168,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items/{generatorId}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { ModifyPlaylistGeneratorScope } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.modifyPlaylistGenerator({
playlistId: 972007,
generatorId: 208334,
item: {
location: {
uri: "library://82503060-0d68-4603-b594-8b071d54819e/item/%2Flibrary%2Fmetadata%2F146",
},
locationID: -1,
policy: {
scope: ModifyPlaylistGeneratorScope.All,
},
target: "",
targetTagID: 1,
title: "Jack-Jack Attack",
type: 42,
},
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items/{generatorId}/items"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.getPlaylistGeneratorItems({
playlistId: 77230,
generatorId: 979714,
});
console.log(result);
}
run();
- target: $["paths"]["/playlists/{playlistId}/items/{generatorId}/{metadataId}/{action}"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Action } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.libraryPlaylists.refreshPlaylist({
playlistId: 895314,
generatorId: 629742,
metadataId: 724422,
action: Action.Disable,
});
}
run();
- target: $["paths"]["/playlists/{playlistId}/items/{playlistItemId}/move"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.libraryPlaylists.movePlaylistItem({
playlistId: 940298,
playlistItemId: 375626,
});
console.log(result);
}
run();
- target: $["paths"]["/resources"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.plex.getServerResources({
includeHttps: IncludeHttps.True,
includeRelay: IncludeRelay.True,
includeIPv6: IncludeIPv6.True,
});
console.log(result);
}
run();
- target: $["paths"]["/security/resources"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.general.getSourceConnectionInformation({
source: "<value>",
refresh: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/security/token"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetTransientTokenScope, GetTransientTokenType } from "@lukehagar/plexjs/models/operations";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.general.getTransientToken({
type: GetTransientTokenType.Delegation,
scope: GetTransientTokenScope.All,
});
console.log(result);
}
run();
- target: $["paths"]["/services/ultrablur/colors"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.ultraBlur.getColors({
url: "/library/metadata/217745/art/1718931408",
});
console.log(result);
}
run();
- target: $["paths"]["/services/ultrablur/image"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.ultraBlur.getImage({
topLeft: "3f280a",
topRight: "6b4713",
bottomRight: "0f2a43",
bottomLeft: "1c425d",
width: 1920,
height: 1080,
noise: BoolInt.True,
});
console.log(result);
}
run();
- target: $["paths"]["/status/sessions"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.status.listSessions();
console.log(result);
}
run();
- target: $["paths"]["/status/sessions/background"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.status.getBackgroundTasks();
console.log(result);
}
run();
- target: $["paths"]["/status/sessions/history/all"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.status.listPlaybackHistory({
sort: [
"v",
"i",
"e",
"w",
"e",
"d",
"A",
"t",
":",
"d",
"e",
"s",
"c",
",",
"a",
"c",
"c",
"o",
"u",
"n",
"t",
"I",
"D",
],
});
console.log(result);
}
run();
- target: $["paths"]["/status/sessions/history/{historyId}"]["delete"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.status.deleteHistory({
historyId: 953579,
});
console.log(result);
}
run();
- target: $["paths"]["/status/sessions/history/{historyId}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.status.getHistoryItem({
historyId: 832213,
});
console.log(result);
}
run();
- target: $["paths"]["/status/sessions/terminate"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.status.terminateSession({
sessionId: "cdefghijklmnopqrstuvwxyz",
reason: "Stop Playing",
});
}
run();
- target: $["paths"]["/updater/apply"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.updater.applyUpdates({
tonight: BoolInt.True,
skip: BoolInt.True,
});
}
run();
- target: $["paths"]["/updater/check"]["put"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, BoolInt } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.updater.checkUpdates({
download: BoolInt.True,
});
}
run();
- target: $["paths"]["/updater/status"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.updater.getUpdatesStatus();
console.log(result);
}
run();
- target: $["paths"]["/user"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.authentication.getTokenDetails({});
console.log(result);
}
run();
- target: $["paths"]["/users"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.users.getUsers({});
console.log(result);
}
run();
- target: $["paths"]["/users/signin"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
});
async function run() {
const result = await plexAPI.authentication.postUsersSignInData({
requestBody: {
login: "username@email.com",
password: "password123",
verificationCode: "123456",
},
});
console.log(result);
}
run();
- target: $["paths"]["/{transcodeType}/:/transcode/universal/decision"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { MakeDecisionLocation, MakeDecisionProtocol } from "@lukehagar/plexjs/models/operations";
import { Accepts, AdvancedSubtitles, BoolInt, TranscodeType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.transcoder.makeDecision({
transcodeType: TranscodeType.Music,
advancedSubtitles: AdvancedSubtitles.Burn,
audioBoost: 50,
audioChannelCount: 5,
autoAdjustQuality: BoolInt.True,
autoAdjustSubtitle: BoolInt.True,
directPlay: BoolInt.True,
directStream: BoolInt.True,
directStreamAudio: BoolInt.True,
disableResolutionRotation: BoolInt.True,
hasMDE: BoolInt.True,
location: MakeDecisionLocation.Wan,
mediaBufferSize: 102400,
mediaIndex: 0,
musicBitrate: 5000,
offset: 90.5,
partIndex: 0,
path: "/library/metadata/151671",
peakBitrate: 12000,
photoResolution: "1080x1080",
protocol: MakeDecisionProtocol.Dash,
secondsPerSegment: 5,
subtitleSize: 50,
videoBitrate: 12000,
videoQuality: 50,
videoResolution: "1080x1080",
xPlexClientProfileExtra: "add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)",
xPlexClientProfileName: "generic",
});
console.log(result);
}
run();
- target: $["paths"]["/{transcodeType}/:/transcode/universal/fallback"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Accepts, TranscodeType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.transcoder.triggerFallback({
transcodeType: TranscodeType.Audio,
});
}
run();
- target: $["paths"]["/{transcodeType}/:/transcode/universal/start.{extension}"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Extension, StartTranscodeSessionLocation, StartTranscodeSessionProtocol } from "@lukehagar/plexjs/models/operations";
import { Accepts, AdvancedSubtitles, BoolInt, TranscodeType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.transcoder.startTranscodeSession({
transcodeType: TranscodeType.Music,
extension: Extension.Mpd,
advancedSubtitles: AdvancedSubtitles.Burn,
audioBoost: 50,
audioChannelCount: 5,
autoAdjustQuality: BoolInt.True,
autoAdjustSubtitle: BoolInt.True,
directPlay: BoolInt.True,
directStream: BoolInt.True,
directStreamAudio: BoolInt.True,
disableResolutionRotation: BoolInt.True,
hasMDE: BoolInt.True,
location: StartTranscodeSessionLocation.Wan,
mediaBufferSize: 102400,
mediaIndex: 0,
musicBitrate: 5000,
offset: 90.5,
partIndex: 0,
path: "/library/metadata/151671",
peakBitrate: 12000,
photoResolution: "1080x1080",
protocol: StartTranscodeSessionProtocol.Dash,
secondsPerSegment: 5,
subtitleSize: 50,
videoBitrate: 12000,
videoQuality: 50,
videoResolution: "1080x1080",
xPlexClientProfileExtra: "add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)",
xPlexClientProfileName: "generic",
});
console.log(result);
}
run();
- target: $["paths"]["/{transcodeType}/:/transcode/universal/subtitles"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { TranscodeSubtitlesLocation, TranscodeSubtitlesProtocol } from "@lukehagar/plexjs/models/operations";
import { Accepts, AdvancedSubtitles, BoolInt, TranscodeType } from "@lukehagar/plexjs/models/shared";
const plexAPI = new PlexAPI({
accepts: Accepts.ApplicationXml,
clientIdentifier: "abc123",
product: "Plex for Roku",
version: "2.4.1",
platform: "Roku",
platformVersion: "4.3 build 1057",
device: "Roku 3",
model: "4200X",
deviceVendor: "Roku",
deviceName: "Living Room TV",
marketplace: "googlePlay",
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.transcoder.transcodeSubtitles({
transcodeType: TranscodeType.Audio,
advancedSubtitles: AdvancedSubtitles.Burn,
audioBoost: 50,
audioChannelCount: 5,
autoAdjustQuality: BoolInt.True,
autoAdjustSubtitle: BoolInt.True,
directPlay: BoolInt.True,
directStream: BoolInt.True,
directStreamAudio: BoolInt.True,
disableResolutionRotation: BoolInt.True,
hasMDE: BoolInt.True,
location: TranscodeSubtitlesLocation.Wan,
mediaBufferSize: 102400,
mediaIndex: 0,
musicBitrate: 5000,
offset: 90.5,
partIndex: 0,
path: "/library/metadata/151671",
peakBitrate: 12000,
photoResolution: "1080x1080",
protocol: TranscodeSubtitlesProtocol.Dash,
secondsPerSegment: 5,
subtitleSize: 50,
videoBitrate: 12000,
videoQuality: 50,
videoResolution: "1080x1080",
xPlexClientProfileExtra: "add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)",
xPlexClientProfileName: "generic",
});
}
run();