This commit is contained in:
partisan 2024-10-14 22:15:38 +02:00
parent 3d47c80446
commit 49f613ddeb
15 changed files with 98 additions and 234 deletions

View file

@ -68,13 +68,15 @@ func PerformBingImageSearch(query, safe, lang string, page int) ([]ImageSearchRe
mediaURL, ok := data["murl"].(string)
if ok {
// Apply the image proxy
proxiedURL := "/imgproxy?url=" + mediaURL
proxiedFullURL := "/imgproxy?url=" + imgSrc
proxiedThumbURL := "/imgproxy?url=" + mediaURL
results = append(results, ImageSearchResult{
Thumbnail: imgSrc,
Thumb: imgSrc,
Title: strings.TrimSpace(title),
Media: mediaURL,
Full: imgSrc,
Source: mediaURL,
ThumbProxy: proxiedURL, // Use the proxied URL
ProxyFull: proxiedFullURL, // Proxied full-size image URL
ProxyThumb: proxiedThumbURL, // Proxied thumbnail URL
Width: width,
Height: height,
})