Crate maguro

Crate maguro 

Source
Expand description

§maguro

An async library for downloading and streaming media, with out-of-the-box support for YouTube.

§Example

use maguro;
use tokio::fs::OpenOptions;

// ...

// Get our video information and location the first format
// available.
let video_info = maguro::get_video_info("VfWgE7D1pYY").await?;
let format = video_info.all_formats().first().cloned()?;

// Open an asynchronous file handle.
let mut output = OpenOptions::new()
    .read(false)
    .write(true)
    .create(true)
    .open("maguro.mp4")
    .await?;

// Download the video.
format.download(&mut output).await?;

Modules§

serde
Extensions to serde for deserializing unsupported types.

Structs§

Format
Describes a single streaming format for a YouTube video.
InfoResponse
YouTube get_video_info response.
StreamingData
The set of sources available to download a YouTube video with.
VideoDetails
Details about some YouTube video.

Functions§

get_video_info
Acquires the InfoResponse struct for a given video ID.