amitbl / blocktube

YouTube™ content blocker
GNU General Public License v3.0
860 stars 60 forks source link

Blocking rules question #323

Open anatidaeta opened 11 months ago

anatidaeta commented 11 months ago

Hi, I'm wanting to block highlight videos that are recent (less than a week old) from MLB as I get a lot of them recommended. It doesn't seem to be working even without including the MLB channel name or ID, is && the correct syntax? Apologies if there's a basic error I've just set this up using the documentation available here. (first filter is unrelated and is just to hide older videos)


(video, objectType) => {
if (video.publishTimeText.match("years")) {
    return true;
  }

if (video.title.include("game highlights") && video.publishTimeText.match("day")) {
    return true;
  }

if (video.title.include("game highlights") && video.publishTimeText.match("hours")) {
    return true;
  }

  return false;
}
ewonais commented 11 months ago

(video, objectType) => { if (video.publishTimeText.match("years")) { return true; }

if (video.title.match("game highlights") && video.publishTimeText.match("day|hours")) { return true; }

return false; }