mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Add better ua parsing
This commit is contained in:
@@ -5,6 +5,11 @@ export function parseUserAgent(userAgent: string): string {
|
||||
return `Vanced/${ua.match(/.android.youtube\/([^\s]+)/)[1]}`;
|
||||
}
|
||||
|
||||
const revanced = ua.match(/RVX\S+|ReVanced\S+/);
|
||||
if (revanced) {
|
||||
return revanced[0];
|
||||
}
|
||||
|
||||
if (ua.match(/(mpv_sponsorblock\/)|(^python-requests)|(^GuzzleHttp\/)|(^PostmanRuntime\/)/)) {
|
||||
return ua;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user