fix: use linkFirst instead of empty string link
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
12b3da09ac
commit
e6c2f91a84
@ -2,7 +2,6 @@ package ytlinkprov
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
@ -85,7 +84,7 @@ func getRemoteLink(id string) (string, error) {
|
|||||||
linkFirst := strings.Split(ytRes.Stdout, "\n")[0]
|
linkFirst := strings.Split(ytRes.Stdout, "\n")[0]
|
||||||
|
|
||||||
/* Get the last link in a chain of 3XX codes*/
|
/* Get the last link in a chain of 3XX codes*/
|
||||||
resp, err := http.Get(link)
|
resp, err := http.Get(linkFirst)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user