GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — plexgo/docs/sdks/livetv/README.md at main · LukasParke/plexgo

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
469 lines (367 loc) · 24 KB
/

README.md

Copy path

File metadata and controls

469 lines (367 loc) · 24 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

LiveTV

Overview

LiveTV contains the playback sessions of a channel from a DVR device

Available Operations

  • GetDVRRecordings - Get DVR Recordings
  • GetSessions - Get all sessions
  • GetDVRRecordingsByDVR - Get DVR Recordings by DVR
  • DeleteLiveTVSession - Delete Live TV Session
  • GetLiveTVSession - Get a single session
  • GetSessionPlaylistIndex - Get a session playlist index
  • GetSessionSegment - Get a single session segment

GetDVRRecordings

List completed DVR recordings.

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.GetDVRRecordings(ctx, operations.GetDVRRecordingsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetDVRRecordingsRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetDVRRecordingsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetSessions

Get all livetv sessions and metadata

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.GetSessions(ctx, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
dvrID *int64 ➖ Filter by DVR ID.
channel *int64 ➖ Filter by channel ID.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetSessionsResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetDVRRecordingsByDVR

List completed DVR recordings for a specific DVR.

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.GetDVRRecordingsByDVR(ctx, operations.GetDVRRecordingsByDVRRequest{
        DvrID: 83756,
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetDVRRecordingsByDVRRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetDVRRecordingsByDVRResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

DeleteLiveTVSession

Terminate a Live TV session.

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.DeleteLiveTVSession(ctx, operations.DeleteLiveTVSessionRequest{
        SessionID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.SuccessResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.DeleteLiveTVSessionRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.DeleteLiveTVSessionResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetLiveTVSession

Get a single livetv session and metadata

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.GetLiveTVSession(ctx, operations.GetLiveTVSessionRequest{
        SessionID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.MediaContainerWithMetadata != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetLiveTVSessionRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetLiveTVSessionResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 401 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetSessionPlaylistIndex

Get a playlist index for playing this session

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.GetSessionPlaylistIndex(ctx, operations.GetSessionPlaylistIndexRequest{
        SessionID: "<id>",
        ConsumerID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.BinaryResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetSessionPlaylistIndexRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetSessionPlaylistIndexResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

GetSessionSegment

Get a single LiveTV session segment

Example Usage

package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.LiveTV.GetSessionSegment(ctx, operations.GetSessionSegmentRequest{
        SessionID: "<id>",
        ConsumerID: "<id>",
        SegmentID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.BinaryResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetSessionSegmentRequest ✔️ The request object to use for the request.
opts []operations.Option ➖ The options for this request.

Response

*operations.GetSessionSegmentResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.