add new youtubedl dependency
This commit is contained in:
27
downloader/vendor/github.com/kkdai/youtube/v2/decipher_operations.go
generated
vendored
Normal file
27
downloader/vendor/github.com/kkdai/youtube/v2/decipher_operations.go
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package youtube
|
||||
|
||||
type DecipherOperation func([]byte) []byte
|
||||
|
||||
func newSpliceFunc(pos int) DecipherOperation {
|
||||
return func(bs []byte) []byte {
|
||||
return bs[pos:]
|
||||
}
|
||||
}
|
||||
|
||||
func newSwapFunc(arg int) DecipherOperation {
|
||||
return func(bs []byte) []byte {
|
||||
pos := arg % len(bs)
|
||||
bs[0], bs[pos] = bs[pos], bs[0]
|
||||
return bs
|
||||
}
|
||||
}
|
||||
|
||||
func reverseFunc(bs []byte) []byte {
|
||||
l, r := 0, len(bs)-1
|
||||
for l < r {
|
||||
bs[l], bs[r] = bs[r], bs[l]
|
||||
l++
|
||||
r--
|
||||
}
|
||||
return bs
|
||||
}
|
||||
Reference in New Issue
Block a user