diff --git a/index.html b/index.html index 1796142..45f3e59 100644 --- a/index.html +++ b/index.html @@ -320,9 +320,10 @@ return; } gifGrid.innerHTML = results.map(gif => { - // Use the actual media URL, not the Tenor page URL - const thumbUrl = gif.media_formats?.tinygif?.url || gif.media_formats?.gif?.url || gif.url; - const fullUrl = gif.media_formats?.gif?.url || thumbUrl; + // Klipy format: file=hd, md=medium, sm=small, xs=tiny + const sizes = gif.file?.gif?.url ? gif.file : (gif.md || gif.sm || gif.xs || {}); + const thumbUrl = sizes?.gif?.url || gif.sm?.gif?.url || gif.xs?.gif?.url || ''; + const fullUrl = gif.file?.gif?.url || gif.md?.gif?.url || thumbUrl; return `gif`; }).join('');