const { firefox } = require('playwright');
const fs = require('fs');
const fsp = fs.promises;
const path = require('path');
const PROMPT_FILE = 'prompts.txt';
const USER_DATA_DIR = path.join(__dirname, 'firefox-profile');
const DOWNLOAD_DIR = path.join(__dirname, 'downloads');
const IMAGES_PER_PROMPT = 1;
const MAX_WAIT = 45000; // maksimal tunggu per prompt (ms)
const POLL_INTERVAL = 1000; // cek tiap 1 detik
const savedBlobs = new Set();
(async () => {
// === Persiapan folder ===
if (!fs.existsSync(DOWNLOAD_DIR)) fs.mkdirSync(DOWNLOAD_DIR);
// === Launch Firefox persistent ===
const context = await firefox.launchPersistentContext(USER_DATA_DIR, {
headless: false
});
const page = context.pages()[0] || await context.newPage();
await page.goto('https://firefly.adobe.com/generate/image', {
waitUntil: 'domcontentloaded'
});
console.log('š Login Adobe Firefly MANUAL');
console.log('š Atur Model & Aspect Ratio');
console.log('š Tekan ENTER di terminal');
await new Promise(r => process.stdin.once('data', r));
// === Prompt box ===
const promptBox = page.locator('textarea[aria-label="Prompt"]');
await promptBox.waitFor({ state: 'visible', timeout: 60000 });
// === Load prompts ===
const prompts = fs.readFileSync(PROMPT_FILE, 'utf-8')
.split(/\r?\n/)
.map(l => l.trim())
.filter(Boolean);
console.log(`š„ Total prompt: ${prompts.length}`);
// === Loop prompt ===
for (let i = 0; i < prompts.length; i++) {
console.log(`\n▶ Prompt ${i + 1}/${prompts.length}`);
console.log('⏳ Generating...');
await promptBox.fill('');
await promptBox.fill(prompts[i]);
await page.keyboard.press('Enter');
// ===== POLLING MANUAL (ANTI TIMEOUT) =====
const start = Date.now();
let foundNewBlob = false;
while (Date.now() - start < MAX_WAIT) {
const blobs = await page.$$eval(
'img[src^="blob:"]',
imgs => imgs.map(img => img.src)
);
for (const blob of blobs) {
if (!savedBlobs.has(blob)) {
foundNewBlob = true;
break;
}
}
if (foundNewBlob) break;
await page.waitForTimeout(POLL_INTERVAL);
}
if (!foundNewBlob) {
console.log('⚠️ Tidak ditemukan blob baru, skip prompt ini');
continue;
}
// ===== DOWNLOAD BLOBS TERBARU =====
const images = page.locator('img[src^="blob:"]');
const total = await images.count();
let saved = 0;
// scan dari belakang (gambar terbaru)
for (let j = total - 1; j >= 0 && saved < IMAGES_PER_PROMPT; j--) {
const img = images.nth(j);
const blobUrl = await img.getAttribute('src');
if (!blobUrl || savedBlobs.has(blobUrl)) continue;
const buffer = await page.evaluate(async (url) => {
const res = await fetch(url);
const blob = await res.blob();
return new Uint8Array(await blob.arrayBuffer());
}, blobUrl);
savedBlobs.add(blobUrl);
saved++;
const safePrompt = prompts[i]
.slice(0, 40)
.replace(/[^a-z0-9]+/gi, '_')
.toLowerCase();
const filename = `firefly_${i + 1}_${safePrompt}.png`;
await fsp.writeFile(
path.join(DOWNLOAD_DIR, filename),
Buffer.from(buffer)
);
console.log(`✅ Saved: ${filename}`);
}
await page.waitForTimeout(1000);
}
console.log('\nš SEMUA PROMPT SELESAI');
})();
Wednesday, 17 December 2025
BOOKMARK ONE
Search This Blog
Categories
0ad
(1)
3a
(1)
aac
(1)
adb
(1)
agc
(1)
alias
(1)
alien
(1)
amr
(1)
Android
(13)
Antivirus
(45)
AnyDesk
(1)
appimage
(2)
audacity
(1)
autoclean
(1)
autoremove
(18)
Bahan Ajar
(3)
base
(1)
Baterai
(1)
bingai
(1)
bitnami
(1)
Blueman
(1)
Bluetooth
(1)
booklet
(1)
boomaga
(1)
boot
(2)
Booting
(2)
Boxes
(3)
Brasero
(1)
Brave
(2)
browser
(2)
C++
(2)
Calculator
(1)
Calibre
(1)
camera
(1)
canon
(1)
CBT
(1)
CD
(3)
certbot
(1)
chatgpt
(1)
chmod
(2)
Chrome
(1)
cli
(1)
cloudflare
(7)
cloudflared
(2)
colab
(1)
colibre
(1)
color
(1)
Compiz
(2)
conky
(1)
cron
(1)
crossover
(2)
csf
(1)
cups
(6)
curl
(1)
dconf-editor
(1)
debian
(19)
decoder
(1)
disk
(4)
dns
(1)
Docker
(6)
Downloads
(83)
dpkg
(1)
draw
(1)
droidcam
(2)
dunst
(1)
dupeguru
(1)
duplex
(1)
DVD
(1)
Ebook
(1)
Edge
(5)
eduactiv8
(1)
Emerald
(1)
Epson
(5)
error
(1)
exam
(1)
exambro
(1)
exelearning
(4)
exfat
(1)
exfat-utils
(1)
extension
(3)
face-unclok
(1)
face-unlock
(1)
fastboot
(1)
fet
(2)
ffmpeg
(5)
file
(1)
firefly
(4)
firefox
(3)
firewall
(1)
firewall log
(2)
flameshot
(4)
flash
(2)
flatpak
(4)
folder
(2)
Font
(2)
Fonts
(2)
foto
(1)
Foxitreader
(1)
Franz
(1)
Free Office
(3)
fsck
(1)
ftp
(2)
fuse
(2)
gallery
(2)
Game
(13)
gcam
(3)
gdm3
(1)
gedit
(1)
Geogebra
(1)
gespeaker
(1)
ghostscript
(3)
gimp
(9)
git
(3)
Giveaway
(117)
glaxnimate
(1)
globalmenu
(5)
Gnome
(7)
Gnome Box
(3)
Gnome Boxes
(2)
gnome-remote-desktop
(1)
gnome-shell-extension-manager
(1)
gnome-tweaks
(4)
golang
(1)
google cloud
(5)
google drive
(2)
gps
(1)
Gromit-MPX
(1)
grub
(4)
grub-customizer
(1)
GSConnect
(2)
gstreamer
(1)
Gutenprint
(3)
h.264
(1)
Handphone
(11)
hardisk
(2)
hdd
(7)
hide
(4)
Hikmah
(1)
hp
(7)
html
(1)
i3wm
(12)
icons
(1)
image
(1)
imagemagick
(13)
Immich
(2)
inkscape
(4)
Internet
(44)
ip
(2)
Iriun
(1)
Itel
(2)
itools
(1)
jq
(1)
jurnalmengajar
(5)
KDEnlive
(5)
kernel
(4)
key
(1)
Key-Mon
(1)
keyworder
(1)
kitty
(1)
Klavaro
(1)
Kolourpaint
(1)
kvm
(1)
Laptop
(15)
libdvd-pkg
(2)
LibreOffice
(27)
libssl. so.3
(1)
lightdm
(1)
live-build
(1)
lock
(1)
lowlatency
(3)
lscpu
(1)
lshw
(2)
lsposed
(1)
lsposes
(2)
magisk
(5)
mail
(1)
malware
(1)
manual duplex
(1)
mariadb
(8)
mediainfo
(1)
mesa-utils
(1)
meson
(1)
meta
(1)
micloud
(1)
mikrotik
(4)
miui
(3)
mlt
(1)
modem
(1)
mojave
(1)
Moodle
(111)
motorola
(1)
mp280
(1)
mp3
(1)
mpc
(1)
mpd
(1)
mpeg-4
(1)
mpv
(7)
mysql
(11)
nautilus
(1)
ncmpcpp
(1)
net-tools
(1)
netstat
(1)
network-manager
(2)
nextcloud
(1)
nginx
(8)
OBS
(5)
Office
(2)
Office 2013
(1)
okular
(2)
optipng
(1)
Orbit Star2
(1)
output
(1)
ownership
(1)
Paint
(1)
panel
(1)
pdf
(11)
pdfcpu
(2)
pdftopmm
(1)
Pengalaman
(6)
photo
(1)
php
(17)
pidgin
(1)
pipewire
(2)
pix
(1)
pixel
(3)
Plank Dock
(3)
playonlinux
(2)
playwright
(3)
plymouth
(1)
Polybar
(1)
PPPoE
(1)
print
(2)
printer
(10)
Printing
(6)
proftpd
(1)
Proxy
(2)
pulseaudio
(2)
purge
(1)
PyMuPDF
(1)
python
(1)
qemu
(1)
QT app
(1)
rar
(1)
recorder
(1)
rename
(1)
Review
(6)
rkhunter
(1)
rofi
(1)
root
(4)
rootkit
(1)
ruby
(4)
Ruffle
(1)
samba
(1)
scanner
(2)
scorm
(2)
scratux
(1)
scrcpy
(7)
screen
(2)
screenfetch
(1)
screenshot
(8)
Scribus
(1)
server
(45)
setting
(1)
sgx
(1)
shorcut
(2)
shutterstock
(5)
SiM
(9)
simplrescreenrecorder
(1)
situs
(1)
SLIMS
(1)
smalipatcher
(3)
Snap
(5)
Snapd
(2)
Softmaker
(4)
Software
(87)
Sonzi
(1)
sound
(1)
speedtest
(2)
Spotify
(3)
SSD
(2)
ssh
(10)
statusbar
(1)
steam
(3)
swap
(1)
synaptic
(1)
Systemd-analyze
(8)
tailscale
(1)
targz
(1)
tela
(1)
Telegram
(1)
terminal
(3)
termpdf.py
(2)
theme
(2)
thinkpad
(1)
thumbnail
(1)
thunar
(1)
timetable
(1)
Tips
(36)
TKA
(4)
tmp
(1)
tmpfs
(1)
TRIM
(1)
tunnel
(2)
Tutorial
(22)
tuxtype
(2)
tweak
(1)
TWRP
(1)
Ubuntu
(72)
Ubuntu studio
(1)
ubuntu-restricted-extras
(2)
universalAuth
(1)
unoconv
(2)
unrar
(1)
unzip
(1)
update
(4)
upgradable
(8)
upgrade
(40)
upscale
(2)
usr
(1)
v4l2loopback-utils
(1)
vcdimager
(1)
ventoy
(1)
video
(3)
vlc
(1)
vps
(1)
warp
(1)
WebKitWebProcess
(1)
wget
(2)
WhatsApp
(7)
WhiteSur
(1)
whyred
(1)
wifi
(6)
wireless
(3)
wordpress
(11)
Workspace
(1)
WPS Office
(8)
xautolock
(1)
xchm
(2)
xclip
(2)
xfce4
(3)
xl
(1)
xorg
(2)
xpad
(2)
xrandr
(1)
youtube-dl
(2)
yt-dlp
(3)
zathura
(2)
Zekr
(1)
zip
(1)
Zoom
(3)
Fisikaku. Powered by Blogger.
Blog Archive
Popular Posts
-
https://download.ebz.epson.net/dsc/search/01/search/searchModuleFromResult https://download.ebz.epson.net/dsc/du/02/DriverDownloadInfo.do?L...
-
Jika kamu tidak sedang menggunakan VPN Tailscale: sudo systemctl disable --now tailscaled.service ▶️ Menyalakan Tailscale saat dibutuhkan...
-
Bitdefender Mobile Security Premium will keep your Android device protected against viruses, without affecting your battery life. It w...
0 comments:
Post a Comment