Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ processes = []
PORT = "8080"
ROOT_URL = "https://kable.ca"
MUSIC_DOWNLOAD_PATH = "/data/music"
YTDLP_BIN = "/data/bin/yt-dlp"
YTDLP_EXECUTABLE = "/data/bin/yt-dlp"
YTDLP_COOKIES_FILE = "/data/cookies.txt"

[experimental]
Expand Down
12 changes: 3 additions & 9 deletions handlers/fun/music/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,13 @@ func slugify(title, uploader string) string {
}

func (s *service) runDownload(id, url string, userID int64) error {
fmt.Println("DEBUGX dzDG 0")

ctx := context.TODO()

cmd := os.Getenv("YTDLP_EXECUTABLE")
if cmd == "" {
return fmt.Errorf("YTDLP_EXECUTABLE not set")
}

fmt.Println("DEBUGX QtjQ 1")

dl := ytdlp.New().
SetExecutable(cmd).
FormatSort("res,ext:mp4:m4a").
Expand All @@ -224,7 +220,6 @@ func (s *service) runDownload(id, url string, userID int64) error {
if err != nil {
return err
}
fmt.Println("DEBUGX XrvK 2")

title := ""
uploader := ""
Expand All @@ -248,7 +243,6 @@ func (s *service) runDownload(id, url string, userID int64) error {
Status: "done",
})

fmt.Println("DEBUGX dza7 4")
return nil
}

Expand All @@ -268,7 +262,7 @@ func (s *service) musicPage(userID int64) g.Node {
g.Attr("hx-post", "/fun/music/download"),
g.Attr("hx-target", "#downloads"),
g.Attr("hx-swap", "innerHTML"),
g.Attr("hx-on::after-request", "this.reset()"),
g.Attr("hx-on::config-request", "this.reset()"),
h.Div(
h.Style("display:flex; gap:0.5rem"),
h.Input(
Expand Down Expand Up @@ -355,7 +349,7 @@ func (s *service) downloadsList(userID int64) g.Node {

func downloadingRow(id, url string) g.Node {
return h.Div(
h.Class("nes-container"),
h.Class("nes-container ghost"),
h.Style("margin-bottom:0.5rem"),
g.Attr("hx-get", "/fun/music/status?id="+id),
g.Attr("hx-trigger", "every 2s"),
Expand Down Expand Up @@ -387,7 +381,7 @@ func trackRow(t api.MusicTrack) g.Node {
uploader = "—"
}
return h.Div(
h.Class("nes-container"),
h.Class("nes-container ghost"),
h.Style("margin-bottom:0.5rem"),
h.Div(
h.Style("display:flex; align-items:center; gap:0.75rem"),
Expand Down
Loading