Skip to content

Commit

Permalink
Merge branch 'master' into browsers1
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuconcioiu committed Apr 1, 2024
2 parents 5475bbb + 09c5f93 commit 0fb50a6
Show file tree
Hide file tree
Showing 31 changed files with 3,483 additions and 147 deletions.
23 changes: 14 additions & 9 deletions Parser/Client/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class Browser extends AbstractClientParser
'BE' => 'Beonex',
'B2' => 'Berry Browser',
'BT' => 'Bitchute Browser',
'9B' => 'BizBrowser',
'BH' => 'BlackHawk',
'B0' => 'Bloket',
'BJ' => 'Bunjalloo',
Expand Down Expand Up @@ -344,12 +345,14 @@ class Browser extends AbstractClientParser
'KP' => 'Kapiko',
'KE' => 'Keyboard Browser',
'KN' => 'Kinza',
'K4' => 'Kitt',
'KW' => 'Kiwi',
'KD' => 'Kode Browser',
'KT' => 'KUTO Mini Browser',
'KY' => 'Kylo',
'KZ' => 'Kazehakase',
'LB' => 'Cheetah Browser',
'LD' => 'Ladybird',
'LA' => 'Lagatos Browser',
'GN' => 'Legan Browser',
'LR' => 'Lexi Browser',
Expand Down Expand Up @@ -542,6 +545,7 @@ class Browser extends AbstractClientParser
'SY' => 'Sizzy',
'K3' => 'Skye',
'SK' => 'Skyfire',
'KL' => 'SkyLeap',
'SS' => 'Seraphic Sraf',
'KK' => 'SiteKiosk',
'SL' => 'Sleipnir',
Expand Down Expand Up @@ -683,9 +687,9 @@ class Browser extends AbstractClientParser
'Baidu' => ['BD', 'BS'],
'Amiga' => ['AV', 'AW'],
'Chrome' => [
'1B', '2B', '7S', 'A0', 'AC', 'A4', 'AE', 'AH', 'AI',
'CH', '2B', '7S', 'A0', 'AC', 'A4', 'AE', 'AH', 'AI',
'AO', 'AS', 'BA', 'BM', 'BR', 'C2', 'C3', 'C5', 'C4',
'C6', 'CC', 'CD', 'CE', 'CF', 'CG', 'CH', 'CI', 'CL',
'C6', 'CC', 'CD', 'CE', 'CF', 'CG', '1B', 'CI', 'CL',
'CM', 'CN', 'CP', 'CR', 'CV', 'CW', 'DA', 'DD', 'DG',
'DR', 'EC', 'EE', 'EU', 'EW', 'FA', 'FS', 'GB', 'GI',
'H2', 'HA', 'HE', 'HH', 'HS', 'I3', 'IR', 'JB', 'KN',
Expand All @@ -711,22 +715,23 @@ class Browser extends AbstractClientParser
'N3', 'GD', 'O9', 'Q3', 'F7', 'K2', 'P5', 'H5', 'V3',
'K3', 'Q4', 'G2', 'R2', 'WX', 'XP', '3I', 'BG', 'R0',
'JO', 'OL', 'GN', 'W4', 'QI', 'E1', 'RI', '8B', '5B',
'K4',
],
'Firefox' => [
'AX', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
'FB', 'FE', 'FF', 'FM', 'FR', 'FY', 'GZ', 'I4', 'IF',
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',
'FB', 'FE', 'AX', 'FM', 'FR', 'FY', 'GZ', 'I4', 'IF',
'IW', 'LH', 'LY', 'MB', 'MN', 'MO', 'MY', 'OA', 'OS',
'PI', 'PX', 'QA', 'S5', 'SX', 'TF', 'TO', 'WF', 'ZV',
'FP', 'AD', 'WL', '2I', 'P9', 'KJ', 'WY', 'VK', 'W5',
'7C',
],
'Internet Explorer' => ['BZ', 'CZ', 'IE', 'IM', 'PS', '3A', '4A', 'RN'],
'Internet Explorer' => ['IE', 'CZ', 'BZ', 'IM', 'PS', '3A', '4A', 'RN'],
'Konqueror' => ['KO'],
'NetFront' => ['NF'],
'NetSurf' => ['NE'],
'Nokia Browser' => ['DO', 'NB', 'NO', 'NV'],
'Opera' => ['O1', 'OG', 'OH', 'OI', 'OM', 'ON', 'OO', 'OP', 'OX', 'Y1'],
'Safari' => ['MF', 'S7', 'SF', 'SO', 'PV'],
'Nokia Browser' => ['NB', 'DO', 'NO', 'NV'],
'Opera' => ['OP', 'OG', 'OH', 'OI', 'OM', 'ON', 'OO', 'O1', 'OX', 'Y1'],
'Safari' => ['SF', 'S7', 'MF', 'SO', 'PV'],
'Sailfish Browser' => ['SA'],
];

