export type GetApiScrapecreatorsV1TwitchClipArgs = {url: string}; export type GetApiScrapecreatorsV1TwitchClipOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Clip * * GET /scrapecreators/v1/twitch/clip */ export const getApiScrapecreatorsV1TwitchClip = async (args: GetApiScrapecreatorsV1TwitchClipArgs, options?: GetApiScrapecreatorsV1TwitchClipOptions) => { 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/twitch/clip${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 };