Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #46 from gazes-media/main
Browse files Browse the repository at this point in the history
Just minor update
  • Loading branch information
garder500 authored Dec 5, 2023
2 parents ce646e7 + 5f826d0 commit 5781d62
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions routes/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"os"
"os/exec"
"strconv"
"strings"
)

func DownloadHandler(w http.ResponseWriter, r *http.Request, id, ep string, cache *functions.Cache) {
Expand Down Expand Up @@ -81,12 +80,9 @@ func downloadEpisode(episode EpisodeJson, cache *functions.Cache) (string, error
scanner := bufio.NewScanner(stderr)
cache.Set(episodeName, "downloading")
for scanner.Scan() {
m := scanner.Text()
if strings.Contains(m, "kbits/s speed=") {
cache.Set(episodeName, episodeName+".mp4")
fmt.Println("Downloaded " + episodeName)
}
}
cache.Set(episodeName, episodeName+".mp4")
fmt.Println("Downloaded " + episodeName)
if err := cmd.Wait(); err != nil {
return "", err
}
Expand Down

0 comments on commit 5781d62

Please sign in to comment.