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 const port = 8080 var ( ytdlCmd = []string{"youtube-dl"} videosPath = "./vids" videosUrl = "/vids" cachePath = "./cache" dbPath = "./db.json" ) var d *db.Db func parse() { ytcmd := ytdlCmd[0] flag.StringVar(&ytcmd, "ytdlcmd", ytcmd, "youtube-dl command seperated by spaces") flag.StringVar(&videosPath, "videospath", videosPath, "Path where videos are saved") flag.StringVar(&videosUrl, "videosurl", videosUrl, "Prefix of the url, i.e. https://domain.com//