Expand Down Expand Up @@ -756,7 +761,7 @@ class Browser extends AbstractClientParser
'H5', 'V3', 'G2', 'BG', 'OL', 'II', 'TL', 'M6', 'Y3',
'M7', 'GN', 'D3', 'IG', 'HW', '4O', 'OU', '5P', 'KE',
'5A', 'TT', '6P', 'G3', '7P', 'VU', 'F8', 'L4', 'DK',
'DP',
'DP', 'KL', 'K4',
];

/**
Expand Down
1 change: 1 addition & 0 deletions Parser/Client/Browser/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Engine extends AbstractClientParser
'Goanna',
'EkiohFlow',
'Arachne',
'LibWeb',
];

/**
Expand Down
4 changes: 4 additions & 0 deletions Parser/Client/Browser/Engine/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function parse(): ?array
$engineToken = 'Arachne\/5\.';
}

if ('LibWeb' === $this->engine) {
$engineToken = 'LibWeb\+LibJs';
}

\preg_match(
"~(?:{$engineToken})\s*/?\s*((?(?=\d+\.\d)\d+[.\d]*|\d{1,7}(?=(?:\D|$))))~i",
$this->userAgent,
Expand Down
4 changes: 4 additions & 0 deletions Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ abstract class AbstractDeviceParser extends AbstractParser
'ARP' => 'Airpha',
'AT' => 'Airties',
'7U' => 'Airtel',
'AIT' => 'AirTouch',
'U0' => 'AIRON',
'0A' => 'AIS',
'AW' => 'Aiwa',
Expand Down Expand Up @@ -542,6 +543,7 @@ abstract class AbstractDeviceParser extends AbstractParser
'EI' => 'Ezio',
'EZ' => 'Ezze',
'UF' => 'EYU',
'EYE' => 'Eyemoo',
'UE1' => 'UE',
'5F' => 'F150',
'FPS' => 'F+',
Expand Down Expand Up @@ -1526,6 +1528,7 @@ abstract class AbstractDeviceParser extends AbstractParser
'SYC' => 'Syco',
'SM' => 'Symphony',
'4S' => 'Syrox',
'SYS' => 'System76',
'TM' => 'T-Mobile',
'T96' => 'T96',
'TAD' => 'TADAAM',
Expand Down Expand Up @@ -1611,6 +1614,7 @@ abstract class AbstractDeviceParser extends AbstractParser
'5R' => 'Transpeed',
'T6' => 'TrekStor',
'T3' => 'Trevi',
'TRI' => 'TriaPlay',
'TJ' => 'Trifone',
'Q5' => 'Trident',
'4T' => 'Tronsmart',
Expand Down
18 changes: 9 additions & 9 deletions README.md

Large diffs are not rendered by default.

