package main import ( "bufio" "embed" "flag" "fmt" "html/template" "io/fs" "log" "net/http" "os" "os/exec" "path" "strconv" "strings" "time" "gitlab.com/balki/ytui/db" "gitlab.com/balki/ytui/pubsub" "golang.org/x/net/websocket" ) //go:embed templates/index.html var page string //go:embed assets var assetsFS embed.FS var ( ytdlCmd = []string{"youtube-dl"} videosPath = "./vids" videosUrl = "/vids" cachePath = "./cache" assetsPath = "./assets" saveAssets = false dbPath = "./db.json" port = 8080 title = "Youtube Downloader" ) var d *db.Db func parse() { ytcmd := ytdlCmd[0] flag.StringVar(&ytcmd, "ytdlcmd", ytcmd, "youtube-dl command seperated by spaces") flag.StringVar(&title, "title", title, "Title of the page") flag.StringVar(&videosPath, "videospath", videosPath, "Path where videos are saved") flag.StringVar(&videosUrl, "videosurl", videosUrl, "Prefix of the url, i.e. https://domain.com//