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 ¶
Click to show internal directories.
Click to hide internal directories.