Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit b63e449

Browse files
author
Bash06
committed
fix: redundant variables in url extraction
1 parent de81289 commit b63e449

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

utils/extractUrl.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,17 @@ const (
3030

3131
// Extracts the video URL from response
3232
func ExtractUrl(s string) (string, bool) {
33-
pref := prefix
34-
qt := quote
35-
len := prefixLen
36-
3733
// Thanks a lot for this tyler
3834
// Find the first prefix
39-
startIdx := strings.Index(s, pref)
35+
startIdx := strings.Index(s, prefix)
4036
if startIdx == -1 {
4137
return "", false
4238
}
4339

4440
// Offset start by prefix len
45-
start := startIdx + len
41+
start := startIdx + prefixLen
4642

47-
end := strings.Index(s[start:], qt)
43+
end := strings.Index(s[start:], quote)
4844
if end == -1 {
4945
return "", false
5046
}

0 commit comments

Comments
 (0)