tub_ex v0.1.0 TubEx.Video

Provide access to the /videos are of YouTube API

Summary

Types

t()

Type that represents TubEx.Video struct

Functions

Fetch contents details

Returns a list of videos that match the API request parameters

Search from youtube via query

Types

t()
t() :: %TubEx.Video{channel_id: charlist, channel_title: charlist, description: charlist, etag: charlist, published_at: charlist, thumbnails: list, title: charlist, video_id: charlist}

Type that represents TubEx.Video struct.

Functions

get(video_id)
get(charlist) :: {atom, TubEx.Video.t}

Fetch contents details

Example:

iex> TubEx.Video.get("_J4QPz52Sfo")
{ :ok, %TubEx.Video{} }
related(video_id, opts \\ [])
related(charlist, Keyword.t) :: {atom, [TubEx.Video.t], map}

Returns a list of videos that match the API request parameters.

Examples

Get related videos:

iex> TubEx.Video.related("_J4QPz52Sfo")
{ :ok, [%TubEx.Video{}, ...], meta_map }

Custom query parameters:

iex> TubEx.Video.related("_J4QPz52Sfo", [
  paramKey: paramValue,
  ...
])
{ :ok, [%TubEx.Video{}], meta_map }
search(query, opts \\ [])
search(charlist, Keyword.t) :: {atom, [TubEx.Video.t], map}

Search from youtube via query.

Examples

Get videos by query:

iex> TubEx.Video.search("The great debates")
{ :ok, [%TubEx.Video{}, ...], meta_map }

Custom query parameters:

iex> TubEx.Video.search("The great debates", [
  paramKey: paramValue,
  ...
])
{ :ok, [%TubEx.Video{}, ...], meta_map }