import base64, json, urllib.request
WP_URL = "https://yasmanatura.co.id"
WP_AUTH = base64.b64encode(b"bambangbot:LFp4 LXBh kMYG 84qC 2DDc 5bLc").decode()
slug = "8-hal-krusial-yang-harus-kamu-siapkan-sebelum-maklon-minuman-serbuk"
req = urllib.request.Request(f"{WP_URL}/wp-json/wp/v2/posts?slug={slug}",
    headers={"Authorization": f"Basic {WP_AUTH}", "User-Agent":"Mozilla/5.0"})
with urllib.request.urlopen(req, timeout=20) as r:
    posts = json.loads(r.read())
for p in posts:
    print("ID:", p["id"], "| title:", p["title"]["rendered"], "| featured:", p.get("featured_media"))
if not posts:
    print("TIDAK DITEMUKAN")
