gifdl

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 5 Imported by: 0

README

gifdl

Golang library for downloading GIFs from giphy and tenor

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedURL = errors.New("no downloader for url")

Functions

func DownloadGIF

func DownloadGIF(url string) (*gif.GIF, string, error)

DownloadGIF fetches the GIF and decodes it to a *gif.GIF

func GetGIFDownloadUrl

func GetGIFDownloadUrl(url string) (string, string, error)

GetGIFDownloadUrl returns the download URL and title of a GIF

func RegisterDownloader

func RegisterDownloader(name string, downloader Downloader)

RegisterDownloader registers a GIF downloader for a URL pattern

Types

type Downloader

type Downloader interface {
	// DownloadURL gets the download url and title of a gif
	DownloadURL(url string) (downloadUrl string, title string, err error)
	// MatchesURL checks if a url is handled by this downloader
	MatchesURL(url string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL