[APP-2066] Migrate from Tenor to KLIPY (#10240)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Spence Pope
2026-04-17 08:43:13 -04:00
committed by GitHub
parent a97b15b204
commit a77b6e3525
12 changed files with 411 additions and 50 deletions
+4 -1
View File
@@ -26,6 +26,7 @@ import {type DraftPostDisplay, type DraftSummary} from './schema'
import * as storage from './storage'
const TENOR_HOSTNAME = 'media.tenor.com'
const KLIPY_HOSTNAME = 'static.klipy.com'
/**
* Video data from a draft that needs to be restored by re-processing.
@@ -379,7 +380,7 @@ function parseGifFromUrl(
): {url: string; width: number; height: number; alt: string} | undefined {
try {
const url = new URL(uri)
if (url.hostname !== TENOR_HOSTNAME) {
if (url.hostname !== TENOR_HOSTNAME && url.hostname !== KLIPY_HOSTNAME) {
return undefined
}
@@ -396,6 +397,8 @@ function parseGifFromUrl(
url.searchParams.delete('ww')
url.searchParams.delete('hh')
url.searchParams.delete('alt')
url.searchParams.delete('mp4')
url.searchParams.delete('webm')
return {url: url.toString(), width, height, alt}
} catch {