@alitu/user-agents-v2-api 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,94 @@
1
+ {
2
+ "comments": [
3
+ "Look for User-Agent matches in this file order: 'bots', 'apps', 'libraries', 'browsers', and return the first entry matched, processing each entry in order in which they appear in the file.",
4
+ "If the match entry is from this file (i.e. not a bot), you can also match the User-Agent header against the 'devices' file to identity device and category.",
5
+ "If the match entry is a Browser (i.e. in this file), you can also match the Referer header against the 'referers' file to identify web-based apps and other known web entities."
6
+ ],
7
+ "$schema": "https://raw.githubusercontent.com/opawg/user-agents-v2/master/schemas/patterns.schema.json",
8
+ "entries": [
9
+ {
10
+ "name": "Brave",
11
+ "pattern": ".+[Bb]rave"
12
+ },
13
+ {
14
+ "name": "Opera",
15
+ "pattern": "Opera/|Macintosh.*OPR/|Windows.*OPR/|Mobile/.* OPT/",
16
+ "examples": [
17
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36 OPR/72.0.3815.186",
18
+ "Mozilla/5.0 (iPad; CPU OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 OPT/3.2.13"
19
+ ],
20
+ "comments": "Must match above Chrome"
21
+ },
22
+ {
23
+ "name": "Edge",
24
+ "pattern": "(Xbox.+Edg?/|Android.+EdgA/|iPhone.+EdgiOS/|Macintosh.+MacEdgeClient/|Windows Phone.+Edge?/|Windows.+Edge?/)",
25
+ "examples": [
26
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64; WebView/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"
27
+ ],
28
+ "comments": "Must match above Chrome"
29
+ },
30
+ {
31
+ "name": "Chrome",
32
+ "pattern": "^.*Android.*Chrome/|CrOS.*Chrome/|Linux.*Chrome/|Mac OS X.*Chrome/|Windows.*Chrome/|iPad.*CriOS/|iPhone.*CriOS/|^Chrome/\\d.*CFNetwork",
33
+ "examples": [
34
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36",
35
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36",
36
+ "Chrome/103.0.5060.63 CFNetwork/1390 Darwin/22.0.0"
37
+ ],
38
+ "comments": "Must match below Edge"
39
+ },
40
+ {
41
+ "name": "Firefox",
42
+ "pattern": "Firefox/|(Android|iPhone|iPad).*Focus/| FxiOS/",
43
+ "examples": [
44
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0",
45
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/100 Mobile/15E148 Version/15.0"
46
+ ]
47
+ },
48
+ {
49
+ "name": "Internet Explorer",
50
+ "pattern": "MSIE | Trident/",
51
+ "examples": [
52
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)",
53
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
54
+ ]
55
+ },
56
+ {
57
+ "name": "NCSA Mosaic",
58
+ "pattern": "^NCSA Mosaic/",
59
+ "examples": [
60
+ "NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)"
61
+ ]
62
+ },
63
+ {
64
+ "name": "DuckDuckGo",
65
+ "pattern": "^DuckDuckGo",
66
+ "examples": [
67
+ "DuckDuckGo/3 CFNetwork/1494.0.7 Darwin/23.4.0"
68
+ ],
69
+ "comments": "Not a bot; but a downloadable browser on iOS"
70
+ },
71
+ {
72
+ "name": "Safari",
73
+ "pattern": "Macintosh.*AppleWebKit.*Safari/|Windows.*AppleWebKit.*Safari/|iPhone.*AppleWebKit.*Safari/|iPad.*AppleWebKit.*Safari/|^MobileSafari/|^Safari/",
74
+ "comments": "Must match below Chrome",
75
+ "examples": [
76
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15",
77
+ "MobileSafari/604.1 CFNetwork/1107.1 Darwin/19.0.0",
78
+ "Safari/18614.4.6.1.6 CFNetwork/1404.0.5 Darwin/22.3.0"
79
+ ]
80
+ },
81
+ {
82
+ "name": "iOS WebView",
83
+ "pattern": "Mozilla/5\\.0 \\([A-Za-z ]+; CPU( iPhone)? OS [\\d_]+ like Mac OS X\\) AppleWebKit/[\\d.]+ \\(KHTML, like Gecko\\) Mobile/[0-9A-Z]{6,}",
84
+ "description": "Default for UIWebView and WKWebView if apps do not customize",
85
+ "comments": "Be extremely specific to avoid false positives. Versions frozen (like Safari) to avoid fingerprinting: https://twitter.com/rmondello/status/943545865204989953?s=20",
86
+ "examples": [
87
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
88
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
89
+ "Mozilla/5.0 (iPad; CPU OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E1480",
90
+ "Mozilla/5.0 (iPod touch; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
91
+ ]
92
+ }
93
+ ]
94
+ }
@@ -0,0 +1,198 @@
1
+ {
2
+ "comments": [
3
+ "If the match entry is not a bot, you can also match the User-Agent header against this file to identity device and category."
4
+ ],
5
+ "$schema": "https://raw.githubusercontent.com/opawg/user-agents-v2/master/schemas/patterns.schema.json",
6
+ "entries": [
7
+ {
8
+ "name": "Apple HomePod",
9
+ "pattern": "HomePod|^AirPodcasts/\\d",
10
+ "category": "smart_speaker",
11
+ "examples": [
12
+ "AirPodcasts/4022.700.8 CFNetwork/1410.0.3 Darwin/22.6.0"
13
+ ]
14
+ },
15
+ {
16
+ "name": "Apple iPad",
17
+ "pattern": "ipad|iPad|IPAD",
18
+ "category": "mobile"
19
+ },
20
+ {
21
+ "name": "Apple TV",
22
+ "pattern": "Apple TV|AppleTV|apple;apple_tv",
23
+ "category": "smart_tv",
24
+ "examples": [
25
+ "apple;apple_tv;33ddb95064d1479ab37179579af23b77;;tpapi;3.200.405",
26
+ "AppleCoreMedia/1.0.0.20K71 (Apple TV; U; CPU OS 16_1 like Mac OS X; en_au)"
27
+ ]
28
+ },
29
+ {
30
+ "name": "Apple iPhone",
31
+ "pattern": "iphone|iOS|iPhone|CFNetwork| ios |phone;ios",
32
+ "category": "mobile",
33
+ "examples": [
34
+ "Fountain/0.5.3 ios https://www.fountain.fm",
35
+ "Anytime/1.1 b64 (phone;ios Version 15.6.1 (Build 19G82)) https://github.com/amugofjava/anytime_podcast_player"
36
+ ]
37
+ },
38
+ {
39
+ "name": "Apple Watch",
40
+ "pattern": "watch|Watch OS",
41
+ "category": "watch"
42
+ },
43
+ {
44
+ "name": "Apple iPod",
45
+ "pattern": "iPod|IPOD",
46
+ "category": "mobile"
47
+ },
48
+ {
49
+ "name": "Apple Computer",
50
+ "pattern": "OS X|OSX|Macintosh|Macbook",
51
+ "category": "computer"
52
+ },
53
+ {
54
+ "name": "Google Home",
55
+ "pattern": "GoogleChirp|Google-Speech-Actions|CrKey.*DeviceType/SmartSpeaker",
56
+ "category": "smart_speaker",
57
+ "examples": [
58
+ "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.225 Safari/537.36 CrKey/1.56.500000 DeviceType/SmartSpeaker"
59
+ ]
60
+ },
61
+ {
62
+ "name": "Google Chromebook",
63
+ "pattern": "Chromebook|CrOS",
64
+ "category": "computer"
65
+ },
66
+ {
67
+ "name": "Android Tablet",
68
+ "pattern": "[a|A]ndroid.*[t|T]ablet|[t|T]ablet.*[a|A]ndroid|SM-T| GT-|^ZTE;Xview",
69
+ "category": "mobile",
70
+ "examples": [
71
+ "ZTE;Xview;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454"
72
+ ]
73
+ },
74
+ {
75
+ "name": "Other Smart TV",
76
+ "pattern": "SmartTV|[Rr]oku|CrKey|AFTT Build|AFTM Build|BRAVIA 4K|Opera TV|SmartTv|TSBNetTV|SMART-TV|TV Safari|WebTV|InettvBrowser|GoogleTV|HbbTV|smart-tv|olleh tv|^sony_tv;ps5;|Microsoft Xbox|^Google;Chromecast|^TCL;|^Xiaomi;(MIBOX|MiTV-)|^samsung;[uq][nej]\\d|^hisense;(c235x|c205x)|^skyworth;NoblexTV|^Sony;BRAVIA|^tcl;(c1\\d{2}x|7140x)|^onn\\.;8821x|^Funai;PHILIPS4KTV|^Sagemcom;VSB|^TPV;[A-Z0-9]+AndroidTV;|^(CVT_NULL|MediaTek);SMARTTV;|^NVIDIA;SHIELDAndroidTV|UHDAndroidTV;|^westinghouse;7808x;|^ZTE;B820C",
77
+ "category": "smart_tv",
78
+ "comments": "Must be before Android Phones",
79
+ "examples": [
80
+ "CVT_NULL;SMARTTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.127.32",
81
+ "Funai;PHILIPS4KTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
82
+ "Google;ChromecastHD;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
83
+ "hisense;c205x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
84
+ "hisense;c235x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
85
+ "Hisense;HiSmartTVA4;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
86
+ "MediaTek;SMARTTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.127.32",
87
+ "Microsoft Xbox",
88
+ "NVIDIA;SHIELDAndroidTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.202.356",
89
+ "onn.;8821x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
90
+ "roku;3930mx;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
91
+ "Sagemcom;VSB3940_TPL;4501664231eb4355ab482f1ca12dc38a;;tpapi;3.199.315",
92
+ "samsung;qn55q60rafxza;568a50c7e7f64fe3b44a3316ef5590fd;;tpapi;3.194.71",
93
+ "samsung;ue50tu7020wxxn;568a50c7e7f64fe3b44a3316ef5590fd;;tpapi;3.194.71",
94
+ "samsung;uj5500;568a50c7e7f64fe3b44a3316ef5590fd;;tpapi;3.167.55",
95
+ "samsung;un43mu6100;568a50c7e7f64fe3b44a3316ef5590fd;;tpapi;3.194.71",
96
+ "samsung;un50ru7100fxzc;568a50c7e7f64fe3b44a3316ef5590fd;;tpapi;3.194.71",
97
+ "samsung;un50tu7000g;568a50c7e7f64fe3b44a3316ef5590fd;;tpapi;3.194.71",
98
+ "skyworth;NoblexTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
99
+ "sony_tv;ps5;9b18101888dd42948afd0b8792122bec;;tpapi;3.200.405",
100
+ "Sony;BRAVIA4KUR3;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
101
+ "Sony;BRAVIA4KVH2;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
102
+ "tcl;7140x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
103
+ "tcl;c102x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
104
+ "tcl;c105x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
105
+ "tcl;c112x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.200.454",
106
+ "TCL;UnionTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
107
+ "TPV;20202021UHDAndroidTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
108
+ "TPV;202122PhilipsUHDAndroidTV;756a522d9f1648b89e76e80be654456a;;tpapi;3.202.356",
109
+ "westinghouse;7808x;4916bf2fd1c54ff2bace038314d21f39;;tpapi;3.203.233",
110
+ "Xiaomi;MIBOX4;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
111
+ "Xiaomi;MiTV-AESP0;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
112
+ "Xiaomi;MiTV-MOOQ0;756a522d9f1648b89e76e80be654456a;;tpapi;3.200.454",
113
+ "ZTE;B820C-A15;756a522d9f1648b89e76e80be654456a;;tpapi;3.202.356"
114
+ ]
115
+ },
116
+ {
117
+ "name": "Android Phone",
118
+ "pattern": "ServeStream|Android|android|HTC|ExoPlayer|^AntennaPod/|^GSA/.*\\.arm(64)?$|^sp-agent|^PRDownloader$|^(Turtlecast|TURTLECAST)\/",
119
+ "category": "mobile",
120
+ "comments": "Must be after CrKey and Android Tablet",
121
+ "examples": [
122
+ "GSA/13.39.12.26.arm64",
123
+ "GSA/13.39.12.26.arm",
124
+ "sp-agent",
125
+ "FileDownloader (Android)",
126
+ "PRDownloader",
127
+ "TURTLECAST/0.5.1"
128
+ ]
129
+ },
130
+ {
131
+ "name": "Windows Computer",
132
+ "pattern": "Windows|windows|WMPlayer|Winamp|Win32|Win64|NSPlayer|MediaMonkey|NSPlayer|PC",
133
+ "category": "computer"
134
+ },
135
+ {
136
+ "name": "Amazon Smart Speaker",
137
+ "pattern": "Alexa|^Echo/|^Amazon;Echo",
138
+ "category": "smart_speaker",
139
+ "examples": [
140
+ "Amazon;Echo_Pop;27d4dfe427b34d57995b463e5d63198d;;tpapi;3.199.422",
141
+ "Amazon;Echo_Dot;27d4dfe427b34d57995b463e5d63198d;;tpapi;3.199.422",
142
+ "Amazon;Echo_Dot_with_clock;27d4dfe427b34d57995b463e5d63198d;;tpapi;3.199.422",
143
+ "Amazon;Echo_Show_5;27d4dfe427b34d57995b463e5d63198d;;tpapi;3.199.422",
144
+ "Amazon;Echo;27d4dfe427b34d57995b463e5d63198d;;tpapi;3.199.422"
145
+ ]
146
+ },
147
+ {
148
+ "name": "Other Smart Speaker",
149
+ "pattern": "sonos|Sonos|^Bose/|^VictorReader|^Bose;Bose_(Home_Speaker|Soundbar|Portable_Home|Smart_Speaker)|^HEOS;DENON|^Denon;DENON-DWHS|^Storybutton/|^Bluesound;|^Yamaha;WX-",
150
+ "category": "smart_speaker",
151
+ "examples": [
152
+ "Bluesound;N110;3d1292a4f7bc4cbc853faa331d07348a;;tpapi;3.194.61",
153
+ "Bluesound;N125;3d1292a4f7bc4cbc853faa331d07348a;;tpapi;3.194.61",
154
+ "Bluesound;N130;3d1292a4f7bc4cbc853faa331d07348a;;tpapi;3.194.61",
155
+ "Bluesound;N225v2;3d1292a4f7bc4cbc853faa331d07348a;;tpapi;3.194.61",
156
+ "Bluesound;N330;3d1292a4f7bc4cbc853faa331d07348a;;tpapi;3.194.61",
157
+ "Bluesound;P125;3d1292a4f7bc4cbc853faa331d07348a;;tpapi;3.194.61",
158
+ "Bose;Bose_Home_Speaker_500;1d2cf25b1643474983fae381b00cea3c;;tpapi;3.198.103",
159
+ "Bose;Bose_Home_Speaker_500",
160
+ "Bose;Bose_Portable_Home_Speaker;1d2cf25b1643474983fae381b00cea3c;;tpapi;3.198.103",
161
+ "Bose;Bose_Smart_Speaker_500;1d2cf25b1643474983fae381b00cea3c;;tpapi;3.198.103",
162
+ "Bose;Bose_Soundbar_700;1d2cf25b1643474983fae381b00cea3c;;tpapi;3.198.103",
163
+ "Denon;DENON-DWHS_60-150;8f2c0cd9c29f44b39c868f9c7055662c;;tpapi;3.202.330",
164
+ "HEOS;DENON-DWA_40-200;3c043256d0a14590ab901fdc062e55c7;;tpapi;3.202.330",
165
+ "Storybutton/1.0",
166
+ "Yamaha;WX-021;59c7bf046992472ab0689f5fc7fa08e2;1810 ;tpapi;3.201.417"
167
+ ]
168
+ },
169
+ {
170
+ "name": "Other Computer",
171
+ "pattern": "Lavf/|desktop|Linux|linux|VLC|^okhttp/|CastBox/",
172
+ "category": "computer"
173
+ },
174
+ {
175
+ "name": "Other Tablet",
176
+ "pattern": "tablet|Tablet",
177
+ "category": "mobile"
178
+ },
179
+ {
180
+ "name": "Other Watch",
181
+ "pattern": "watch|Watch|^Garmin ",
182
+ "category": "watch"
183
+ },
184
+ {
185
+ "name": "Other Mobile Device",
186
+ "pattern": "Player FM$|^Podkicker\/|spotify_unknown|^Castro|^Swoot Agent| KAIOS/|^Zune/|^PodcastGuru |^Pocket Casts$|^AmazonMusic$|RTL\\+",
187
+ "category": "mobile",
188
+ "examples": [
189
+ "Mozilla/5.0 (Mobile; Nokia_8110_4G; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5.1 PodKast",
190
+ "Zune/4.8",
191
+ "PodcastGuru 2.0.2-beta3",
192
+ "Pocket Casts",
193
+ "AmazonMusic",
194
+ "RTL+"
195
+ ]
196
+ }
197
+ ]
198
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var apps = require("./apps.json");
15
+ var bots = require("./bots.json");
16
+ var browsers = require("./browsers.json");
17
+ var devices = require("./devices.json");
18
+ var libraries = require("./libraries.json");
19
+ var referrers = require("./referrers.json");
20
+ /**
21
+ * Extract entries from User-Agent lists and create RegExp for patterns.
22
+ * @param {OPAWGPatternsFile} file patterns file
23
+ * @returns {OPAWGPatternEntry[]} array of entries with RegExps
24
+ */
25
+ function initializePatternFile(_a) {
26
+ var entries = _a.entries;
27
+ return entries.map(function (entry) {
28
+ return __assign(__assign({}, entry), { regexp: new RegExp(entry.pattern) });
29
+ });
30
+ }
31
+ exports.default = {
32
+ apps: initializePatternFile(apps),
33
+ bots: initializePatternFile(bots),
34
+ browsers: initializePatternFile(browsers),
35
+ devices: initializePatternFile(devices),
36
+ libraries: initializePatternFile(libraries),
37
+ referrers: initializePatternFile(referrers),
38
+ };