Aurora SpotiRip desktop and web app
- Spotify playlist, library, album and artist browsing with in-app playback - Song, playlist and album downloads via spotdl with YouTube and Bandcamp fallbacks - Electron desktop app (castLabs Widevine) with a permanent sidebar layout - Linux and Windows packaging scripts
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import superjson from "superjson";
|
||||
|
||||
export type OutputType = {
|
||||
status: "running" | "ready" | "failed";
|
||||
done: number;
|
||||
total: number;
|
||||
failed: number;
|
||||
currentTitle?: string;
|
||||
error?: string;
|
||||
fileName?: string;
|
||||
savedPath?: string;
|
||||
};
|
||||
|
||||
export async function getSpotifyDownloadStatus(jobId: string): Promise<OutputType> {
|
||||
const response = await fetch(`/_api/spotify-download-status?jobId=${encodeURIComponent(jobId)}`, {
|
||||
cache: "no-store",
|
||||
});
|
||||
if (!response.ok) {
|
||||
const parsed = (await response.json().catch(() => ({}))) as { error?: string };
|
||||
throw new Error(parsed.error || "Unable to check the download.");
|
||||
}
|
||||
return superjson.parse<OutputType>(await response.text());
|
||||
}
|
||||
|
||||
export function spotifyDownloadFileUrl(jobId: string) {
|
||||
return `/_api/spotify-download-file?jobId=${encodeURIComponent(jobId)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user