An unofficial Go client library for streamable.com.
$ go get github.com/maxkueng/go-streamable
- Upload videos from a local file
- Upload videos from a remote URL
- Retreive information about a video
- Authenticated requests
Upload a video:
func main() {
client := streamable.New()
info, err := client.UploadVideo("selfie.mp4")
if err != nil {
panic(err)
}
fmt.Printf("%s\n", info.Shortcode);
}
Upload a video with authentication:
func main() {
client := streamable.New()
client.SetCredentials("user", "secret")
info, err := client.UploadVideo("selfie.mp4")
if err != nil {
panic(err)
}
fmt.Printf("%s\n", info.Shortcode);
}
Upload a video from a remote URL:
func main() {
videoURL := "https://archive.org/download/Windows7WildlifeSampleVideo/Wildlife.wmv"
client := streamable.New()
info, err := client.UploadVideoFromURL(videoURL)
if err != nil {
panic(err)
}
fmt.Printf("%s\n", info.Shortcode);
}
Receive information about a video:
func main() {
shortcode := "ifjh"
client := streamable.New()
info, err := client.GetVideo(shortcode)
if err != nil {
panic(err)
}
fmt.Printf("%s\n", info.ThumbnailURL)
}
MIT