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

Function fetchVideoName

apps/web/actions/loom.ts:179–208  ·  view source on GitHub ↗
(videoId: string)

Source from the content-addressed store, hash-verified

177}
178
179async function fetchVideoName(videoId: string): Promise<string | null> {
180 try {
181 const response = await fetch("https://www.loom.com/graphql", {
182 method: "POST",
183 headers: {
184 "Content-Type": "application/json",
185 Accept: "application/json",
186 "x-loom-request-source": "loom_web",
187 },
188 body: JSON.stringify({
189 operationName: "GetVideoName",
190 variables: { videoId, password: null },
191 query: `query GetVideoName($videoId: ID!, $password: String) {
192 getVideo(id: $videoId, password: $password) {
193 ... on RegularUserVideo { name }
194 ... on PrivateVideo { id }
195 ... on VideoPasswordMissingOrIncorrect { id }
196 }
197 }`,
198 }),
199 });
200
201 if (!response.ok) return null;
202
203 const data = await response.json();
204 return data?.data?.getVideo?.name ?? null;
205 } catch {
206 return null;
207 }
208}
209
210function isStreamingUrl(url: string): boolean {
211 const path = (url.split("?")[0] ?? "").toLowerCase();

Callers 2

downloadLoomVideoFunction · 0.70
importLoomVideoForOwnerFunction · 0.70

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected