Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

Log Stderr on failure #4

Merged
merged 1 commit into from
Jan 23, 2021
Merged
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
5 changes: 5 additions & 0 deletions hlstube.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func (h *HLSTube) handler(w http.ResponseWriter, r *http.Request) {
log.Printf("setting up a stream for %s\n", u.String())
m3u, err := exec.Command("youtube-dl", "--format", format, u.String(), "-g").Output()
if err != nil {
if exiterr, ok := err.(*exec.ExitError); ok {
log.Printf(string(exiterr.Stderr))
err500(w, r, exiterr)
return
}
err500(w, r, err)
return
}
Expand Down