67 changes: 65 additions & 2 deletions Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1229,8 +1229,8 @@
type: browser
name: Opera Touch
version: "1.10.36"
engine: Blink
engine_version: ""
engine: WebKit
engine_version: "605.1.15"
family: Opera
-
user_agent: Opera/9.80 (J2ME/MIDP; Opera Mini; U; en) Presto/2.12.423 Version/12.16
Expand Down Expand Up @@ -9023,6 +9023,42 @@
engine: WebKit
engine_version: 605.1.15
family:
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X; zh-cn) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/20A362 Quark/5.8.9.1457 Mobile
client:
type: browser
name: Quark
version: "5.8.9.1457"
engine: WebKit
engine_version: "601.1.46"
family: Chrome
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_8_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Version/14.8.1 Safari/605.1.15; SkyLeap/1.31.2
client:
type: browser
name: SkyLeap
version: "1.31.2"
engine: WebKit
engine_version: "605.1.15"
family: ""
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H321 sppm_bizbrowser
client:
type: browser
name: BizBrowser
version: ""
engine: WebKit
engine_version: "600.1.4"
family: ""
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69 Safari/9537.53 Kitt/1.3.7/3
client:
type: browser
name: Kitt
version: "1.3.7"
engine: WebKit
engine_version: "601.1.46"
family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/4.5 Chrome/83.0.4103.120 Safari/537.36
client:
Expand Down Expand Up @@ -9325,3 +9361,30 @@
engine: Arachne
engine_version: "1.95"
family: ""
-
user_agent: Mozilla/5.0 (Linux; x86_64) Ladybird/1.0
client:
type: browser
name: Ladybird
version: "1.0"
engine: LibWeb
engine_version: ""
family: ""
-
user_agent: Mozilla/5.0 (SerenityOS; x86_64) LibWeb+LibJS/1.0 Browser/1.0
client:
type: browser
name: Ladybird
version: "1.0"
engine: LibWeb
engine_version: "1.0"
family: ""
-
user_agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3pre) Gecko/20070307 Firefox/2.0.0.3pre (Swiftfox)
client:
type: browser
name: Swiftfox
version: "2.0.0.3"
engine: Gecko
engine_version: "1.8.1.3"
family: Firefox
18 changes: 12 additions & 6 deletions Tests/Parser/Client/fixtures/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
client:
type: library
name: Wget
version:
version: ""
-
user_agent: curl/7.21.0 (i386-redhat-linux-gnu) libcurl/7.21.0 NSS/3.12.10.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.4
client:
Expand Down Expand Up @@ -52,7 +52,7 @@
client:
type: library
name: Python urllib
version:
version: ""
-
user_agent: Java/1.7.0_51
client:
Expand Down Expand Up @@ -244,7 +244,7 @@
client:
type: library
name: uTorrent
version:
version: ""
-
user_agent: aria2/1.33.1
client:
Expand All @@ -262,7 +262,7 @@
client:
type: library
name: uclient-fetch
version:
version: ""
-
user_agent: cpprestsdk/2.8.0
client:
Expand Down Expand Up @@ -310,7 +310,7 @@
client:
type: library
name: Windows HTTP
version:
version: ""
-
user_agent: 'Mozilla/5.0 (compatible; U; AnyEvent-HTTP/2.21; http://software.schmorp.de/pkg/AnyEvent)'
client:
Expand Down Expand Up @@ -346,7 +346,7 @@
client:
type: library
name: fasthttp
version:
version: ""
-
user_agent: python-httpx/0.19.0
client:
Expand Down Expand Up @@ -647,3 +647,9 @@
type: library
name: Electron Fetch
version: "1.0"
-
user_agent: httprs/0.1.0
client:
type: library
name: httprs
version: "0.1.0"
20 changes: 19 additions & 1 deletion Tests/Parser/Client/fixtures/mobile_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
user_agent: NPROneAndroid
client:
type: mobile app
name: NPR One
name: NPR
version:
-
user_agent: WirtschaftsWoche-iOS-1.1.14-20200824.1315
Expand Down Expand Up @@ -1919,3 +1919,21 @@
type: mobile app
name: KPN Veilig
version: 18.5.274904
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_4 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G35 Safari/ NAVER(inapp; naverdicapp; 100; 2.1.1) iphoneVersion/iPhone6s
client:
type: mobile app
name: NAVER Dictionary
version: "2.1.1"
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 CSDNApp/5.7.1(iOS)
client:
type: mobile app
name: CSDN
version: "5.7.1"
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 CaDevice/1.0 (iPhone11,8) CaWebApp/1.0(jpameblo;13.8.0;ja;)
client:
type: mobile app
name: Ameba
version: "13.8.0"
18 changes: 18 additions & 0 deletions Tests/Parser/Client/fixtures/pim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,21 @@
type: pim
name: Mail Master
version: 6.5.3.1210
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176 YJApp-IOS jp.co.yahoo.ymail/7.4.1
client:
type: pim
name: Yahoo! Mail
version: "7.4.1"
-
user_agent: eMClient/9.3.6041.0
client:
type: pim
name: eM Client
version: "9.3.6041.0"
-
user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) BlueMail/0.10.31 Chrome/61.0.3163.100 Electron/2.0.18 Safari/537.36
client:
type: pim
name: BlueMail
version: "0.10.31"
14 changes: 14 additions & 0 deletions Tests/fixtures/bots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6376,6 +6376,20 @@
name: GitHubCopilotChat
category: Crawler
url: https://github.com/aaamoon/copilot-gpt4-service

-
user_agent: pdrl.fm Analyzer / 1.0.0
bot:
name: Podroll Analyzer
category: Crawler
url: https://podroll.fm
-
user_agent: Mozilla/5.0 (compatible; PodUptime/1.0; +https://poduptime.com)
bot:
name: PodUptime
category: Site Monitor
url: https://poduptime.com

-
user_agent: anthropic-ai
bot:
Expand Down
18 changes: 18 additions & 0 deletions Tests/fixtures/car_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -989,3 +989,21 @@
model: Wagoneer
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; arm_64; Android 10; AirTouch PERFORMANCE 10x) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.533 YaSearchBrowser/24.17/apad BroPP/1.0 YaSearchApp/24.17/apad webOmni SA/3 Mobile Safari/537.36
os:
name: Android
version: "10"
platform: ARM
client:
type: browser
name: Yandex Browser
version: "24.17"
engine: Blink
engine_version: 120.0.6099.533
device:
type: car browser
brand: AirTouch
model: Performance 10x
os_family: Android
browser_family: Unknown
Loading

0 comments on commit 0fb50a6

Please sign in to comment.