Go package that gets the length of Youtube videos.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
LICENSE
README.md
client.go
client_test.go
doc.go
videos_test.go
youtubelength.go
youtubelength_example_test.go
youtubelength_test.go

README.md

4d63.com/youtubelength

Build Status Codecov Go Report Card Go docs

Go package that gets the length of Youtube videos.

Usage

import "4d63.com/youtubelength"
length, err := youtubelength.Get(context.Background(), "G_OlRWGLdnw")

Usage (App Engine)

import (
	"net/http"

	"google.golang.org/appengine"
	"google.golang.org/appengine/urlfetch"

	"4d63.com/youtubelength"
)

func handler(w http.ResponseWriter, r *http.Request) {
	c := appengine.NewContext(r)
	httpClient := urlfetch.Client(c)
	ytlClient := youtubelength.Client{HTTPClient:httpClient}
	length, err := ytlClient.Get(c, "G_OlRWGLdnw")
	...
}