From 154c6a31b97c339fd5586086eb6572c77ae34e14 Mon Sep 17 00:00:00 2001 From: r4 Date: Sat, 1 Oct 2022 19:59:34 +0200 Subject: [PATCH] fix error check --- extractor/youtube/youtube_decrypt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extractor/youtube/youtube_decrypt.go b/extractor/youtube/youtube_decrypt.go index ca31910..308dc22 100644 --- a/extractor/youtube/youtube_decrypt.go +++ b/extractor/youtube/youtube_decrypt.go @@ -140,7 +140,7 @@ func getDecryptFunction(baseJs string) (string, error) { } fn := baseJs[start+len(startMatch):] end := strings.Index(fn, endMatch) - if start == -1 { + if end == -1 { return "", ErrDecryptGettingFunction } return fn[:end], nil @@ -170,7 +170,7 @@ func getDecryptOps(baseJs string) ([]decryptorOp, error) { } ops = baseJs[start+len(startMatch):] end := strings.Index(ops, endMatch) - if start == -1 { + if end == -1 { return nil, ErrDecryptGettingOpTable } ops = ops[:end]