Obscuraworks
Obscuraworks.
Home
f0b6373·Viewing revision r1 — Initial revision
Back to latest revision
← Explore
JavaScript·public

HD

Image Upscale

ACHMAT MUWAFIKACHMAT MUWAFIK
created 5/13/2026· updated 5/13/2026
Files1
Size6.3 KB
Lines83
Revisions1
JavaScript
ZIP

Files

1 file· 6.3 KB
hd.js· 83L · 6.3 KB
import te from "../../src/lib/ourin-error.js";

const config = {
  name: "remini",
    alias: ["hd", "enhance", "upscale"],
      category: "tools",
        description: "Enhance gambar jadi HD",
          usage: ".remini (reply gambar)",
            example: ".remini",
              cooldown: 15,
                energi: 1,
                  isEnabled: true
                  };

                  const API = "https://api.obscuraworks.org/api/v2/tools/upscale";
                  const KEY = "obs-N9GacfsE5SDVNuAMk4Wu";

                  async function up(url) {
                    const r = await fetch(`${API}?url=${encodeURIComponent(url)}`, {
                        headers: {
                              Accept: "application/json, image/*",
                                    Authorization: `Bearer ${KEY}`
                                        }
                                          });

                                            return Buffer.from(await r.arrayBuffer());
                                            }

                                            import FormData from "form-data";
                                            import { ImageUploadService } from "node-upload-images";

                                            const service = new ImageUploadService("pixhost.to");

                                            async function ul(buf) {
                                              try {
                                                  const { directLink } = await service.uploadFromBinary(
                                                        buf,
                                                              "upload.jpg"
                                                                  );

                                                                      return directLink;

                                                                        } catch (e) {
                                                                            console.log("Pixhost Upload Error:", e);
                                                                                throw e;
                                                                                  }
                                                                                  }

                                                                                  async function handler(m, { sock }) {
                                                                                    const img = m.isImage || (m.quoted && m.quoted.type === "imageMessage");

                                                                                      if (!img) {
                                                                                          return m.reply(`*🪁 HD IMAGE*\n> Reply gambar\n\n\`\`\`${m.prefix}remini\`\`\``);
                                                                                            }

                                                                                              m.react("🕕");

                                                                                                try {
                                                                                                    let b = m.quoted?.isMedia
                                                                                                          ? await m.quoted.download()
                                                                                                                : await m.download();

                                                                                                                    const u = await ul(b);
                                                                                                                        const r = await up(u);

                                                                                                                            m.react("✅");

                                                                                                                                await sock.sendMedia(
                                                                                                                                      m.chat,
                                                                                                                                            r,
                                                                                                                                                  null,
                                                                                                                                                        m,
                                                                                                                                                              { type: "image" }
                                                                                                                                                                  );

                                                                                                                                                                    } catch (e) {
                                                                                                                                                                        console.log(e);
                                                                                                                                                                            m.react("☢");
                                                                                                                                                                                m.reply(te(m.prefix, m.command, m.pushName));
                                                                                                                                                                                  }
                                                                                                                                                                                  }

                                                                                                                                                                                  export { config, handler };

Live metrics

Stars
0
Views
5
Copies
0
Forks
0

Revisions

View all →
  1. f0b6373 · r15/13/2026

    Initial revision

    1 files+83-0

Permalink

/code/enhgds5-hd
Latest commit
/code/enhgds5-hd/f0b6373