reddit.live

class praw.models.LiveHelper(reddit, _data)

Provide a set of functions to interact with LiveThreads.

Parameters:
__call__(id)

Return a new lazy instance of LiveThread.

This method is intended to be used as:

livethread = reddit.live("ukaeu1ik4sw5")
Parameters:

id (str) – A live thread ID, e.g., ukaeu1ik4sw5.

Return type:

LiveThread

__init__(reddit, _data)

Initialize a PRAWBase instance.

Parameters:
Return type:

None

create(title, *, description=None, nsfw=False, resources=None)

Create a new LiveThread.

Parameters:
  • title (str) – The title of the new LiveThread.

  • description (str | None) – The new LiveThread’s description.

  • nsfw (bool) – Indicate whether this thread is not safe for work (default: False).

  • resources (str | None) – Markdown formatted information that is useful for the LiveThread.

Return type:

LiveThread

Returns:

The new LiveThread object.

info(ids)

Fetch information about each live thread in ids.

Parameters:

ids (list[str]) – A list of IDs for a live thread.

Return type:

Iterator[LiveThread]

Returns:

A generator that yields LiveThread instances.

Raises:

prawcore.ServerError if invalid live threads are requested.

Requests will be issued in batches for each 100 IDs.

Note

This method doesn’t support IDs for live updates.

Warning

Unlike Reddit.info(), the output of this method may not reflect the order of input.

Usage:

ids = ["3rgnbke2rai6hen7ciytwcxadi", "sw7bubeycai6hey4ciytwamw3a", "t8jnufucss07"]
for thread in reddit.live.info(ids):
    print(thread.title)
now()

Get the currently featured live thread.

Return type:

LiveThread | None

Returns:

The LiveThread object, or None if there is no currently featured live thread.

Usage:

thread = reddit.live.now()  # LiveThread object or None
classmethod parse(data, reddit)

Return an instance of cls from data.

Parameters:
Return type:

PRAWBase