MCPcopy
hub / github.com/simstudioai/sim / toDropboxDirectVideoUrl

Function toDropboxDirectVideoUrl

packages/utils/src/media-embed.ts:47–52  ·  view source on GitHub ↗

* Rewrite a Dropbox share URL's host to `dl.dropboxusercontent.com` so the file * streams as media, returning null for a non-video path. The caller has already * verified the host is Dropbox.

(parsed: URL)

Source from the content-addressed store, hash-verified

45 * verified the host is Dropbox.
46 */
47function toDropboxDirectVideoUrl(parsed: URL): string | null {
48 if (!/\.(mp4|mov|webm)$/i.test(parsed.pathname)) return null
49 parsed.hostname = 'dl.dropboxusercontent.com'
50 parsed.searchParams.delete('dl')
51 return parsed.toString()
52}
53
54/**
55 * Map a URL to its embeddable form across supported media platforms (YouTube,

Callers 1

getEmbedInfoFunction · 0.85

Calls 3

testMethod · 0.80
deleteMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected