mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 04:20:46 +00:00
1787 lines
50 KiB
YAML
1787 lines
50 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";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getServerCapabilities();
|
|
|
|
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({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getServerPreferences();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/:/progress"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.media.updatePlayProgress("<key>", 90000, "played");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/:/scrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.media.markPlayed(59398);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/:/timeline"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { State } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.video.getTimeline({
|
|
ratingKey: 23409,
|
|
key: "/library/metadata/23409",
|
|
state: State.Playing,
|
|
hasMDE: 1,
|
|
time: 2000,
|
|
duration: 10000,
|
|
context: "home:hub.continueWatching",
|
|
playQueueItemID: 1,
|
|
playBackTime: 2000,
|
|
row: 1,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/:/unscrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.media.markUnplayed(59398);
|
|
|
|
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({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.activities.getServerActivities();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/activities/{activityUUID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/butler"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.butler.stopAllTasks();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/butler"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.butler.getButlerTasks();
|
|
|
|
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({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.butler.startAllTasks();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/butler/{taskName}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.butler.stopTask(PathParamTaskName.CleanOldCacheFiles);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/butler/{taskName}"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { TaskName } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.butler.startTask(TaskName.RefreshPeriodicMetadata);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/clients"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getAvailableClients();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/companions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getCompanionsData();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/devices"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getDevices();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/friends"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getUserFriends();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/geoip"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI();
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getGeoData();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/home"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getHomeData();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/hubs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.hubs.getGlobalHubs();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/hubs/home/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.hubs.getRecentlyAdded({
|
|
contentDirectoryID: 39486,
|
|
sectionID: 2,
|
|
type: Type.TvShow,
|
|
includeMeta: IncludeMeta.Enable,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/hubs/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.search.performSearch("arnold");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/hubs/search/voice"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.search.performVoiceSearch("dead+poop");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.hubs.getLibraryHubs(492.74);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/identity"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI();
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getServerIdentity();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/all/top"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.TvShow);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/hashes"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getFileHash("file://C:\\Image.png&type=13");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getMediaMetaData({
|
|
ratingKey: "21119,21617",
|
|
includeConcerts: true,
|
|
includeExtras: true,
|
|
includeOnDeck: true,
|
|
includePopularLeaves: true,
|
|
includePreferences: true,
|
|
includeReviews: true,
|
|
includeChapters: true,
|
|
includeStations: true,
|
|
includeExternalMedia: true,
|
|
asyncAugmentMetadata: true,
|
|
asyncCheckFiles: true,
|
|
asyncRefreshAnalysis: true,
|
|
asyncRefreshLocalMediaAgent: true,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getMediaArts(16099);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.postMediaArts(2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.media.getBannerImage({
|
|
ratingKey: 9518,
|
|
width: 396,
|
|
height: 396,
|
|
minSize: 1,
|
|
upscale: 1,
|
|
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getMetadataChildren(2403.67, "Stream");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getMediaPosters(16099);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.postMediaPoster(2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.media.getThumbImage({
|
|
ratingKey: 9518,
|
|
width: 396,
|
|
height: 396,
|
|
minSize: 1,
|
|
upscale: 1,
|
|
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getRecentlyAddedLibrary({
|
|
contentDirectoryID: 2,
|
|
pinnedContentDirectoryID: [
|
|
3,
|
|
5,
|
|
7,
|
|
13,
|
|
12,
|
|
1,
|
|
6,
|
|
14,
|
|
2,
|
|
10,
|
|
16,
|
|
17,
|
|
],
|
|
sectionID: 2,
|
|
type: QueryParamType.TvShow,
|
|
includeMeta: QueryParamIncludeMeta.Enable,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import {
|
|
GetSearchAllLibrariesQueryParamIncludeCollections,
|
|
GetSearchAllLibrariesQueryParamIncludeExternalMedia,
|
|
SearchTypes,
|
|
} from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getSearchAllLibraries({
|
|
query: "<value>",
|
|
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
|
searchTypes: [
|
|
SearchTypes.People,
|
|
],
|
|
includeCollections: GetSearchAllLibrariesQueryParamIncludeCollections.Enable,
|
|
includeExternalMedia: GetSearchAllLibrariesQueryParamIncludeExternalMedia.Enable,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getAllLibraries();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/watchlist/{filter}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { Filter } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.watchlist.getWatchList({
|
|
filter: Filter.Released,
|
|
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.deleteLibrary(9518);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getLibraryDetails(9518);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/actor"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetActorsLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getActorsLibrary(9518, GetActorsLibraryQueryParamType.TvShow);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/all"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import {
|
|
GetLibrarySectionsAllQueryParamIncludeMeta,
|
|
GetLibrarySectionsAllQueryParamType,
|
|
IncludeAdvanced,
|
|
QueryParamIncludeCollections,
|
|
QueryParamIncludeExternalMedia,
|
|
QueryParamIncludeGuids,
|
|
} from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getLibrarySectionsAll({
|
|
sectionKey: 9518,
|
|
type: GetLibrarySectionsAllQueryParamType.TvShow,
|
|
includeMeta: GetLibrarySectionsAllQueryParamIncludeMeta.Enable,
|
|
includeGuids: QueryParamIncludeGuids.Enable,
|
|
includeAdvanced: IncludeAdvanced.Enable,
|
|
includeCollections: QueryParamIncludeCollections.Enable,
|
|
includeExternalMedia: QueryParamIncludeExternalMedia.Enable,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/country"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetCountriesLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getCountriesLibrary(9518, GetCountriesLibraryQueryParamType.TvShow);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetGenresLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getGenresLibrary(9518, GetGenresLibraryQueryParamType.TvShow);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { Force } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.Zero);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getSearchLibrary(9518, GetSearchLibraryQueryParamType.TvShow);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import {
|
|
GetLibraryItemsQueryParamIncludeMeta,
|
|
GetLibraryItemsQueryParamType,
|
|
IncludeGuids,
|
|
Tag,
|
|
} from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.library.getLibraryItems({
|
|
tag: Tag.Newest,
|
|
includeGuids: IncludeGuids.Enable,
|
|
type: GetLibraryItemsQueryParamType.TvShow,
|
|
sectionKey: 9518,
|
|
includeMeta: GetLibraryItemsQueryParamIncludeMeta.Enable,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/log"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { Level } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/log"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.log.logMultiLine("level=4&message=Test%20message%201&source=postman\n" +
|
|
"level=3&message=Test%20message%202&source=postman\n" +
|
|
"level=1&message=Test%20message%203&source=postman");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/log/networked"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.log.enablePaperTrail();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/media/providers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getMediaProviders("CV5xoxjTpFKUzBTShsaf");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/myplex/account"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getMyPlexAccount();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/photo/:/transcode"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { MinSize, Upscale } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getResizedPhoto({
|
|
width: 110,
|
|
height: 165,
|
|
blur: 0,
|
|
minSize: MinSize.Zero,
|
|
upscale: Upscale.Zero,
|
|
url: "/library/metadata/49564/thumb/1654258204",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/pins"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI();
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getPin({
|
|
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
|
clientName: "Plex for Roku",
|
|
deviceNickname: "Roku 3",
|
|
clientVersion: "2.4.1",
|
|
platform: "Roku",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/pins/{pinID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI();
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getTokenByPinId({
|
|
pinID: 232248,
|
|
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
|
clientName: "Plex for Roku",
|
|
deviceNickname: "Roku 3",
|
|
clientVersion: "2.4.1",
|
|
platform: "Roku",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.getPlaylists();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.createPlaylist({
|
|
title: "<value>",
|
|
type: CreatePlaylistQueryParamType.Audio,
|
|
smart: Smart.One,
|
|
uri: "https://short-term-disconnection.name/",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/upload"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", QueryParamForce.One, 1);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/{playlistID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.deletePlaylist(3432.93);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/{playlistID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.getPlaylist(8419.53);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/{playlistID}"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.updatePlaylist(1579.66);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.clearPlaylistContents(4137.37);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.getPlaylistContents(5535.42, GetPlaylistContentsQueryParamType.TvShow);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.playlists.addPlaylistContents(7013.44, "server://12345/com.plexapp.plugins.library/library/metadata/1", 123);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.plex.getServerResources("3381b62b-9ab7-4e37-827b-203e9809eb58");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.search.getSearchResults("110");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/security/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/security/token"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/servers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.server.getServerList();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/statistics/bandwidth"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.statistics.getBandwidthStatistics(4);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/statistics/media"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.statistics.getStatistics(4);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/statistics/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.statistics.getResourcesStatistics(4);
|
|
|
|
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({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.sessions.getSessions();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/status/sessions/history/all"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.sessions.getSessionHistory("viewedAt:desc", 1, {}, 12);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/transcode/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.sessions.getTranscodeSessions();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep");
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/updater/apply"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { Skip, Tonight } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/updater/check"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
import { Download } from "@lukehagar/plexjs/sdk/models/operations";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.updater.checkForUpdates(Download.One);
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/updater/status"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.updater.getUpdateStatus();
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/user"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<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";
|
|
|
|
const plexAPI = new PlexAPI();
|
|
|
|
async function run() {
|
|
const result = await plexAPI.users.getUsers({
|
|
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
|
clientName: "Plex for Roku",
|
|
deviceNickname: "Roku 3",
|
|
deviceName: "Chrome",
|
|
deviceScreenResolution: "1487x1165,2560x1440",
|
|
clientVersion: "2.4.1",
|
|
platform: "Roku",
|
|
clientFeatures: "external-media,indirect-media,hub-style-list",
|
|
model: "4200X",
|
|
xPlexSessionId: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca",
|
|
xPlexLanguage: "en",
|
|
platformVersion: "4.3 build 1057",
|
|
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/users/signin"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI();
|
|
|
|
async function run() {
|
|
const result = await plexAPI.authentication.postUsersSignInData({
|
|
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
|
clientName: "Plex for Roku",
|
|
deviceNickname: "Roku 3",
|
|
clientVersion: "2.4.1",
|
|
platform: "Roku",
|
|
requestBody: {
|
|
login: "username@email.com",
|
|
password: "password123",
|
|
verificationCode: "123456",
|
|
},
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|
|
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: typescript
|
|
label: PlexJS
|
|
source: |-
|
|
import { PlexAPI } from "@lukehagar/plexjs";
|
|
|
|
const plexAPI = new PlexAPI({
|
|
accessToken: "<YOUR_API_KEY_HERE>",
|
|
});
|
|
|
|
async function run() {
|
|
const result = await plexAPI.video.startUniversalTranscode({
|
|
hasMDE: 1,
|
|
path: "/library/metadata/23409",
|
|
mediaIndex: 0,
|
|
partIndex: 0,
|
|
protocol: "hls",
|
|
fastSeek: 0,
|
|
directPlay: 0,
|
|
directStream: 0,
|
|
subtitleSize: 100,
|
|
subtites: "burn",
|
|
audioBoost: 100,
|
|
location: "lan",
|
|
mediaBufferSize: 102400,
|
|
session: "zvcage8b7rkioqcm8f4uns4c",
|
|
addDebugOverlay: 0,
|
|
autoAdjustQuality: 0,
|
|
});
|
|
|
|
console.log(result);
|
|
}
|
|
|
|
run();
|