Skip to content

Commit 14caf6d

Browse files
committed
[submodule:extensions] Add new library: java, python-urllib, python-requests
1 parent 4a12562 commit 14caf6d

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

src/extensions/ua-parser-extensions.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ const MediaPlayers = Object.freeze({
293293
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
294294

295295
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
296-
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
297-
// Java/urllib/requests/wget/cURL
298296
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
299297
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
300298

@@ -370,8 +368,8 @@ const MediaPlayers = Object.freeze({
370368

371369
const Libraries = Object.freeze({
372370
browser : [
373-
// Axios/jsdom/Scrapy
374-
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
371+
// Axios/jsdom/Scrapy/Java/urllib/requests
372+
[/\b(axios|jsdom|scrapy|java|python-urllib|python-requests)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
375373
]
376374
});
377375

test/specs/browser-libraries.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,54 @@
11
[
2+
{
3+
"desc" : "Axios",
4+
"ua" : "axios/1.7.2",
5+
"expect" :
6+
{
7+
"name" : "axios",
8+
"version" : "1.7.2",
9+
"type" : "library"
10+
}
11+
},
12+
{
13+
"desc" : "Java",
14+
"ua" : "Java/1.6.0_14",
15+
"expect" :
16+
{
17+
"name" : "Java",
18+
"version" : "1.6.0_14",
19+
"type" : "library"
20+
}
21+
},
22+
{
23+
"desc" : "jsdom",
24+
"ua" : "Mozilla/5.0 (unknown OS) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/11.12.0",
25+
"expect" :
26+
{
27+
"name" : "jsdom",
28+
"version" : "11.12.0",
29+
"type" : "library"
30+
}
31+
},
32+
{
33+
"desc" : "Python urllib",
34+
"ua" : "Python-urllib/2.6",
35+
"expect" :
36+
{
37+
"name" : "Python-urllib",
38+
"version" : "2.6",
39+
"type" : "library"
40+
}
41+
},
42+
{
43+
"desc" : "Python requests",
44+
"ua" : "python-requests/2.32",
45+
"expect" :
46+
{
47+
"name" : "python-requests",
48+
"version" : "2.32",
49+
"type" : "library"
50+
}
51+
},
252
{
353
"desc" : "Scrapy",
454
"ua" : "Scrapy/1.5.0 (+https://scrapy.org)",

0 commit comments

Comments
 (0)