async function sendRequest(systemPromptModel) { // اسم النموذج الحقيقي (fallback ثابت) const realV3 = "deepseek-v3"; const realR1 = "deepseek-r1"; const realModel = model.includes("speed") ? realV3 : realR1; // جلب الصفحة لاستخراج nonces let html = ""; let cookies = ""; try { const res = await fetch(urlMain, { headers: HEAD, method: 'GET', timeout: 10000 }); html = await res.text(); // جمع الكوكيز (باسم بسيط) const setCookie = res.headers.get('set-cookie'); cookies = setCookie ? setCookie : ""; } catch (e) { console.log("❌ Failed to reach origin"); return; } // استخراج nonces const nonceRegex = /['"]nonce['"]\s*[:=]\s*['"]([A-Za-z0-9\-_]{10,})['"]/g; const found = []; let m; while ((m = nonceRegex.exec(html)) !== null) { if (m[1] && !/^\d+$/.test(m[1])) found.push(m[1]); } // إزالة التكرار مع الحفاظ على الترتيب const nonces = [...new Set(found)]; if (!nonces.length) { console.log("❌ Failed to get valid response"); return; } const convId = `ds_conv_${Date.now()}_xx`;