mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
2540 lines
81 KiB
YAML
2540 lines
81 KiB
YAML
overlay: 1.0.0
|
|
info:
|
|
title: CodeSamples overlay for go target
|
|
version: 0.0.0
|
|
actions:
|
|
- target: $["paths"]["/"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getServerCapabilities
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetServerCapabilities(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/prefs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getServerPreferences
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetServerPreferences(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/progress"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: updatePlayProgress
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Media.UpdatePlayProgress(ctx, "<key>", 90000, "played")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/scrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: markPlayed
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Media.MarkPlayed(ctx, 59398)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/timeline"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getTimeline
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{
|
|
RatingKey: 23409,
|
|
Key: "/library/metadata/23409",
|
|
State: operations.StatePlaying,
|
|
HasMDE: 1,
|
|
Time: 2000,
|
|
Duration: 10000,
|
|
Context: "home:hub.continueWatching",
|
|
PlayQueueItemID: 1,
|
|
PlayBackTime: 2000,
|
|
Row: 1,
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/:/unscrobble"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: markUnplayed
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Media.MarkUnplayed(ctx, 59398)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/activities"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getServerActivities
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Activities.GetServerActivities(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/activities/{activityUUID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: cancelServerActivities
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Activities.CancelServerActivities(ctx, "25b71ed5-0f9d-461c-baa7-d404e9e10d3e")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: stopAllTasks
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Butler.StopAllTasks(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getButlerTasks
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Butler.GetButlerTasks(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: startAllTasks
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Butler.StartAllTasks(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler/{taskName}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: stopTask
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Butler.StopTask(ctx, operations.PathParamTaskNameBackupDatabase)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/butler/{taskName}"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: startTask
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Butler.StartTask(ctx, operations.TaskNameCleanOldBundles)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/clients"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getAvailableClients
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetAvailableClients(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/companions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getCompanionsData
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetCompanionsData(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.ResponseBodies != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/devices"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getDevices
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetDevices(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/friends"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getUserFriends
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetUserFriends(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Friends != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/geoip"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getGeoData
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetGeoData(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.GeoData != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/home"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getHomeData
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetHomeData(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getGlobalHubs
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Hubs.GetGlobalHubs(ctx, nil, nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: performSearch
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Search.PerformSearch(ctx, "dylan", nil, plexgo.Float64(5))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/search/voice"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: performVoiceSearch
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Search.PerformVoiceSearch(ctx, "dead+poop", nil, plexgo.Float64(5))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getLibraryHubs
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Hubs.GetLibraryHubs(ctx, 6728.76, nil, nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/identity"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: identity
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetServerIdentity(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/all/top"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getTopWatchedContent
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetTopWatchedContent(ctx, operations.GetTopWatchedContentQueryParamTypeShow, plexgo.Int64(1))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/hashes"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getFileHash
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetFileHash(ctx, "file://C:\Image.png&type=13", nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: key
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetMetaDataByRatingKey(ctx, 9518)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: image
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Media.GetBannerImage(ctx, operations.GetBannerImageRequest{
|
|
RatingKey: 9518,
|
|
Width: 396,
|
|
Height: 396,
|
|
MinSize: 1,
|
|
Upscale: 1,
|
|
XPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.ResponseStream != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getMetadataChildren
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetMetadataChildren(ctx, 1539.15, plexgo.String("Stream"))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: image
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Media.GetThumbImage(ctx, operations.GetThumbImageRequest{
|
|
RatingKey: 9518,
|
|
Width: 396,
|
|
Height: 396,
|
|
MinSize: 1,
|
|
Upscale: 1,
|
|
XPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.ResponseStream != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/onDeck"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getOnDeck
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetOnDeck(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/recentlyAdded"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getRecentlyAdded
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetRecentlyAdded(ctx, plexgo.Int(0), plexgo.Int(50))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: libraries
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetAllLibraries(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/watchlist/{filter}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: list
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Watchlist.GetWatchList(ctx, operations.GetWatchListRequest{
|
|
Filter: operations.FilterAvailable,
|
|
XPlexContainerStart: plexgo.Int(0),
|
|
XPlexContainerSize: plexgo.Int(50),
|
|
XPlexToken: "CV5xoxjTpFKUzBTShsaf",
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: deleteLibrary
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.DeleteLibrary(ctx, 9518)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: details
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: metadata
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetRefreshLibraryMetadata(ctx, 9518, operations.ForceOne.ToPointer())
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: library
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.QueryParamTypeShow)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: items
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{
|
|
SectionKey: 9518,
|
|
Tag: operations.TagEdition,
|
|
IncludeGuids: operations.IncludeGuidsEnable.ToPointer(),
|
|
IncludeMeta: operations.IncludeMetaEnable.ToPointer(),
|
|
Type: operations.TypeShow,
|
|
XPlexContainerStart: plexgo.Int(0),
|
|
XPlexContainerSize: plexgo.Int(50),
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/log"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: logLine
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Log.LogLine(ctx, operations.LevelThree, "Test log message", "Postman")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/log"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: logMultiLine
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Log.LogMultiLine(ctx, "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")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/log/networked"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: enablePaperTrail
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Log.EnablePaperTrail(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/media/providers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: providers
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetMediaProviders(ctx, "CV5xoxjTpFKUzBTShsaf")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/myplex/account"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getMyPlexAccount
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetMyPlexAccount(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/photo/:/transcode"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getResizedPhoto
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetResizedPhoto(ctx, operations.GetResizedPhotoRequest{
|
|
Width: 110,
|
|
Height: 165,
|
|
Opacity: 100,
|
|
Blur: 0,
|
|
MinSize: operations.MinSizeOne,
|
|
Upscale: operations.UpscaleOne,
|
|
URL: "/library/metadata/49564/thumb/1654258204",
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/pins"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getPin
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetPin(ctx, operations.GetPinRequest{})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.AuthPinContainer != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/pins/{pinID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getTokenByPinId
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetTokenByPinID(ctx, 408895)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.AuthPinContainer != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getPlaylists
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.GetPlaylists(ctx, nil, nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: createPlaylist
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{
|
|
Title: "<value>",
|
|
Type: operations.CreatePlaylistQueryParamTypePhoto,
|
|
Smart: operations.SmartOne,
|
|
URI: "https://hoarse-testing.info/",
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/upload"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: uploadPlaylist
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.UploadPlaylist(ctx, "/home/barkley/playlist.m3u", operations.QueryParamForceZero, 1)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: deletePlaylist
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.DeletePlaylist(ctx, 216.22)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getPlaylist
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.GetPlaylist(ctx, 4109.48)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: updatePlaylist
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.UpdatePlaylist(ctx, 3915.00, nil, nil)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: clearPlaylistContents
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.ClearPlaylistContents(ctx, 1893.18)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getPlaylistContents
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.GetPlaylistContents(ctx, 5004.46, operations.GetPlaylistContentsQueryParamTypeShow)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/playlists/{playlistID}/items"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: addPlaylistContents
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Playlists.AddPlaylistContents(ctx, 8502.00, "server://12345/com.plexapp.plugins.library/library/metadata/1", plexgo.Float64(123))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: resources
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Plex.GetServerResources(ctx, operations.IncludeHTTPSEnable.ToPointer(), operations.IncludeRelayEnable.ToPointer(), operations.IncludeIPv6Enable.ToPointer())
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.PlexDevices != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/search"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getSearchResults
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Search.GetSearchResults(ctx, "110")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/security/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getSourceConnectionInformation
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Authentication.GetSourceConnectionInformation(ctx, "provider://provider-identifier")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/security/token"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getTransientToken
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Authentication.GetTransientToken(ctx, operations.GetTransientTokenQueryParamTypeDelegation, operations.ScopeAll)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/servers"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getServerList
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetServerList(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/statistics/bandwidth"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getBandwidthStatistics
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Statistics.GetBandwidthStatistics(ctx, plexgo.Int64(4))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/statistics/media"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getStatistics
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Statistics.GetStatistics(ctx, plexgo.Int64(4))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/statistics/resources"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getResourcesStatistics
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Statistics.GetResourcesStatistics(ctx, plexgo.Int64(4))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/status/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getSessions
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Sessions.GetSessions(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/status/sessions/history/all"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getSessionHistory
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Sessions.GetSessionHistory(ctx, plexgo.String("viewedAt:desc"), plexgo.Int64(1), &operations.QueryParamFilter{}, plexgo.Int64(12))
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/transcode/sessions"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getTranscodeSessions
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Sessions.GetTranscodeSessions(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: stopTranscodeSession
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Sessions.StopTranscodeSession(ctx, "zz7llzqlx8w9vnrsbnwhbmep")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/updater/apply"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: applyUpdates
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Updater.ApplyUpdates(ctx, operations.TonightOne.ToPointer(), operations.SkipOne.ToPointer())
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/updater/check"]["put"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: checkForUpdates
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Updater.CheckForUpdates(ctx, operations.DownloadOne.ToPointer())
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/updater/status"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getUpdateStatus
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Updater.GetUpdateStatus(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/user"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: getTokenDetails
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Authentication.GetTokenDetails(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.UserPlexAccount != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/users/signin"]["post"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: data
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Authentication.PostUsersSignInData(ctx, &operations.PostUsersSignInDataRequestBody{
|
|
Login: "username@email.com",
|
|
Password: "password123",
|
|
VerificationCode: plexgo.String("123456"),
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.UserPlexAccount != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
|
|
update:
|
|
x-codeSamples:
|
|
- lang: go
|
|
label: startUniversalTranscode
|
|
source: |-
|
|
package main
|
|
|
|
import(
|
|
"github.com/LukeHagar/plexgo"
|
|
"context"
|
|
"github.com/LukeHagar/plexgo/models/operations"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithClientID("gcgzw5rz2xovp84b4vha3a40"),
|
|
plexgo.WithClientName("Plex Web"),
|
|
plexgo.WithClientVersion("4.133.0"),
|
|
plexgo.WithClientPlatform("Chrome"),
|
|
plexgo.WithDeviceName("Linux"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{
|
|
HasMDE: 1,
|
|
Path: "/library/metadata/23409",
|
|
MediaIndex: 0,
|
|
PartIndex: 0,
|
|
Protocol: "hls",
|
|
FastSeek: plexgo.Float64(0),
|
|
DirectPlay: plexgo.Float64(0),
|
|
DirectStream: plexgo.Float64(0),
|
|
SubtitleSize: plexgo.Float64(100),
|
|
Subtites: plexgo.String("burn"),
|
|
AudioBoost: plexgo.Float64(100),
|
|
Location: plexgo.String("lan"),
|
|
MediaBufferSize: plexgo.Float64(102400),
|
|
Session: plexgo.String("zvcage8b7rkioqcm8f4uns4c"),
|
|
AddDebugOverlay: plexgo.Float64(0),
|
|
AutoAdjustQuality: plexgo.Float64(0),
|
|
})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res != nil {
|
|
// handle response
|
|
}
|
|
}
|