0% found this document useful (0 votes)
6 views2 pages

iPhone User Agent Generator Script

The document contains a Python script that generates random user agent strings for Instagram on various iPhone models and iOS versions. It includes dictionaries for iPhone models with their screen resolutions and pixel densities, lists of iOS build numbers, Instagram versions, and locales. The script randomly selects values from these lists to create and print 500 unique user agent strings.

Uploaded by

alujsr005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

iPhone User Agent Generator Script

The document contains a Python script that generates random user agent strings for Instagram on various iPhone models and iOS versions. It includes dictionaries for iPhone models with their screen resolutions and pixel densities, lists of iOS build numbers, Instagram versions, and locales. The script randomly selects values from these lists to create and print 500 unique user agent strings.

Uploaded by

alujsr005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import random

# iPhone models and screen resolutions


iphone_models = {

"iPhone11,8": ("828x1792", "2.00"),


"iPhone12,1": ("828x1792", "2.00"),
"iPhone12,3": ("1125x2436", "3.00"),
"iPhone12,5": ("1242x2688", "3.00"),
"iPhone12,8": ("750x1334", "2.00"),
"iPhone13,1": ("1080x2340", "2.00"),
"iPhone13,2": ("1170x2532", "3.00"),
"iPhone13,3": ("1170x2532", "3.00"),
"iPhone13,4": ("1284x2778", "3.00"),
"iPhone14,2": ("1170x2532", "3.00"),
"iPhone14,3": ("1284x2778", "3.00"),
"iPhone14,4": ("1080x2340", "2.00"),
"iPhone14,5": ("1170x2532", "3.00"),
"iPhone14,6": ("750x1334", "2.00"),
"iPhone14,7": ("1170x2532", "3.00"),
"iPhone14,8": ("1284x2778", "3.00"),
"iPhone15,2": ("1179x2556", "3.00"),
"iPhone15,3": ("1290x2796", "3.00"),
"iPhone15,4": ("1170x2532", "3.00"),
"iPhone15,5": ("1284x2778", "3.00"),
"iPhone16,1": ("1179x2556", "3.00"),
"iPhone16,2": ("1290x2796", "3.00"),
"iPhone17,1": ("1290x2796", "3.00"),
"iPhone17,2": ("1179x2556", "3.00"),
}

# iOS 18.x build numbers


ios_versions = [
("16_0", "20A362"), ("16_1", "20B82"), ("16_2", "20C65"), ("16_3", "20D47"),
("16_4", "20E247"), ("16_5", "20F66"), ("16_6", "20G75"), ("16_7", "20H115"),
("17_0", "21A329"), ("17_1", "21B74"), ("17_2", "21C62"), ("17_3", "21D50"),
("17_4", "21E219"), ("17_5", "21F79"), ("17_6", "21G80"), ("17_7", "21H16"),
("18_0", "22A3354"), ("18_0_1", "22A3370"), ("18_1", "22B83"), ("18_1_1",
"22B91"),
("18_2", "22C152"), ("18_2_1", "22C161"), ("18_3", "22D63"), ("18_3_1",
"22D72"),
("18_3_2", "22D82"), ("18_4", "22E240"), ("18_4_1", "22E252"), ("18_5",
"22F76"), ("18_6", "22G86"),
]

# Instagram versions
instagram_versions = [
"[Link].123", "[Link].91", "[Link].70"
"[Link].115", "[Link].122", "[Link].100", "[Link].112"
"[Link].105", "[Link].108", "[Link].121", "[Link].97"
"[Link].107", "[Link].89"
]

# Locales
locales = [
("en_US", "en"),
]

def generate_instagram_iphone_ua():
device, (res, scale) = [Link](list(iphone_models.items()))
ios_version, build = [Link](ios_versions)
ig_version = [Link](instagram_versions)
locale_full, locale = [Link](locales)
random_number = [Link](700000000, 799999999)

ua = (
f"Mozilla/5.0 (iPhone; CPU iPhone OS {ios_version} like Mac OS X) "
f"AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/{build} "
f"Instagram {ig_version} "
f"({device};iOS{ios_version};{locale_full};{locale};scale={scale};{res};
{random_number};IABMV/1)"
)
return ua

# Generate and print 500 example user agents


for _ in range(500):
print(generate_instagram_iphone_ua())

You might also like