blocktube icon indicating copy to clipboard operation
blocktube copied to clipboard

Combining Advanced Blocking Filters

Open Apposite245 opened this issue 2 years ago • 1 comments

Trying to write an advanced filter that will block videos that have more than X views and are shorter than X seconds.

I'm using video.vidLength and video.viewCount, I can get each filter working individually, but can't get them working together.

I've tried combining them into a single filter like

if (video.vidLength < 1200) && (video.viewCount > 2000)

and creating two separate filters, but it doesn't work in either case.

I don't know any JS but the syntax seems wrong to me but I'm not sure where exactly.

Apposite245 avatar Jul 24 '23 04:07 Apposite245

The documentation shows an example of how to do this.

  // If video title contains "something"
  //                                and If the channel name contains "otherthing"
  if (video.title.match("something") && video.channelName.match("otherthing")) {
    // Block the video
    return true;
  }

Your parenthesis are formatted incorrectly for what you're trying. if (video.vidLength < 1200 && video.viewCount > 2000)

DanSleeman avatar Oct 28 '23 05:10 DanSleeman