untitled-619main.ts53 matches
67"Client-Type": "pc",68"Locale": "en-US",69"Referer": "https://www.oreateai.com/home/vertical/aiImage",70"User-Agent":71"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",106"Locale": "en-US",107"Origin": "https://www.oreateai.com",108"Referer": "https://www.oreateai.com/home/vertical/aiImage",109"User-Agent":110"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",111},112body: JSON.stringify({113fr: "GGSEMIMAGE",114email,115ticketID,175"Locale": "en-US",176"Origin": "https://www.oreateai.com",177"Referer": "https://www.oreateai.com/home/chat/aiImage",178"User-Agent":179"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",182183// ==================== استخراج رابط الصورة ====================184function extractImageUrl(result: string): string | null {185if (!result) return null;186217218// ==================== تحويل الصورة إلى فريمات باستخدام PNG.js (بدون مشاكل SSL) ====================219async function downloadImageAsBuffer(url: string): Promise<Buffer> {220console.log("📥 تحميل الصورة...");221226"User-Agent":227"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",228"Accept": "image/webp,image/apng,image/*,*/*;q=0.8",229},230});242console.log("🔄 استخدام Google Viewer كبديل...");243const googleViewerUrl =244`https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=${245encodeURIComponent(url)246}&container=focus`;284}285286async function imageToFrames(imageUrl: string) {287console.log("🖼️ تحويل الصورة إلى فريمات...");288289try {290// تحميل الصورة كـ Buffer291const imageBuffer = await downloadImageAsBuffer(imageUrl);292293// محاولة فك تشفير الصورة كـ PNG294let png: any;295try {296png = PNG.sync.read(imageBuffer);297} catch (pngError) {298console.log("⚠️ الصورة ليست PNG، نحولها...");299300// إذا فشلت، نستخدم خدمة تحويل خارجية301const converterUrl = `https://images.weserv.nl/?url=${302encodeURIComponent(imageUrl)303}&output=png`;304const response = await fetch(converterUrl);365366// ==================== توليد الصورة وتحويلها إلى فريمات ====================367async function generateImage(368prompt: string,369imageSize?: string,370style?: string,371) {376}377378if (imageSize) {379finalPrompt = `${finalPrompt}\nImage size: ${imageSize}`;380}381391method: "POST",392headers,393body: JSON.stringify({ type: "aiImage", docId: "" }),394});395412clientType: "pc",413type: "chat",414chatType: "aiImage",415chatId,416focusId: chatId,433let buffer = "";434let fullResponse = "";435let imageUrl: string | null = null;436437console.log(" ⏳ انتظار النتيجة...");455456if (jsonStr.includes("http")) {457const extracted = extractImageUrl(jsonStr);458if (extracted) {459imageUrl = extracted;460break;461}466if (json.data?.result) {467console.log("🎨 تم استلام result");468const extracted = extractImageUrl(json.data.result);469if (extracted) {470imageUrl = extracted;471break;472}473}474475if (json.data?.imageUrl) {476imageUrl = json.data.imageUrl;477break;478}479480if (json.data?.url) {481imageUrl = json.data.url;482break;483}491}492493if (imageUrl) break;494}495496if (!imageUrl) {497imageUrl = extractImageUrl(fullResponse);498}499500if (imageUrl) {501console.log("✅ تم العثور على رابط الصورة:", imageUrl);502503// تحويل الصورة إلى فريمات504const frames = await imageToFrames(imageUrl);505506const result: any = {507success: true,508metadata: {509width: imageSize || "unknown",510height: imageSize || "unknown",511frameCount: frames.length,512compression: `كل فريم يمثل 5 بيكسلات`,524} else {525// إذا فشل التحويل، نضيف رابط الصورة526result.imageUrl = imageUrl;527result.warning =528"تم إرجاع رابط الصورة بدلاً من الفريمات بسبب مشكلة في التحويل";553try {554const body = await c.req.json();555const { prompt, imageSize, style } = body;556557if (!prompt) {562}563564const result = await generateImage(prompt, imageSize, style);565566if (result.success) {581try {582const prompt = c.req.query("prompt");583const imageSize = c.req.query("imageSize");584const style = c.req.query("style");585591}592593const result = await generateImage(prompt, imageSize, style);594595if (result.success) {609app.get("/api/generate/stream", async (c) => {610const prompt = c.req.query("prompt");611const imageSize = c.req.query("imageSize");612const style = c.req.query("style");613652method: "POST",653headers,654body: JSON.stringify({ type: "aiImage", docId: "" }),655},656);666let finalPrompt = prompt;667if (style) finalPrompt = `${finalPrompt}, ${style}`;668if (imageSize) finalPrompt = `${finalPrompt}\nImage size: ${imageSize}`;669670await stream.writeSSE({679clientType: "pc",680type: "chat",681chatType: "aiImage",682chatId,683focusId: chatId,702const chunk = decoder.decode(value);703704const imageUrl = extractImageUrl(chunk);705if (imageUrl) {706await stream.writeSSE({707data: JSON.stringify({708status: "image_received",709message: "✅ تم استلام الصورة، جاري تحويلها إلى فريمات...",710}),713714// تحويل الصورة إلى فريمات715const frames = await imageToFrames(imageUrl);716717const result: any = {732} else {733result.success = true;734result.imageUrl = imageUrl;735result.warning = "تم إرجاع رابط الصورة بدلاً من الفريمات";736}757c.json({758status: "online",759message: "OreateAI Image Generator API - مع تحويل الصور إلى فريمات",760endpoints: {761"POST /api/generate": "JSON body: { prompt, imageSize?, style? }",762"GET /api/generate": "Query params: ?prompt=...&imageSize=...&style=...",763"GET /api/generate/stream": "SSE stream لنفس المعاملات",764},765example:766"GET /api/generate?prompt=قطة%20صغيرة&imageSize=1024x1024&style=realistic",767}));768
67}68const base64 = btoa(binary);69const dataUrl = `data:image/png;base64,${base64}`;7071return c.html(
3Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right.45You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen!67Have fun with it and hopefully your crush says yes hehe.
3Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right.45You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen!67Have fun with it and hopefully your crush says yes hehe.
x402-playgroundREADME.md1 match
64Buyer->>Browser: Navigate to user's URL65Browser-->>Buyer: PNG screenshot66Buyer-->>User: Return screenshot image67```68
untitled-7771main.ts51 matches
1// ai-image-complete-v2.ts2// كود متكامل مع صور بديلة379): Promise<string> {80let fullResponse = "";81let imageUrl = "";8283while (true) {99100if (data.data?.imgUrl) {101imageUrl = data.data.imgUrl;102console.log(` ✅ تم العثور على الصورة: ${imageUrl}`);103} else if (data.data?.url) {104imageUrl = data.data.url;105console.log(` ✅ تم العثور على الصورة: ${imageUrl}`);106}107116}117118return imageUrl || fullResponse;119}120131"Client-Type": "pc",132"Locale": "en-US",133"Referer": "https://www.oreateai.com/home/vertical/aiImage",134"User-Agent":135"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",167"Locale": "en-US",168"Origin": "https://www.oreateai.com",169"Referer": "https://www.oreateai.com/home/vertical/aiImage",170"User-Agent":171"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",172},173body: JSON.stringify({174fr: "GGSEMIMAGE",175email,176ticketID,200201// ==================== دالة رفع الصورة ====================202async function uploadImageFromUrl(203imageUrl: string,204cookies: string[],205source: string = "aiImage",206): Promise<{ bosUrl: string; fileExt: string; size: number }> {207console.log(`🌐 جاري تحميل الصورة من: ${imageUrl}`);208209// إضافة headers لتجنب 403210const imageResponse = await fetch(imageUrl, {211headers: {212"User-Agent":213"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",214"Accept": "image/webp,image/apng,image/*,*/*;q=0.8",215"Accept-Language": "en-US,en;q=0.9",216"Referer": "https://www.google.com/",218});219220if (!imageResponse.ok) {221console.log(`⚠️ فشل تحميل الصورة من الرابط: ${imageResponse.status}`);222console.log("📥 جاري استخدام صورة افتراضية...");223224// استخدام صورة افتراضية من Unsplash (مجانية)225const fallbackUrl =226"https://images.unsplash.com/photo-1547425260-76bcadfb4f2c?w=400";227const fallbackResponse = await fetch(fallbackUrl, {228headers: {250}251252const imageArrayBuffer = await imageResponse.arrayBuffer();253const imageBytes = new Uint8Array(imageArrayBuffer);254255// استخراج معلومات الملف من الرابط256const urlParts = imageUrl.split("/");257const fullFileName = urlParts[urlParts.length - 1].split("?")[0];258let fileExt = fullFileName.split(".").pop() || "jpg";259if (fileExt.includes("_")) fileExt = "jpg";260261const fileName = fullFileName.replace(`.${fileExt}`, "") || "image";262const fileSize = imageArrayBuffer.byteLength;263264return await performUpload(265imageBytes,266fileName,267fileExt,274// دالة مساعدة للرفع275async function performUpload(276imageBytes: Uint8Array,277fileName: string,278fileExt: string,301"Cookie": cookieString,302"Origin": "https://www.oreateai.com",303"Referer": "https://www.oreateai.com/home/chat/aiImage",304"User-Agent":305"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Mobile/15E148 Safari/604.1",346method: "PUT",347headers: {348"Content-Type": `image/${fileExt === "jpg" ? "jpeg" : fileExt}`,349"x-goog-session-key": sessionkey,350"x-goog-content-length-range": `0,${fileSize}`,351"Content-Length": fileSize.toString(),352},353body: imageBytes,354},355);366367// ==================== دالة تعديل الصورة ====================368async function editImage(369bosUrl: string,370fileExt: string,380"Locale": "en-US",381"Origin": "https://www.oreateai.com",382"Referer": "https://www.oreateai.com/home/chat/aiImage",383"User-Agent":384"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Mobile/15E148 Safari/604.1",392headers: genHeaders,393body: JSON.stringify({394type: "aiImage",395docId: "",396}),425clientType: "wap",426type: "chat",427chatType: "aiImage",428chatTitle: "Unnamed Session",429focusId: newChatId,435attachments: [{436bos_url: bosUrl,437doc_title: "image",438doc_type: fileExt,439size: fileSize,472try {473// قائمة صور بديلة (كلها مجانية)474const imageUrls = [475"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400", // رجل سعيد476"https://images.unsplash.com/photo-1531427186627-4fd839c4d25c?w=400", // رجل آخر477"https://images.pexels.com/photos/614810/pexels-photo-614810.jpeg?auto=compress&cs=tinysrgb&w=400", // رجل478"https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&w=400", // رجل سعيد479];480481// اختيار صورة عشوائية482const sourceImageUrl =483imageUrls[Math.floor(Math.random() * imageUrls.length)];484485console.log("📋 [1/3] إنشاء حساب جديد...");488489console.log("📋 [2/3] رفع الصورة...");490console.log(`🖼️ الصورة المختارة: ${sourceImageUrl}`);491const { bosUrl, fileExt, size } = await uploadImageFromUrl(492sourceImageUrl,493cookies,494);497498console.log("📋 [3/3] تعديل الصورة...");499const result = await editImage(bosUrl, fileExt, size, cookies, email);500501console.log("\n" + "=".repeat(60));508// تحميل الصورة509console.log("\n📥 جاري تحميل الصورة...");510const imageRes = await fetch(result);511if (imageRes.ok) {512const imageBlob = await imageRes.blob();513const fileName = `final_image_${Date.now()}.${fileExt}`;514await Deno.writeFile(515fileName,516new Uint8Array(await imageBlob.arrayBuffer()),517);518console.log(`✅ تم حفظ الصورة في: ${fileName}`);526}527528// للتشغيل: deno run --allow-net --allow-write ai-image-complete-v2.ts
untitled-8349main.ts21 matches
85"Client-Type": "pc",86"Locale": "en-US",87"Referer": "https://www.oreateai.com/home/vertical/aiImage",88"User-Agent":89"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",121"Locale": "en-US",122"Origin": "https://www.oreateai.com",123"Referer": "https://www.oreateai.com/home/vertical/aiImage",124"User-Agent":125"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",126},127body: JSON.stringify({128fr: "GGSEMIMAGE",129email,130ticketID,154155// ==================== دالة رفع الصورة ====================156async function uploadImageFromUrl(157imageUrl: string,158cookies: string[],159source: string = "aiImage",160): Promise<string> {161console.log(`🌐 جاري تحميل الصورة من: ${imageUrl}`);162163// 1. تحميل الصورة164const imageResponse = await fetch(imageUrl);165if (!imageResponse.ok) {166throw new Error(`فشل تحميل الصورة: ${imageResponse.status}`);167}168169const imageArrayBuffer = await imageResponse.arrayBuffer();170const imageBytes = new Uint8Array(imageArrayBuffer);171172// استخراج معلومات الملف من الرابط173const urlParts = imageUrl.split("/");174const fullFileName = urlParts[urlParts.length - 1].split("?")[0];175const fileExt = fullFileName.split(".").pop() || "png";176const fileName = fullFileName.replace(`.${fileExt}`, "") || "image";177const fileSize = imageArrayBuffer.byteLength;178179console.log(198"Cookie": cookieString, // ← الكوكيز هنا!199"Origin": "https://www.oreateai.com",200"Referer": "https://www.oreateai.com/home/chat/aiImage",201"User-Agent":202"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Mobile/15E148 Safari/604.1",243method: "PUT",244headers: {245"Content-Type": `image/${fileExt === "jpg" ? "jpeg" : fileExt}`,246"x-goog-session-key": sessionkey,247},248body: imageBytes,249},250);266267console.log("📋 [2/2] رفع الصورة...");268const imageUrl =269"https://www.kindpng.com/picc/m/87-873966_transparent-man-happy-black-man-png-png-download.png";270271const bosUrl = await uploadImageFromUrl(imageUrl, finalCookies);272273console.log("\n" + "=".repeat(60));279{280bos_url: bosUrl,281doc_title: "image",282doc_type: bosUrl.split(".").pop(),283size: "?",
mdsitecontent.md1 match
1<img2src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/9324cf00-39e6-47dd-995a-da70635f6400/public"3width="250px" style="border-radius: 10px" />4
89});9091app.get("/images.zip", async (c) => {92const images = [93"235f72fc-1f56-436e-f1c0-160159b5c900",94"7649601c-951d-4a1b-8e48-6a40a9615900",104];105const zip = new JSZip();106await Promise.all(images.map(async (id, i) => {107const res = await fetch(`https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/${id}/public`);108if (!res.ok) return;109const buf = await res.arrayBuffer();110const ct = res.headers.get("content-type") ?? "";111const ext = ct.includes("png") ? "png" : ct.includes("webp") ? "webp" : "jpg";112zip.file(`image-${String(i + 1).padStart(2, "0")}.${ext}`, buf);113}));114const zipBuf = await zip.generateAsync({ type: "uint8array" });116headers: {117"Content-Type": "application/zip",118"Content-Disposition": 'attachment; filename="blog-images.zip"',119},120});
mdsiteburpees-system.md11 matches
1234567891011121314151617181920212223# My adaptive burpee goal system