update user agent parser

This commit is contained in:
rolux 2012-08-15 17:58:46 +02:00
parent d73784c8c6
commit cfd84e916a

View file

@ -54,61 +54,85 @@ UA_ALIASES = {
UA_NAMES = { UA_NAMES = {
'browser': { 'browser': {
'chromeframe': 'Chrome Frame', 'chromeframe': 'Chrome Frame',
'Gecko': 'Mozilla',
'Mozilla': 'Netscape',
'MSIE': 'Internet Explorer' 'MSIE': 'Internet Explorer'
}, },
'robot': {}, 'robot': {},
'system': { 'system': {
'CPU OS': 'iOS', 'CPU OS': 'iOS',
'iPhone': 'iOS',
'iPhone OS': 'iOS', 'iPhone OS': 'iOS',
'Macintosh': 'Mac OS X' 'Mac_PowerPC': 'Mac OS',
'Mac_PPC': 'Mac OS',
'Macintosh': 'Mac OS',
'Win': 'Windows',
'X11': 'Linux'
} }
} }
UA_REGEXPS = { UA_REGEXPS = {
'browser': [ 'browser': [
'(Camino)\/(\d+)', '(Camino)\/(\d+)',
'(Chimera)\/(\d+)',
'(chromeframe)\/(\d+)', '(chromeframe)\/(\d+)',
'(Chrome)\/(\d+)', '(Chrome)\/(\d+)',
'(Epiphany)\/(\d+)', '(Epiphany)\/(\d+)',
'(Firefox)\/(\d+)', '(Firefox)\/(\d+)',
'(Galeon)\/(\d+)', '(Galeon)\/(\d+)',
'(iCab) (\d+)',
'(iCab)\/(\d+)',
'(Konqueror)\/(\d+)', '(Konqueror)\/(\d+)',
'(MSIE) (\d+)', '(Lynx)\/(\d+)',
'(Netscape)\d?\/(\d+)', '(Netscape)\d?\/(\d+)',
'(NokiaBrowser)\/(\d+)', '(NokiaBrowser)\/(\d+)',
'(OmniWeb)\/(\d+)',
'(Opera) (\d+)', '(Opera) (\d+)',
'(Opera)\/(\d+)',
'(Opera)\/.+Version\/(\d+)', '(Opera)\/.+Version\/(\d+)',
'Version\/(\d+).+(Safari)', 'Version\/(\d+).+(Safari)',
'(WebKit)\/(\d+)' '(WebKit)\/(\d+)',
'(MSIE) (\d+)', # last, since Opera used to mask as MSIE
'(Gecko)',
'(Mozilla)\/(3|4)'
], ],
'robot': [ 'robot': [
'(BingPreview)\/(\d+)', '(BingPreview)\/(\d+)',
'(Google Web Preview).+Chrome\/(\d+)', '(Google Web Preview).+Chrome\/(\d+)',
'(Googlebot)\/(\d+)' '(Googlebot)\/(\d+)',
'(WebCrawler)\/(\d+)'
], ],
'system': [ 'system': [
'(Android) (\d+)', '(Android) (\d+)',
'(BeOS)', '(BeOS)',
'(BlackBerry) (\d+)', '(BlackBerry) (\d+)',
'(BlackBerry)',
'(Darwin)', '(Darwin)',
'(BSD) (FreeBSD|NetBSD|OpenBSD)', '(BSD) (FreeBSD|NetBSD|OpenBSD)',
'(CPU OS) (\d+)', '(CPU OS) (\d+)',
'(iPhone OS) (\d+)', '(iPhone OS) (\d+)',
'(iPhone)', # Opera
'(Linux).+(CentOS|CrOS|Debian|Fedora|Gentoo|Mandriva|MeeGo|Mint|Red Hat|SUSE|Ubuntu|webOS)', '(Linux).+(CentOS|CrOS|Debian|Fedora|Gentoo|Mandriva|MeeGo|Mint|Red Hat|SUSE|Ubuntu|webOS)',
'(CentOS|CrOS|Debian|Fedora|Gentoo|Mandriva|MeeGo|Mint|Red Hat|SUSE|Ubuntu|webOS).+(Linux)', '(CentOS|CrOS|Debian|Fedora|Gentoo|Mandriva|MeeGo|Mint|Red Hat|SUSE|Ubuntu|webOS).+(Linux)',
'(Linux)', '(Linux)',
'(Mac OS X) (10.\d)', '(Mac OS X) (10.\d)',
'(Mac OS X)', '(Mac OS X)',
'(Mac_PowerPC)',
'(Mac_PPC)',
'(Macintosh)', '(Macintosh)',
'(Symbian OS)',
'(SymbianOS)\/(\d+)', '(SymbianOS)\/(\d+)',
'(SymbOS)', '(SymbOS)',
'(OS\/2)', '(OS\/2)',
'(Unix) (AIX|HP-UX|IRIX|SunOS)', '(Unix) (AIX|HP-UX|IRIX|SunOS)',
'(Unix)', '(Unix)',
'(Windows) (NT \d\.\d)', '(Windows) (NT \d\.\d)',
'(Windows) (95|98|2000|2003|ME|NT|XP)', # Opera '(Windows) (3\.1|95|98|2000|2003|CE|ME|Mobile|NT|XP)', # Opera
'(Windows).+(Win 9x 4\.90)', # Firefox '(Win) (9x 4\.90)', # Firefox
'(Windows).+(Win9\d)', # Firefox '(Win)(16)', # Firefox
'(Windows).+(WinNT4.0)' # Firefox '(Win)(9\d)', # Firefox
'(Win)(NT)', # Firefox
'(Win)(NT4\.0)', # Firefox
'(X11)'
] ]
} }
UA_VERSIONS = { UA_VERSIONS = {
@ -125,25 +149,27 @@ UA_VERSIONS = {
'10.7': '10.7 (Lion)', '10.7': '10.7 (Lion)',
'10.8': '10.8 (Mountain Lion)', '10.8': '10.8 (Mountain Lion)',
'CrOS': 'Chrome OS', 'CrOS': 'Chrome OS',
'NT 3.1': 'NT 3.1 (3.1)',
'NT 3.5': 'NT 3.5 (NT)',
'NT 4.0': 'NT 4.0 (NT)', 'NT 4.0': 'NT 4.0 (NT)',
'NT 4.1': 'NT 4.1 (98)', 'NT 4.1': 'NT 4.1 (98)',
'Win 9x 4.90': 'NT 4.9 (ME)', '9x 4.90': 'NT 4.9 (ME)',
'NT 5.0': 'NT 5.0 (2000)', 'NT 5.0': 'NT 5.0 (2000)',
'NT 5.1': 'NT 5.1 (XP)', 'NT 5.1': 'NT 5.1 (XP)',
'NT 5.2': 'NT 5.2 (2003)', 'NT 5.2': 'NT 5.2 (2003)',
'NT 6.0': 'NT 6.0 (Vista)', 'NT 6.0': 'NT 6.0 (Vista)',
'NT 6.1': 'NT 6.1 (7)', 'NT 6.1': 'NT 6.1 (7)',
'NT 6.2': 'NT 6.2 (8)', 'NT 6.2': 'NT 6.2 (8)',
'16': 'NT 3.1 (3.1)',
'3.1': 'NT 3.1 (3.1)',
'95': 'NT 4.0 (95)', '95': 'NT 4.0 (95)',
'NT': 'NT 4.0 (NT)', 'NT': 'NT 4.0 (NT)',
'NT4.0': 'NT 4.0 (NT)',
'98': 'NT 4.1 (98)', '98': 'NT 4.1 (98)',
'ME': 'NT 4.9 (ME)', 'ME': 'NT 4.9 (ME)',
'2000': 'NT 5.0 (2000)', '2000': 'NT 5.0 (2000)',
'2003': 'NT 5.2 (2003)',
'XP': 'NT 5.1 (XP)', 'XP': 'NT 5.1 (XP)',
'Win95': 'NT 4.0 (95)', '2003': 'NT 5.2 (2003)'
'WinNT4.0': 'NT 4.0 (NT)',
'Win98': 'NT 4.1 (98)'
} }
} }