2022-06-28 23:02:53 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
2022-07-18 19:21:06 -04:00
|
|
|
"strings"
|
2022-06-28 23:02:53 -04:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2022-07-18 19:21:06 -04:00
|
|
|
// Dummy tool to replace youtube-dl when testing
|
|
|
|
// Pass -ytdlcmd "go run cmd/dummytdl/main.go"
|
|
|
|
|
2022-06-28 23:02:53 -04:00
|
|
|
func main() {
|
|
|
|
var op string
|
|
|
|
var title string
|
|
|
|
flag.StringVar(&op, "output", "", "path to save file")
|
|
|
|
flag.StringVar(&title, "get-title", "", "title")
|
2022-07-18 19:21:06 -04:00
|
|
|
flag.Bool("newline", false, "print update as lines")
|
2022-06-28 23:02:53 -04:00
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
if title != "" {
|
2022-07-18 19:21:06 -04:00
|
|
|
time.Sleep(2 * time.Second)
|
2022-06-28 23:02:53 -04:00
|
|
|
fmt.Println("Dummy title")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-07-18 19:21:06 -04:00
|
|
|
op = fmt.Sprintf("%s.mp4", strings.TrimSuffix(op, ".%(ext)s"))
|
2022-06-28 23:02:53 -04:00
|
|
|
os.WriteFile(op, []byte("slkfjsdlkfdjkfj"), 0644)
|
|
|
|
i := 0
|
|
|
|
for range time.Tick(1 * time.Second) {
|
|
|
|
fmt.Printf("Hello msg %d\n", i)
|
|
|
|
i++
|
|
|
|
if i == 7 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|