Documentation
¶
Overview ¶
Package gfycatdl downloads gifs from gfycat given a URL
Usage:
package main
import (
"log"
"github.com/umahmood/gfycatdl"
)
func main() {
g, err := gfycatdl.New("https://gfycat.com/violetsmartalleycat-sunset-dusk-nature")
if err != nil {
log.Fatalln(err)
}
scrapedURL, err := g.ScrapeVideoSource()
if err != nil {
log.Fatalln(err)
}
err = gfycatdl.DownloadFile(g.ResourceName, scrapedURL)
if err != nil {
log.Fatalln(err)
}
}
Index ¶
Constants ¶
View Source
const ( Major = 1 Minor = 0 Patch = 0 )
Semantic versioning - http://semver.org/
Variables ¶
View Source
var ErrBadDomain = errors.New("url is not a valid gfycat url")
ErrBadDomain url is not a valid gfycat url i.e. https://gfycat.com/violetsmartalleycat-sunset-dusk-nature
View Source
var ErrBadScrape = errors.New("failed to find gfycat downloadable media")
ErrBadScrape failed to find gfycat downloadable media
Functions ¶
func DownloadFile ¶
DownloadFile downloads a file given a url pointing to a resource.
Types ¶
type Gfycatdl ¶
type Gfycatdl struct {
ResourceName string // Name gyfcat resource name
// contains filtered or unexported fields
}
Gfycatdl instance
func (*Gfycatdl) ScrapeVideoSource ¶
ScrapeVideoSource scrapes <source> tags from a gfycat web page
Click to show internal directories.
Click to hide internal directories.