pyytlounge.YtLoungeApi

class pyytlounge.YtLoungeApi(device_name: str, logger: Logger = None)

Wrapper class for YouTube Lounge API

__init__(device_name: str, logger: Logger = None)

Methods

__init__(device_name[, logger])

close()

connect()

Attempt to connect using the previously set tokens

connected()

Returns true if the screen's session is connected.

disconnect()

Disconnect from the current session

get_thumbnail_url([thumbnail_idx])

Returns thumbnail for current video.

is_available()

Asks YouTube API if the screen is available.

linked()

Returns true if paired and lounge id token is known.

load_auth_state(data)

Use deserialized auth parameters

next()

Sends next command to screen

pair(pairing_code)

Pair with a device using a manual input pairing code

pair_with_screen_id(screen_id[, screen_name])

Pair with a device using a known screen id Optionally specify the screen name if already known

paired()

Returns true if screen id is known.

pause()

Sends pause command to screen

play()

Sends play command to screen

play_video(video_id)

Sends setPlaylist command to screen to play a specific video

previous()

Sends previous command to screen

refresh_auth()

Refresh lounge token using stored refresh token.

seek_to(time)

Seek to given time (seconds)

set_auto_play_mode(enabled)

set_volume(volume)

Sets volume to given value (0-100)

skip_ad()

Skips ad if possible

store_auth_state()

Return auth parameters as dict which can be serialized for later use

subscribe(callback)

Start listening for events

Attributes

screen_device_name

Returns device name built from device info returned by YouTube.

screen_name

Returns screen name as returned by YouTube