Skip to content

Commit 424f8de

Browse files
authored
refactor the whole structure (iawia002#676)
* refactor the whole structure * tests: πŸ”§ * douyin: refactor * tests: πŸ”§ * youtube: use github.com/mihaiav/ytdl instead * tests: πŸ”§
1 parent 17ee7cc commit 424f8de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1642
-1371
lines changed

β€Ž.golangci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
run:
2+
concurrency: 2
3+
timeout: 5m
4+
5+
linter-settings:
6+
goconst:
7+
min-len: 2
8+
min-occurrences: 2
9+
10+
linters:
11+
enable:
12+
- golint
13+
- goconst
14+
- gofmt
15+
- goimports
16+
- misspell
17+
- unparam
18+
19+
issues:
20+
exclude-use-default: false
21+
exclude-rules:
22+
- path: _test.go
23+
linters:
24+
- errcheck

β€Ž.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ language: go
66
go:
77
- "1.13.x"
88

9+
before_install:
10+
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
11+
912
script:
13+
- golangci-lint run
1014
- ./go.test.sh
1115

1216
after_success:

β€Žconfig/config.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,5 @@
11
package config
22

3-
var (
4-
// Debug debug mode
5-
Debug bool
6-
// Version show version
7-
Version bool
8-
// InfoOnly Information only mode
9-
InfoOnly bool
10-
// Cookie http cookies
11-
Cookie string
12-
// Playlist download playlist
13-
Playlist bool
14-
// Refer use specified Referrer
15-
Refer string
16-
// Stream select specified stream to download
17-
Stream string
18-
// OutputPath output file path
19-
OutputPath string
20-
// OutputName output file name
21-
OutputName string
22-
// ExtractedData print extracted data
23-
ExtractedData bool
24-
// ChunkSizeMB HTTP chunk size for downloading (in MB)
25-
ChunkSizeMB int
26-
// UseAria2RPC Use Aria2 RPC to download
27-
UseAria2RPC bool
28-
// Aria2Token Aria2 RPC Token
29-
Aria2Token string
30-
// Aria2Addr Aria2 Address (default "localhost:6800")
31-
Aria2Addr string
32-
// Aria2Method Aria2 Method (default "http")
33-
Aria2Method string
34-
// ThreadNumber The number of download thread (only works for multiple-parts video)
35-
ThreadNumber int
36-
// File URLs file path
37-
File string
38-
// ItemStart Define the starting item of a playlist or a file input
39-
ItemStart int
40-
// ItemEnd Define the ending item of a playlist or a file input
41-
ItemEnd int
42-
// Items Define wanted items from a file or playlist. Separated by commas like: 1,5,6,8-10
43-
Items string
44-
// File name of each bilibili episode doesn't include the playlist title
45-
EpisodeTitleOnly bool
46-
// Caption download captions
47-
Caption bool
48-
// YoukuCcode youku ccode
49-
YoukuCcode string
50-
// YoukuCkey youku ckey
51-
YoukuCkey string
52-
// YoukuPassword youku password
53-
YoukuPassword string
54-
// RetryTimes how many times to retry when the download failed
55-
RetryTimes int
56-
57-
MultiThread bool
58-
)
59-
603
// FakeHeaders fake http headers
614
var FakeHeaders = map[string]string{
625
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",

0 commit comments

Comments
Β (0)