More logging and dont dupe dl

This commit is contained in:
bel
2020-01-30 01:36:51 +00:00
parent e57d61d275
commit 1f14a2b147
7 changed files with 59 additions and 11 deletions

0
youtubedl/client.go Normal file → Executable file
View File

7
youtubedl/install.go Normal file → Executable file
View File

@@ -2,6 +2,7 @@ package youtubedl
import (
"errors"
"log"
"os/exec"
)
@@ -31,11 +32,15 @@ func installPyPip3() error {
[]string{"apt", "install", "python3", "pip3"},
[]string{"apk", "add", "python3", "py3-pip"},
[]string{"sudo", "apk", "add", "python3", "py3-pip"},
[]string{"/sbin/apk", "add", "python3", "py3-pip"},
[]string{"sudo", "/sbin/apk", "add", "python3", "py3-pip"},
} {
cmd := exec.Command(combo[0], combo[1:]...)
if err := cmd.Run(); err == nil {
err := cmd.Run()
if err == nil {
return nil
}
log.Println("%v: %v", err, combo)
}
return errors.New("cannot get python3 and pip3")
}