mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-01-29 13:50:46 +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]}`;
|
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\/)/)) {
|
if (ua.match(/(mpv_sponsorblock\/)|(^python-requests)|(^GuzzleHttp\/)|(^PostmanRuntime\/)/)) {
|
||||||
return ua;
|
return ua;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user