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