Syts v0.2.0 Syts View Source

This is the Syts module.

It provides functions for sending a YouTube search query (via youtube-dl), offering a selection of results to the user, and then playing a selected result in MPV.

Link to this section Summary

Functions

Perform system sanity checks

Offer a list of playable options to the user, by title

Plays the given video in MPV

Run the entire search - select - play operation

Run a YouTube search on a query string

Link to this section Functions

Link to this function check_system_sanity!() View Source
check_system_sanity!() :: :ok

Perform system sanity checks.

In particular, raise a RuntimeError if Syts’s external dependencies are not installed.

Returns :ok.

Link to this function offer_selection(options) View Source
offer_selection([map]) :: map

Offer a list of playable options to the user, by title.

This function lists the results of a query and accepts a number from the user indicating which video in the list to return.

Returns a map of the selected video’s information.

Link to this function play_selection(map) View Source
play_selection(map) :: :ok

Plays the given video in MPV.

This function accepts a map describing a YouTube video, and plays that video in MPV.

Returns :ok.

Run the entire search - select - play operation.

Returns :ok.

Examples

Syts.run "cat videos"
:ok
Link to this function search(query) View Source
search(String.t) :: [map]

Run a YouTube search on a query string.

This function uses youtube-dl internally.

Returns a list of JSON-decoded maps.