mirror of
https://github.com/pikami/tiktok-dl.git
synced 2024-11-25 09:15:41 +00:00
Added debug option
This commit is contained in:
parent
2b56584b1b
commit
38c23fd9f5
@ -23,7 +23,7 @@ func GetUserUploads(username string) []models.Upload {
|
|||||||
opts := append(chromedp.DefaultExecAllocatorOptions[:],
|
opts := append(chromedp.DefaultExecAllocatorOptions[:],
|
||||||
chromedp.DisableGPU,
|
chromedp.DisableGPU,
|
||||||
chromedp.UserDataDir(dir),
|
chromedp.UserDataDir(dir),
|
||||||
chromedp.Flag("headless", false),
|
chromedp.Flag("headless", models.Config.UserName),
|
||||||
)
|
)
|
||||||
|
|
||||||
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
||||||
|
1
main.go
1
main.go
@ -25,6 +25,7 @@ func main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("Downloading upload item '" + uploadID + "' to " + downloadPath)
|
||||||
utils.DownloadFile(downloadPath, upload.URL)
|
utils.DownloadFile(downloadPath, upload.URL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,13 @@ import (
|
|||||||
var Config struct {
|
var Config struct {
|
||||||
UserName string
|
UserName string
|
||||||
OutputPath string
|
OutputPath string
|
||||||
|
Debug bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetConfig - Returns Config object
|
// GetConfig - Returns Config object
|
||||||
func GetConfig() {
|
func GetConfig() {
|
||||||
outputPath := flag.String("output", "./downloads", "Output path")
|
outputPath := flag.String("output", "./downloads", "Output path")
|
||||||
|
debug := flag.Bool("debug", false, "enables debug mode")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
@ -25,4 +27,5 @@ func GetConfig() {
|
|||||||
|
|
||||||
Config.UserName = flag.Args()[len(args)-1]
|
Config.UserName = flag.Args()[len(args)-1]
|
||||||
Config.OutputPath = *outputPath
|
Config.OutputPath = *outputPath
|
||||||
|
Config.Debug = *debug
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user