Open htAngryFace opened 1 month ago
You can do that with advanced blocking I guess, the video object passed to the filter function has a viewcount field.
https://github.com/amitbl/blocktube/wiki/Advanced-Blocking
Can you test it?
It does work @f4grx @htAngryFace. Here is an example:
(video, objectType) => {
// block videos with less than 1,000,000 views
if (video.viewCount <= 1000000) {
return true;
}
return false;
}
Very easy to do. Obviously replace the view count with your desired value.
@GithubAnon0000 it does not work with 0 views (No views) videos.
@nadir-advian
do you have an example video so that I can check? The condition would be video.viewCount < 1
.
@GithubAnon0000 I tried your suggestion and it does not work. Instead of linking to a specific video, here's a search query that will lead to many 0 views videos: https://www.youtube.com/results?search_query=MVI&sp=EgIIAQ%253D%253D I believe youtube uses a different logic for 0 views videos since they display as "No views" instead of 0views. So it's probably not an integer, but something like Null or None.
@nadir-advian
You're right, console.log(JSON.stringify(video));
shows null
for viewCount
.
The following works for me:
// block videos with 0 views
let viewCountStr = JSON.stringify(video.viewCount);
if (viewCountStr.includes("null")) {
return true;
}
PS: ignore my previous now deleted comment if you see it in your mail history. That is buggy and would block every single video.
@GithubAnon0000 Finally, I can now block the AI videos slop. Thanks, your solution works.
I literally do not want to see 64 view videos. That's all.
Thank!