Skip to content

Commit

Permalink
Make linter happier
Browse files Browse the repository at this point in the history
  • Loading branch information
corny committed Feb 20, 2025
1 parent 1824d3f commit 2af31d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
playerParams = "CgIQBg=="
)

const CONTENT_PLAYBACK_NONCE_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
const ContentPlaybackNonceAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"

var ErrNoFormat = errors.New("no video format provided")

Expand Down Expand Up @@ -257,11 +257,11 @@ func randomVisitorData(countryCode string) string {
pbE.Bytes(2, pbE2.ToBytes())

Check failure on line 257 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pbE.Bytes` is not checked (errcheck)

Check failure on line 257 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pbE.Bytes` is not checked (errcheck)

Check failure on line 257 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pbE.Bytes` is not checked (errcheck)

Check failure on line 257 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pbE.Bytes` is not checked (errcheck)

var pb ProtoBuilder
pb.String(1, randString(CONTENT_PLAYBACK_NONCE_ALPHABET, 11))
pb.String(1, randString(ContentPlaybackNonceAlphabet, 11))

Check failure on line 260 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.String` is not checked (errcheck)

Check failure on line 260 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.String` is not checked (errcheck)

Check failure on line 260 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.String` is not checked (errcheck)

Check failure on line 260 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.String` is not checked (errcheck)
pb.Varint(5, time.Now().Unix()-int64(rand.Intn(600000)))

Check failure on line 261 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.Varint` is not checked (errcheck)

Check failure on line 261 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.Varint` is not checked (errcheck)

Check failure on line 261 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.Varint` is not checked (errcheck)

Check failure on line 261 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.Varint` is not checked (errcheck)
pb.Bytes(6, pbE.ToBytes())

Check failure on line 262 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.Bytes` is not checked (errcheck)

Check failure on line 262 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.Bytes` is not checked (errcheck)

Check failure on line 262 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.Bytes` is not checked (errcheck)

Check failure on line 262 in client.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.Bytes` is not checked (errcheck)

return pb.ToUrlEncodedBase64()
return pb.ToURLEncodedBase64()
}

func prepareInnertubeContext(clientInfo clientInfo) inntertubeContext {
Expand Down
2 changes: 1 addition & 1 deletion protobuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (pb *ProtoBuilder) ToBytes() []byte {
return pb.byteBuffer.Bytes()
}

func (pb *ProtoBuilder) ToUrlEncodedBase64() string {
func (pb *ProtoBuilder) ToURLEncodedBase64() string {
b64 := base64.URLEncoding.EncodeToString(pb.ToBytes())
return url.QueryEscape(b64)
}
Expand Down
2 changes: 1 addition & 1 deletion protobuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ func TestProtoBuilder(t *testing.T) {
pb.Varint(3, 1234567890123456789)
pb.String(4, "Hello")

Check failure on line 15 in protobuilder_test.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.String` is not checked (errcheck)

Check failure on line 15 in protobuilder_test.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.String` is not checked (errcheck)

Check failure on line 15 in protobuilder_test.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.23.x)

Error return value of `pb.String` is not checked (errcheck)

Check failure on line 15 in protobuilder_test.go

View workflow job for this annotation

GitHub Actions / Linters (Static Analysis) for Go (ubuntu-22.04, 1.x)

Error return value of `pb.String` is not checked (errcheck)
pb.Bytes(5, []byte{1, 2, 3})
assert.Equal(t, "CIABENKF2MwEGJWCpu_HnoSRESIFSGVsbG8qAwECAw%3D%3D", pb.ToUrlEncodedBase64())
assert.Equal(t, "CIABENKF2MwEGJWCpu_HnoSRESIFSGVsbG8qAwECAw%3D%3D", pb.ToURLEncodedBase64())
}
2 changes: 1 addition & 1 deletion video.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var playerResponsePattern = regexp.MustCompile(`var ytInitialPlayerResponse\s*=\

func (v *Video) parseVideoPage(body []byte) error {
initialPlayerResponse := playerResponsePattern.FindSubmatch(body)
if initialPlayerResponse == nil || len(initialPlayerResponse) < 2 {
if len(initialPlayerResponse) < 2 {
return errors.New("no ytInitialPlayerResponse found in the server's answer")
}

Expand Down

0 comments on commit 2af31d4

Please sign in to comment.