Sync layouts, typography, and watermark studio for self-hosted OSS.

Unlock features without credits/Stripe, point docs to docs.songs2vid.com, and drop leftover billing admin surfaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Songs2YT
2026-07-25 03:50:06 +02:00
co-authored by Cursor
parent bcca0a6e6f
commit d951ecb489
53 changed files with 3258 additions and 1977 deletions
+6 -5
View File
@@ -1,12 +1,13 @@
import { NextResponse } from "next/server";
import { API_DOCS_URL } from "@/lib/plans";
export async function GET() {
return NextResponse.json({
name: "Songs2YT API",
name: "Songs2VID API",
version: "1.0",
authentication: "Authorization: Bearer <api_key>",
requirements: ["Pro subscription", "YouTube account connected"],
rateLimit: "60 requests per minute per account (plus any approved bonus)",
requirements: ["Self-hosted edition", "YouTube account connected"],
rateLimit: "Generous self-hosted limits (see docs)",
guidance: {
recommended:
"For most jobs (especially 5+ audio files): POST /api/v1/upload per file, then POST /api/v1/jobs with the returned paths",
@@ -36,7 +37,7 @@ export async function GET() {
{
method: "GET",
path: "/api/v1/playlists",
description: "List YouTube playlists for the authenticated Pro account",
description: "List YouTube playlists for the authenticated account",
},
{
method: "POST",
@@ -56,6 +57,6 @@ export async function GET() {
description: "Get job status and item details",
},
],
docs: "/dashboard/api-docs",
docs: API_DOCS_URL,
});
}
+12 -4
View File
@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { requirePaidApiUser } from "@/lib/api-auth";
import { saveUploadedFile } from "@/lib/jobs/create-job";
import { PremiumRequiredError, premiumRequiredResponse } from "@/lib/entitlements";
import { saveUploadedFile, type UploadFileType } from "@/lib/jobs/create-job";
export const maxDuration = 120;
@@ -12,17 +13,24 @@ export async function POST(req: NextRequest) {
const file = formData.get("file") as File | null;
const type = formData.get("type") as string | null;
if (!file || !type || (type !== "image" && type !== "audio")) {
if (
!file ||
!type ||
(type !== "image" && type !== "audio" && type !== "logo" && type !== "font")
) {
return NextResponse.json(
{ error: "Provide multipart fields: file, type (image|audio)" },
{ error: "Provide multipart fields: file, type (image|audio|logo|font)" },
{ status: 400 },
);
}
try {
const result = await saveUploadedFile(user.id, file, type, user.plan);
const result = await saveUploadedFile(user.id, file, type as UploadFileType, user.plan);
return NextResponse.json(result);
} catch (err) {
if (err instanceof PremiumRequiredError) {
return NextResponse.json(premiumRequiredResponse(err.message), { status: 403 });
}
const message = err instanceof Error ? err.message : "Upload failed";
return NextResponse.json({ error: message }, { status: 400 });
}