update dependencies

This commit is contained in:
Balakrishnan Balasubramanian 2023-02-08 14:52:34 -05:00
parent f71c53c7dd
commit 5cd9c89c69
3 changed files with 8 additions and 8 deletions

2
go.mod
View File

@ -2,4 +2,4 @@ module gitlab.com/balki/ytui
go 1.18 go 1.18
require golang.org/x/net v0.2.0 require golang.org/x/net v0.5.0

4
go.sum
View File

@ -1,2 +1,2 @@
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=

10
main.go
View File

@ -30,7 +30,7 @@ var assetsFS embed.FS
var ( var (
ytdlCmd = []string{"youtube-dl"} ytdlCmd = []string{"youtube-dl"}
videosPath = "./vids" videosPath = "./vids"
videosUrl = "/vids" videosURL = "/vids"
cachePath = "./cache" cachePath = "./cache"
assetsPath = "./assets" assetsPath = "./assets"
saveAssets = false saveAssets = false
@ -46,7 +46,7 @@ func parse() {
flag.StringVar(&ytcmd, "ytdlcmd", ytcmd, "youtube-dl command seperated by spaces") flag.StringVar(&ytcmd, "ytdlcmd", ytcmd, "youtube-dl command seperated by spaces")
flag.StringVar(&title, "title", title, "Title of the page") flag.StringVar(&title, "title", title, "Title of the page")
flag.StringVar(&videosPath, "videospath", videosPath, "Path where videos are saved") flag.StringVar(&videosPath, "videospath", videosPath, "Path where videos are saved")
flag.StringVar(&videosUrl, "videosurl", videosUrl, "Prefix of the url, i.e. https://domain.com/<this var>/<video filename>") flag.StringVar(&videosURL, "videosurl", videosURL, "Prefix of the url, i.e. https://domain.com/<this var>/<video filename>")
flag.StringVar(&cachePath, "cachepath", cachePath, "Path where temporary download files are saved") flag.StringVar(&cachePath, "cachepath", cachePath, "Path where temporary download files are saved")
flag.StringVar(&dbPath, "dbpath", dbPath, "Path where downloaded info is saved") flag.StringVar(&dbPath, "dbpath", dbPath, "Path where downloaded info is saved")
flag.StringVar(&assetsPath, "assetspath", assetsPath, "Path where css files are saved and served") flag.StringVar(&assetsPath, "assetspath", assetsPath, "Path where css files are saved and served")
@ -112,9 +112,9 @@ func main() {
case http.MethodGet: case http.MethodGet:
td := struct { td := struct {
Title string Title string
VidoesUrl string VidoesURL string
Items []db.Item Items []db.Item
}{title, videosUrl, nil} }{title, videosURL, nil}
d.Run(func(jd *db.Jdb) { d.Run(func(jd *db.Jdb) {
//reverse order //reverse order
for _, item := range jd.Items { for _, item := range jd.Items {
@ -153,7 +153,7 @@ func main() {
id, err := strconv.Atoi(idStr) id, err := strconv.Atoi(idStr)
if err != nil { if err != nil {
log.Printf("Invalid id, %q, err:%v\n", idStr, err) log.Printf("Invalid id, %q, err:%v\n", idStr, err)
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusNotFound)
return return
} }
var sc <-chan string var sc <-chan string