install

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var YtDlp = func(ctx context.Context) (*ResolvedInstall, error) {
	if runtime.GOOS == "darwin" {
		fmt.Println("install command is not supported on this platform please install manually from https://github.com/yt-dlp/yt-dlp/releases")
		return nil, nil
	}

	var fileName string

	if runtime.GOOS == "windows" {
		fileName = "yt-dlp.exe"
	} else {
		fileName = "yt-dlp"
	}

	ytDlpDirectory := filepath.Join(config.GetCacheDir(runtime.GOOS), fileName)
	checksumDir := filepath.Join(config.GetCacheDir(runtime.GOOS), "yt-dlp-checksum")
	plat, err := detectPlatform()
	if err != nil {
		panic(err)
	}

	githubOwner := "yt-dlp"
	githubRepo := "yt-dlp"

	rel, err := fetchLatestRelease(githubOwner, githubRepo)
	if err != nil {
		panic(err)
	}

	want := assetMap[plat]

	url, err := findDownloadURL(rel, want)
	if err != nil {
		panic(err)
	}

	isAlreadyLatestVersion, err := isAlreadyInstalledAndLatestVersion(ytDlpDirectory, rel.TagName)

	if err == nil && isAlreadyLatestVersion {
		return &ResolvedInstall{
			Executable: ytDlpDirectory,
			Version:    rel.TagName,
			FromCache:  true,
			Downloaded: true,
		}, nil
	}

	checksumDownloadURL, err := findDownloadURL(rel, "SHA2-256SUMS")

	if err != nil {
		panic(err)
	}

	return install(url, checksumDownloadURL, ytDlpDirectory, checksumDir, want)
}

Functions

This section is empty.

Types

type ResolvedInstall

type ResolvedInstall struct {
	Executable string
	Version    string
	FromCache  bool
	Downloaded bool
}

func FFmpeg

func FFmpeg(ctx context.Context) (*ResolvedInstall, error)

Jump to

Keyboard shortcuts

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