/* * Vencord, a Discord client mod * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { execFile } from "child_process"; import { promisify } from "util"; import type { TrackData } from "."; const exec = promisify(execFile); async function applescript(cmds: string[]) { const { stdout } = await exec("osascript", cmds.map(c => ["-e", c]).flat()); return stdout; } interface RemoteData { appleMusicLink?: string, songLink?: string, albumArtwork?: string, artistArtwork?: string; } let cachedRemoteData: { id: string, data: RemoteData; } | { id: string, failures: number; } | null = null; const APPLE_MUSIC_BUNDLE_REGEX = /