import requests, re, html, io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
H = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/126 Safari/537.36'}
for pkg in ["vn.vinfast.ecosystem", "com.vinfast.companion.app", "com.vinfast.club"]:
    try:
        r = requests.get(f'https://play.google.com/store/apps/details?id={pkg}', headers=H, timeout=20)
        m = re.search(r'<title[^>]*>(.*?)</title>', r.text)
        print(pkg, '->', r.status_code, html.unescape(m.group(1)) if m else '?')
    except Exception as e:
        print(pkg, 'EXC', e)
    try:
        r2 = requests.get(f'https://apkpure.com/search?q={pkg}', headers=H, timeout=20)
        titles = re.findall(r'class="app-title"[^>]*>([^<]+)<', r2.text)
        print('   apkpure:', r2.status_code, titles[:3])
    except Exception as e:
        print('   apkpure EXC', e)
