ytui/cmd/dummytdl/main.go
balki 8c85e5f005 Cleanup
* Modernize java-script
* Add CSP meta tag
* Minor refactor
* Add Makefile to update bootstrap css
* Fix filename in dummytdl tool
2022-07-18 19:26:44 -04:00

39 lines
710 B
Go

package main
import (
"flag"
"fmt"
"os"
"strings"
"time"
)
// Dummy tool to replace youtube-dl when testing
// Pass -ytdlcmd "go run cmd/dummytdl/main.go"
func main() {
var op string
var title string
flag.StringVar(&op, "output", "", "path to save file")
flag.StringVar(&title, "get-title", "", "title")
flag.Bool("newline", false, "print update as lines")
flag.Parse()
if title != "" {
time.Sleep(2 * time.Second)
fmt.Println("Dummy title")
return
}
op = fmt.Sprintf("%s.mp4", strings.TrimSuffix(op, ".%(ext)s"))
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
}
}
}