Skip to content

Commit

Permalink
修改部分参数的传值逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
mingcheng committed Mar 22, 2021
1 parent 5e80389 commit 63d3448
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.go
Expand Up @@ -49,25 +49,24 @@ type VideoQuality struct {
func main() {
// Print credits
fmt.Println()
fmt.Println("| --- PornHub Downloader created by festie ---")
fmt.Println("| GitHub: https://github.com/mingcheng/pornhub-dl")
fmt.Println("| --- PornHub Downloader created by mingcheng(based on festie's code) ---")
fmt.Println("| GitHub: https://github.com/festie/pornhub-dl https://github.com/mingcheng/pornhub-dl")
fmt.Println("| --------------------------------------------")
fmt.Println()

// Define flags and parse them
urlPtr := flag.String("url", "empty", "URL of the video to download")
qualityPtr := flag.String("quality", "highest", "The quality number (eg. 720) or 'highest'")
outputPtr := flag.String("output", "default", "Path to where the download should be saved or 'default' for the original filename")
debugPtr := flag.Bool("debug", false, "Whether you want to activate debug mode or not")
threadsPtr := flag.Int("threads", 5, "The amount of threads to use to download")
flag.BoolVar(&debugMode, "debug", false, "Whether you want to activate debug mode or not")
flag.StringVar(&socks5, "socks5", "", "Specify socks5 proxy address for downloading resources")
flag.Parse()

// Assign variables to flag values
url := *urlPtr
quality := *qualityPtr
outputPath := *outputPtr
debugMode = *debugPtr
threads = *threadsPtr

// Check if parameters are set
Expand Down

0 comments on commit 63d3448

Please sign in to comment.