export type GetApiScrapecreatorsV1YoutubeVideoArgs = {url: string}; export type GetApiScrapecreatorsV1YoutubeVideoOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Video/Short Details * * GET /scrapecreators/v1/youtube/video */ export const getApiScrapecreatorsV1YoutubeVideo = async (args: GetApiScrapecreatorsV1YoutubeVideoArgs, options?: GetApiScrapecreatorsV1YoutubeVideoOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.url != null) query.append("url", String(args.url)) const url = `${baseUrl.replace(/\/+$/, '')}/scrapecreators/v1/youtube/video${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };