fix thumbnail download

This commit is contained in:
Niko Storni 2020-08-06 23:53:03 +02:00
parent 5d230a6b54
commit b7037900f8

View file

@ -4,6 +4,7 @@ import (
"io" "io"
"net/http" "net/http"
"os" "os"
"strings"
"github.com/lbryio/ytsync/v5/downloader/ytdl" "github.com/lbryio/ytsync/v5/downloader/ytdl"
@ -32,7 +33,9 @@ func (u *thumbnailUploader) downloadThumbnail() error {
return errors.Err(err) return errors.Err(err)
} }
defer img.Close() defer img.Close()
if strings.HasPrefix(u.originalUrl, "//") {
u.originalUrl = "https:" + u.originalUrl
}
resp, err := http.Get(u.originalUrl) resp, err := http.Get(u.originalUrl)
if err != nil { if err != nil {
return errors.Err(err) return errors.Err(err)