NightDev Community Forums

Regex for youtube URL spam

We are getting bombarded by youtube spam url’s for adult sites lately. does anyone have a regex to detect these? seems something that detects mixed cAsE will work.

thank you

1 Like

It depends on if there’s any pattern to detect the simplest fix is not allowing YouTube links at all and having to grant permission for a user to post it.

2 Likes

I too am riddled with “link spam”… and yes there is a pattern there example “vasF .TECh”
the “.” can be with or without space between, the three to four letters before “tech” looks pretty random, and the “tech” can also be “fyi” and “ong”. The main pattern here is that there are upper case mixed with lower case in random order. But each case has multiple capital letters.

So… how to go about to make a regex that would kill this off for good?

This is what I have come up with so far. It seems to work fairly well. We had one false hit with hundreds of good ones. The guy who was affected was pretty P.O.d though. I told him to join for 99 cents to exempt himself but he didn’t want to.

~/([a-z][A-Z])/g
~/([.][a-z])/g
~/([.][A-Z])/g
~/([A-Z][A-Z][a-z])/g
~/([A-Z][A-Z][A-Z][.])/g
~/(\b\p{Lu}{3,3}\b[.])/g

Please post if you come up with anything better. Thank you

1 Like

Brilliant! it works as a charm! Only problem is that I need to find a way to exempt my channel name from the search LOL!

Hey @BarrySDCA and @Shady!

Another option could be to use the Links Spam Protection, you can exempt your Members, and for the others you can !permit them when you feel they’re not bots.

Thank you, but this is for the people tagging me and being non-members. LOL
I’ve kind of solved it with ~/([a-z][A-Z][^ChannelName])/g

Not the best solution as it is telling the bot to look away from those letters, so trying to turn it into a string to ignore.

1 Like

Links protection doesn’t work. they add spaces and break the feature

Ah, I see… sneaky bots.

Want to add this as it will help people with Large letters in the middle of their channel name:

~/(\A[a-z][A-Z][ChannelName])/g

1 Like

They keep evolving. Here is a new add. removed the first one. My current list:

~/([.][a-z])/g
~/([.][A-Z])/g
~/([A-Z][A-Z][a-z])/g
~/([A-Z][A-Z][A-Z][.])/g
~/(\b\p{Lu}{3,3}\b[.])/g
~/((^[a-zA-Z]{0,4})([.][\s])([a-zA-Z]{0,4}$))/g

1 Like