Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor the whole structure #676

Merged
merged 6 commits into from
May 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
run:
concurrency: 2
timeout: 5m

linter-settings:
goconst:
min-len: 2
min-occurrences: 2

linters:
enable:
- golint
- goconst
- gofmt
- goimports
- misspell
- unparam

issues:
exclude-use-default: false
exclude-rules:
- path: _test.go
linters:
- errcheck
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ language: go
go:
- "1.13.x"

before_install:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0

script:
- golangci-lint run
- ./go.test.sh

after_success:
Expand Down
57 changes: 0 additions & 57 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,62 +1,5 @@
package config

var (
// Debug debug mode
Debug bool
// Version show version
Version bool
// InfoOnly Information only mode
InfoOnly bool
// Cookie http cookies
Cookie string
// Playlist download playlist
Playlist bool
// Refer use specified Referrer
Refer string
// Stream select specified stream to download
Stream string
// OutputPath output file path
OutputPath string
// OutputName output file name
OutputName string
// ExtractedData print extracted data
ExtractedData bool
// ChunkSizeMB HTTP chunk size for downloading (in MB)
ChunkSizeMB int
// UseAria2RPC Use Aria2 RPC to download
UseAria2RPC bool
// Aria2Token Aria2 RPC Token
Aria2Token string
// Aria2Addr Aria2 Address (default "localhost:6800")
Aria2Addr string
// Aria2Method Aria2 Method (default "http")
Aria2Method string
// ThreadNumber The number of download thread (only works for multiple-parts video)
ThreadNumber int
// File URLs file path
File string
// ItemStart Define the starting item of a playlist or a file input
ItemStart int
// ItemEnd Define the ending item of a playlist or a file input
ItemEnd int
// Items Define wanted items from a file or playlist. Separated by commas like: 1,5,6,8-10
Items string
// File name of each bilibili episode doesn't include the playlist title
EpisodeTitleOnly bool
// Caption download captions
Caption bool
// YoukuCcode youku ccode
YoukuCcode string
// YoukuCkey youku ckey
YoukuCkey string
// YoukuPassword youku password
YoukuPassword string
// RetryTimes how many times to retry when the download failed
RetryTimes int

MultiThread bool
)

// FakeHeaders fake http headers
var FakeHeaders = map[string]string{
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
Expand Down
Loading