From 0a08f62dfedb0e7ef9ebd887fb3f496652be0d31 Mon Sep 17 00:00:00 2001 From: Pijus Kamandulis Date: Thu, 9 Apr 2020 18:53:45 +0300 Subject: [PATCH] Fix lint issues --- README.md | 4 ++-- client/getRedirectUrl.go | 6 ++++-- models/config/config.go | 2 +- workflows/downloadShareLink.go | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a4c7bc3..f6f9e1b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # TikTok-DL [![Go Report Card](https://goreportcard.com/badge/github.com/pikami/tiktok-dl)](https://goreportcard.com/report/github.com/pikami/tiktok-dl) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pikami/tiktok-dl/tiktok-dl_CI) +[![tiktok-dl_CI](https://github.com/pikami/tiktok-dl/workflows/tiktok-dl_CI/badge.svg?branch=master)](https://github.com/pikami/tiktok-dl/actions) A simple tiktok video downloader written in go @@ -30,7 +30,7 @@ In the 2nd form, download all targets listed in given `BATCH_FILE`. * `-limit` - Sets the max count of video that will be downloaded (default infinity) * `-metadata` - Write video metadata to a .json file * `-output some_directory` - Output path (default "./downloads") -* `-quiet` - Supress output +* `-quiet` - Suppress output ## Build instructions 1. Clone this repository diff --git a/client/getRedirectUrl.go b/client/getRedirectUrl.go index d4b0738..c1ead3b 100644 --- a/client/getRedirectUrl.go +++ b/client/getRedirectUrl.go @@ -2,16 +2,18 @@ package client import ( "context" - "github.com/chromedp/chromedp" "io/ioutil" "os" "time" + "github.com/chromedp/chromedp" + config "../models/config" log "../utils/log" ) -func GetRedirectUrl(url string) (string, error) { +// GetRedirectURL - Returns URL that the given URL redirects to +func GetRedirectURL(url string) (string, error) { dir, err := ioutil.TempDir("", "chromedp-example") if err != nil { return "", err diff --git a/models/config/config.go b/models/config/config.go index 66ce415..174c5f2 100644 --- a/models/config/config.go +++ b/models/config/config.go @@ -29,7 +29,7 @@ func GetConfig() { failLogPath := flag.String("fail-log", "", "Write failed items to log file") debug := flag.Bool("debug", false, "Enables debug mode") metadata := flag.Bool("metadata", false, "Write video metadata to a .json file") - quiet := flag.Bool("quiet", false, "Supress output") + quiet := flag.Bool("quiet", false, "Suppress output") jsonOnly := flag.Bool("json", false, "Just get JSON data from scraper (without video downloading)") deadline := flag.Int("deadline", 1500, "Sets the timout for scraper logic in seconds (used as a workaround for 'context deadline exceeded' error)") limit := flag.Int("limit", 0, "Sets the videos count limit (useful when there too many videos from the user or by hashtag)") diff --git a/workflows/downloadShareLink.go b/workflows/downloadShareLink.go index 099035d..a674bc5 100644 --- a/workflows/downloadShareLink.go +++ b/workflows/downloadShareLink.go @@ -17,7 +17,7 @@ func CanUseDownloadShareLink(url string) bool { func DownloadShareLink(url string) { log.Logf("Resolving share link: %s\n", url) - finalURL, err := client.GetRedirectUrl(url) + finalURL, err := client.GetRedirectURL(url) if err != nil { OnWorkflowFail(err, url) return