gleetube/resource/videos

Types

Chart type for videos.list.

pub type VideoChart {
  MostPopular
}

Constructors

  • MostPopular

Filter for videos.list — exactly one filter must be specified.

pub type VideoFilter {
  ByChart(chart: VideoChart)
  ById(ids: List(String))
  ByMyRating(rating: VideoRating)
}

Constructors

  • ByChart(chart: VideoChart)

    Filter by chart (e.g., most popular).

  • ById(ids: List(String))

    Filter by one or more video IDs.

  • ByMyRating(rating: VideoRating)

    Filter by user’s rating (liked/disliked videos, requires OAuth2).

Valid part values for the videos resource.

pub type VideoPart {
  ContentDetails
  FileDetails
  Id
  LiveStreamingDetails
  Localizations
  Player
  ProcessingDetails
  RecordingDetails
  Snippet
  Statistics
  Status
  Suggestions
  TopicDetails
}

Constructors

  • ContentDetails
  • FileDetails
  • Id
  • LiveStreamingDetails
  • Localizations
  • Player
  • ProcessingDetails
  • RecordingDetails
  • Snippet
  • Statistics
  • Status
  • Suggestions
  • TopicDetails

Rating value for videos.rate.

pub type VideoRating {
  Like
  Dislike
  RatingNone
}

Constructors

  • Like
  • Dislike
  • RatingNone

Values

pub fn delete(
  client: client.Client,
  video_id video_id: String,
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
) -> Result(Nil, error.GleeTubeError)

Delete a video.

pub fn get_rating(
  client: client.Client,
  video_ids video_ids: List(String),
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
) -> Result(video.VideoGetRatingResponse, error.GleeTubeError)

Get the rating that the authorized user gave to a list of videos.

pub fn insert(
  client: client.Client,
  parts parts: List(VideoPart),
  body body: json.Json,
  notify_subscribers notify_subscribers: option.Option(Bool),
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
  on_behalf_of_content_owner_channel on_behalf_of_content_owner_channel: option.Option(
    String,
  ),
) -> Result(video.Video, error.GleeTubeError)

Insert (upload) a new video.

pub fn insert_with_media(
  client: client.Client,
  parts parts: List(VideoPart),
  body body: json.Json,
  media media: media.Media,
  notify_subscribers notify_subscribers: option.Option(Bool),
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
  on_behalf_of_content_owner_channel on_behalf_of_content_owner_channel: option.Option(
    String,
  ),
) -> Result(video.Video, error.GleeTubeError)

Insert (upload) a new video with media file using resumable upload.

pub fn list(
  client: client.Client,
  parts parts: List(VideoPart),
  filter filter: VideoFilter,
  hl hl: option.Option(String),
  max_height max_height: option.Option(Int),
  max_results max_results: option.Option(Int),
  max_width max_width: option.Option(Int),
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
  page_token page_token: option.Option(String),
  region_code region_code: option.Option(String),
  video_category_id video_category_id: option.Option(String),
) -> Result(video.VideoListResponse, error.GleeTubeError)

List videos matching the given filter.

pub fn list_all(
  client: client.Client,
  parts parts: List(VideoPart),
  filter filter: VideoFilter,
  hl hl: option.Option(String),
  max_height max_height: option.Option(Int),
  max_width max_width: option.Option(Int),
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
  region_code region_code: option.Option(String),
  video_category_id video_category_id: option.Option(String),
) -> Result(List(video.Video), error.GleeTubeError)

Fetch all videos across all pages.

pub fn rate(
  client: client.Client,
  video_id video_id: String,
  rating rating: VideoRating,
) -> Result(Nil, error.GleeTubeError)

Rate a video (like, dislike, or remove rating).

pub fn report_abuse(
  client: client.Client,
  body body: json.Json,
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
) -> Result(Nil, error.GleeTubeError)

Report a video for containing abusive content.

pub fn update(
  client: client.Client,
  parts parts: List(VideoPart),
  body body: json.Json,
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
) -> Result(video.Video, error.GleeTubeError)

Update a video’s metadata.

Search Document