Files
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
2.7 KiB
JSON

{"repo": "alfars9000/altheeb-backend", "files": {"server.js": {"8611c7571d9a56d863a22cff94b231fc16cc0ca8": {"t": 1786068262.5352824, "n": 2179, "h": "1f083a35af45e7f2", "c": "import express from \"express\";\r\nimport cors from \"cors\";\r\nimport fetch from \"node-fetch\";\r\n\r\nconst app = express();\r\nconst PORT = process.env.PORT || 3000;\r\n\r\napp.use(cors());\r\napp.use(express.json());\r\n\r\nconst DEEPSEEK_API_KEY = process.env.DEEPSEEK_API_KEY;\r\n\r\napp.get(\"/\", (req, res) => {\r\n res.send(\"Altheeb AI Backend (DeepSeek Version) is running...\");\r\n});\r\n\r\n// توليد نص الفيديو باستخدام DeepSeek\r\nasync function generateScript({ duration, language, contentType, voiceTone }) {\r\n const prompt = `\r\nاكتب نص فيديو مدته تقريبًا ${duration} دقيقة.\r\nاللغة: ${language}.\r\nنوع المحتوى: ${contentType}.\r\nنبرة الصوت: ${voiceTone}.\r\nاجعل النص احترافي، واضح، ومناسب للنشر كفيديو.\r\n`;\r\n\r\n const response = await fetch(\"https://api.deepseek.com/chat/completions\", {\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n \"Authorization\": `Bearer ${DEEPSEEK_API_KEY}`\r\n },\r\n body: JSON.stringify({\r\n model: \"deepseek-chat\",\r\n messages: [\r\n { role: \"user\", content: prompt }\r\n ]\r\n })\r\n });\r\n\r\n const data = await response.json();\r\n\r\n if (!data.choices || !data.choices[0]) {\r\n throw new Error(\"DeepSeek API returned an invalid response\");\r\n }\r\n\r\n return data.choices[0].message.content;\r\n}\r\n\r\napp.post(\"/api/generate-video\", async (req, res) => {\r\n try {\r\n const { duration, language, contentType, voiceTone } = req.body;\r\n\r\n const script = await generateScript({\r\n duration,\r\n language,\r\n contentType,\r\n voiceTone,\r\n });\r\n\r\n res.json({\r\n status: \"success\",\r\n message: \"تم توليد نص الفيديو بنجاح باستخدام DeepSeek\",\r\n script: script,\r\n videoUrl: null\r\n });\r\n } catch (error) {\r\n console.error(\"DeepSeek Error:\", error);\r\nres.status(500).json({\r\n status: \"error\",\r\n message: \"DeepSeek Error Details\",\r\n error: error.message,\r\n script: null,\r\n videoUrl: null,\r\n});\r\nreturn;\r\n\r\n res.status(500).json({\r\n status: \"error\",\r\n message: \"حدث خطأ أثناء توليد نص الفيديو\",\r\n script: null,\r\n videoUrl: null,\r\n });\r\n }\r\n});\r\n\r\napp.listen(PORT, () => {\r\n console.log(`Altheeb AI Backend (DeepSeek) running on port ${PORT}`);\r\n});\r\n\r\n"}}}}