Skip to content

Commit

Permalink
fix: use common output separators
Browse files Browse the repository at this point in the history
  • Loading branch information
biodrone committed Mar 30, 2024
1 parent 68529da commit ed427be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions download_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func downloadStream(user string, url string, outLoc string, moveLoc string, subfolder bool, control <-chan bool, response chan<- bool) {
naturalFinish := make(chan error, 1)
sigint := make(chan bool)
t := time.Now().Format("2006_01_02-15_04_05")
t := time.Now().Format("2006-01-02_15-04-05")
if subfolder {
outLoc = filepath.Join(outLoc, user)
os.MkdirAll(outLoc, os.ModePerm)
Expand All @@ -25,14 +25,14 @@ func downloadStream(user string, url string, outLoc string, moveLoc string, subf
}
log.Tracef("out: %s", outLoc)
log.Tracef("move: %s", moveLoc)
log.Tracef("full: %s", filepath.Join(outLoc, user+"-"+t+".mp4"))
log.Tracef("full: %s", filepath.Join(outLoc, user+"_"+t+".mp4"))
log.Tracef("Starting Download for %v", user)
buf := &bytes.Buffer{}
cmd := fluentffmpeg.
NewCommand("").
InputPath(url).
OutputFormat("mp4").
OutputPath(filepath.Join(outLoc, user+"-"+t+".mp4")).
OutputPath(filepath.Join(outLoc, user+"_"+t+".mp4")).
OutputLogs(buf).
Build()

Expand Down Expand Up @@ -64,8 +64,8 @@ func downloadStream(user string, url string, outLoc string, moveLoc string, subf
case <-naturalFinish:
log.Debugf("Stream For %v Ended", user)
log.Debugf("Moving file to %v", moveLoc)
oldPath := filepath.Join(outLoc, user+"-"+t+".mp4")
newPath := filepath.Join(moveLoc, user+"-"+t+".mp4")
oldPath := filepath.Join(outLoc, user+"_"+t+".mp4")
newPath := filepath.Join(moveLoc, user+"_"+t+".mp4")
err := moveFile(oldPath, newPath)
if err != nil {
log.Errorf("Failed to move file: %v", err)
Expand Down

0 comments on commit ed427be

Please sign in to comment.