cleanup
This commit is contained in:
parent
3d47c80446
commit
49f613ddeb
15 changed files with 98 additions and 234 deletions
|
@ -64,14 +64,19 @@ func PerformImgurImageSearch(query, safe, lang string, page int) ([]ImageSearchR
|
|||
width, _ := strconv.Atoi(s.Find("a img").AttrOr("width", "0"))
|
||||
height, _ := strconv.Atoi(s.Find("a img").AttrOr("height", "0"))
|
||||
|
||||
// Generate proxied URLs
|
||||
proxyFullURL := "/imgproxy?url=" + url.QueryEscape(imgSrc)
|
||||
proxyThumbURL := "/imgproxy?url=" + url.QueryEscape(thumbnailSrc)
|
||||
|
||||
results = append(results, ImageSearchResult{
|
||||
Thumbnail: thumbnailSrc,
|
||||
Thumb: thumbnailSrc,
|
||||
Title: strings.TrimSpace(title),
|
||||
Media: imgSrc,
|
||||
Full: imgSrc,
|
||||
Width: width,
|
||||
Height: height,
|
||||
Source: "https://imgur.com" + urlPath,
|
||||
ThumbProxy: imgSrc, //"/img_proxy?url=" + url.QueryEscape(imgSrc)
|
||||
ProxyFull: proxyFullURL,
|
||||
ProxyThumb: proxyThumbURL,
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue