main
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-04-25 14:37:46 +02:00
parent ad5a97a4fd
commit 9d8c34b39d
34 changed files with 5853 additions and 164 deletions
+57 -8
View File
@@ -298,11 +298,11 @@ This is CRITICAL. All scenes in one project must feel like they belong to the sa
Match the "videoStyle" to its corresponding visual DNA. These are your default creative parameters per style:
CINEMATIC:
Reference: Denis Villeneuve, Roger Deakins cinematography, Christopher Nolan IMAX
Reference: High-end cinematic production with professional cinematography techniques
Lighting: Dramatic key-and-fill, single strong motivated source, deep shadows
Lens: 35mm anamorphic or 65mm IMAX, shallow DOF
Color: Teal-orange grade, desaturated midtones, crushed blacks
Texture: Film grain, anamorphic lens flare, subtle vignette
Color: Professional cinematic color grading, balanced contrast, atmospheric depth
Texture: Subtle organic film grain, anamorphic lens flare, cinematic light bloom
DOCUMENTARY:
Reference: National Geographic, Planet Earth II, David Attenborough
@@ -616,6 +616,51 @@ export class VideoAiService {
}
}
/**
* Uzun metinlerden (kitap, uzun makale vb.) potansiyel video konuları çıkarır.
* Gemini 1.5 Flash kullanarak 3-4 çarpıcı YouTube video başlığı önerir.
*/
async suggestDocumentTopics(text: string, count: number = 4): Promise<string[]> {
this.logger.log(`Dokümandan konu önerileri çıkarılıyor... (Metin uzunluğu: ${text.length})`);
const systemPrompt = `You are an elite YouTube producer and content strategist.
Your task is to analyze the provided book/document extract and suggest exactly ${count} highly engaging, distinct video topics or angles that could be made into successful YouTube Shorts or videos.
REQUIREMENTS:
- Return ONLY a JSON array of strings. No markdown, no explanations, no wrapping object.
- Example: ["The Hidden Psychology of Habits", "Why Discipline Beats Motivation", "The 5-Second Rule Explained"]
- Each topic should be punchy, curiosity-driven, and clearly related to the core themes of the text.
- Language: Turkish.`;
const userPrompt = `Extract ${count} engaging video topics from this text:\n\n${text.substring(0, 20000)}`;
try {
const response = await this.genAI.models.generateContent({
model: this.modelName,
contents: userPrompt,
config: {
systemInstruction: systemPrompt,
temperature: 0.7,
topP: 0.9,
responseMimeType: 'application/json',
},
});
const rawText = response.text ?? '[]';
const topics: string[] = JSON.parse(rawText);
this.logger.log(`${topics.length} adet konu önerisi çıkarıldı.`);
return topics;
} catch (error) {
this.logger.error(
`Konu çıkarma hatası: ${error instanceof Error ? error.message : 'Bilinmeyen'}`,
);
throw new InternalServerErrorException(
`Video konuları çıkarılamadı: ${error instanceof Error ? error.message : 'API hatası'}`,
);
}
}
private buildUserPrompt(input: ScriptGenerationInput): string {
const langMap: Record<string, string> = {
tr: 'Turkish', en: 'English', es: 'Spanish', de: 'German',
@@ -640,6 +685,8 @@ export class VideoAiService {
`- Make it viral-worthy, visually stunning, and intellectually captivating\n` +
`- The first 2 seconds must hook the viewer immediately\n` +
`- Write narration that sounds HUMAN — avoid AI writing patterns\n` +
`- WHITE-LABELING (CRITICAL): NEVER mention the original source, creator, author, URL, channel name, or @username. Present all content as if YOU are the original creator.\n` +
`- DO NOT include logos, handles, or mentions of the original source in your visual prompts.\n` +
`- Include SEO-optimized metadata with keywords and schema markup\n` +
`- Generate social media captions for YouTube, TikTok, Instagram, Twitter\n`;
@@ -684,11 +731,13 @@ export class VideoAiService {
}
}
prompt += `\nIMPORTANT:\n`;
prompt += `- Analyze WHY this tweet went viral and capture that energy\n`;
prompt += `- The narration should feel like a reaction/commentary on the tweet content\n`;
prompt += `- Mention the original tweet author @${tw.authorUsername} naturally in narration\n`;
prompt += `- Use both the tweet's images as reference AND generate new AI visuals\n`;
prompt += `\nIMPORTANT WHITE-LABELING RULES (CRITICAL):\n`;
prompt += `- Analyze the core message of the tweet and capture its energy.\n`;
prompt += `- You are creating ORIGINAL content. Do NOT act like you are reacting to or commenting on someone else's post.\n`;
prompt += `- ABSOLUTELY DO NOT mention the original author (@${tw.authorUsername}), their real name, or the fact that this is from a tweet/X.\n`;
prompt += `- DO NOT include any logos, usernames, or references to the original source in your visual prompts (e.g. no "@${tw.authorUsername} logo").\n`;
prompt += `- Present the facts, stories, or insights as if YOU are the original expert creator.\n`;
prompt += `- Use the tweet's images as reference for the visuals, but describe them generally without mentioning any source brands or handles.\n`;
prompt += `═══════════════════════════════\n`;
}