MCPcopy
hub / github.com/CapSoftware/Cap / getLoomDownloadUrl

Function getLoomDownloadUrl

apps/web/actions/loom.ts:220–240  ·  view source on GitHub ↗
(loomVideoId: string)

Source from the content-addressed store, hash-verified

218}
219
220async function getLoomDownloadUrl(loomVideoId: string): Promise<string | null> {
221 const requestVariants: Array<{ endpoint: string; includeBody: boolean }> = [
222 { endpoint: "transcoded-url", includeBody: true },
223 { endpoint: "raw-url", includeBody: true },
224 { endpoint: "transcoded-url", includeBody: false },
225 { endpoint: "raw-url", includeBody: false },
226 ];
227
228 let fallbackStreamingUrl: string | null = null;
229
230 for (const { endpoint, includeBody } of requestVariants) {
231 const url = await fetchLoomEndpoint(loomVideoId, endpoint, includeBody);
232 if (!url) continue;
233
234 if (!isStreamingUrl(url)) return url;
235
236 if (!fallbackStreamingUrl) fallbackStreamingUrl = url;
237 }
238
239 return fallbackStreamingUrl;
240}
241
242async function fetchLoomOEmbed(
243 loomVideoId: string,

Callers 2

downloadLoomVideoFunction · 0.70
importLoomVideoForOwnerFunction · 0.70

Calls 2

fetchLoomEndpointFunction · 0.70
isStreamingUrlFunction · 0.70

Tested by

no test coverage detected