mirror of
https://github.com/pikami/tiktok-dl.git
synced 2024-11-26 01:35:42 +00:00
29 lines
479 B
Go
29 lines
479 B
Go
|
package models
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
// Config - Runtime configuration
|
||
|
var Config struct {
|
||
|
UserName string
|
||
|
OutputPath string
|
||
|
}
|
||
|
|
||
|
// GetConfig - Returns Config object
|
||
|
func GetConfig() {
|
||
|
outputPath := flag.String("output", "./downloads", "Output path")
|
||
|
flag.Parse()
|
||
|
|
||
|
args := flag.Args()
|
||
|
if len(args) < 1 {
|
||
|
fmt.Println("Usage: tiktok-dl [OPTIONS] TIKTOK_USERNAME")
|
||
|
os.Exit(2)
|
||
|
}
|
||
|
|
||
|
Config.UserName = flag.Args()[len(args)-1]
|
||
|
Config.OutputPath = *outputPath
|
||
|
}
|