### Download YouTube Video with goutubedl Source: https://github.com/wader/goutubedl/blob/master/README.md This snippet demonstrates how to download a YouTube video using the goutubedl library. It shows how to initialize the library, specify download options, and save the downloaded content to a file. Ensure yt-dlp is installed and accessible in your PATH. ```go package main import ( "context" "io" "log" "os" "github.com/wader/goutubedl" ) func main() { result, err := goutubedl.New(context.Background(), "https://www.youtube.com/watch?v=jgVhBThJdXc", goutubedl.Options{}) if err != nil { log.Fatal(err) } downloadResult, err := result.Download(context.Background(), "best") if err != nil { log.Fatal(err) } defer downloadResult.Close() f, err := os.Create("output") if err != nil { log.Fatal(err) } defer f.Close() io.Copy(f, downloadResult) } ``` -------------------------------- ### Build and Run Development Environment for goutubedl Source: https://github.com/wader/goutubedl/blob/master/README.md This snippet shows how to build a Docker image for development and run it. It mounts the current directory into the container and executes Go tests with race detection and coverage. ```sh docker build --target dev -t goutubedl-dev . docker run --rm -ti -v "$PWD:$PWD" -w "$PWD" goutubedl-dev go test -v -race -cover ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.