import requests, io, sys, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
H = {'User-Agent': 'VinFastMobile/2.26.11 (Android)'}
base = 'https://d1aza9v8tzxrkt.cloudfront.net/'
files = ['app_config.json', 'appdata.json', 'appConfig.json', 'config.json',
         'vinfast_app_config.json', 'app_config_vn.json', 'capp/vn.json',
         'app/v1/appConfig.json', 'mobile/config.json', 'remote/app_config.json']
for f in files:
    try:
        r = requests.get(base + f, headers=H, timeout=15)
        marker = ''
        if r.status_code == 200 and 'OM' in r.text:
            marker = '  <<< CO CAC OMDATA!'
        print(f'{f:32s} {r.status_code} {r.headers.get("content-type","")} {len(r.content) if r.status_code==200 else ""}{marker}')
        if r.status_code == 200 and marker:
            print(r.text[:500])
    except Exception as e:
        print(f'{f:32s} EXC {type(e).__name__}')

print()
try:
    r = requests.get('https://omapi.vinfastauto.com/app/v1/getVersion', headers=H, timeout=15)
    print('omapi getVersion:', r.status_code, r.text[:200])
except Exception as e:
    print('omapi EXC', type(e).__name__, e)
