code cleanup & fixed compatibility for non-JS users & fixed fullscreen images being in low resolution
This commit is contained in:
parent
0d083f53e7
commit
db89f9c781
13 changed files with 474 additions and 300 deletions
|
@ -64,19 +64,13 @@ 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{
|
||||
Thumb: thumbnailSrc,
|
||||
Title: strings.TrimSpace(title),
|
||||
Full: imgSrc,
|
||||
Width: width,
|
||||
Height: height,
|
||||
Source: "https://imgur.com" + urlPath,
|
||||
ProxyFull: proxyFullURL,
|
||||
ProxyThumb: proxyThumbURL,
|
||||
Thumb: thumbnailSrc,
|
||||
Title: strings.TrimSpace(title),
|
||||
Full: imgSrc,
|
||||
Width: width,
|
||||
Height: height,
|
||||
Source: "https://imgur.com" + urlPath,
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue