Skip to content

Commit

Permalink
refactor the whole structure (#676)
Browse files Browse the repository at this point in the history
* refactor the whole structure

* tests: 🔧

* douyin: refactor

* tests: 🔧

* youtube: use github.com/mihaiav/ytdl instead

* tests: 🔧
  • Loading branch information
iawia002 authored May 9, 2020
1 parent 17ee7cc commit 424f8de
Show file tree
Hide file tree
Showing 77 changed files with 1,642 additions and 1,371 deletions.
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

0 comments on commit 424f8de

Please sign in to comment.