test via manual and $TEST
parent
71588dee79
commit
d256ad7916
|
|
@ -3,6 +3,7 @@ package youtubedl
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
)
|
)
|
||||||
|
|
@ -15,6 +16,10 @@ func New() (*Client, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Download(video, local string) error {
|
func (c *Client) Download(video, local string) error {
|
||||||
|
if _, ok := os.LookupEnv("TEST"); ok {
|
||||||
|
log.Println("youtube-dl download", video, local)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
errs := []error{}
|
errs := []error{}
|
||||||
for _, extras := range [][]string{
|
for _, extras := range [][]string{
|
||||||
[]string{"--add-metadata", "--metadata-from-title", ".*[0-9]/[0-9][0-9] (?P<title>.+)"},
|
[]string{"--add-metadata", "--metadata-from-title", ".*[0-9]/[0-9][0-9] (?P<title>.+)"},
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,14 @@ package youtubedl
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func install() error {
|
func install() error {
|
||||||
|
if _, ok := os.LookupEnv("TEST"); ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if err := installPyPip3FFMPEG(); err != nil {
|
if err := installPyPip3FFMPEG(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue