[GH-ISSUE #10] Pixiv Support #9

Open
opened 2026-08-06 02:12:43 -04:00 by saavagebueno · 5 comments
Owner

Originally created by @SaltSouls on GitHub (Mar 13, 2024).
Original GitHub issue: https://github.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/issues/10

Not sure how hard this would be, but Pixiv has an AI tag that this may be able to take advantage of in order to block said images/creators from showing that post AI images.

Originally created by @SaltSouls on GitHub (Mar 13, 2024). Original GitHub issue: https://github.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/issues/10 Not sure how hard this would be, but Pixiv has an AI tag that this may be able to take advantage of in order to block said images/creators from showing that post AI images.
Author
Owner

@MonoS commented on GitHub (May 26, 2024):

I did something similar using this other extension https://addons.mozilla.org/en-US/firefox/addon/man-in-the-middle/
You will need to create 5 rules like this
image

  • AI Shit homepage auth (pixiv)
var bannedTags = ["AI-generated", "AIイラスト"];

var resp = JSON.parse(responseBody);

var urlToChange = [];
Object.keys(resp.body.illusts).forEach(key => {
  if (resp.body.illusts[key].aiType == 2){
    urlToChange.push(resp.body.illusts[key].url);
  }else if (bannedTags.some(i => resp.body.illusts[key].tags.includes(i))){
    urlToChange.push(resp.body.illusts[key].url);
  }
});

urlToChange.forEach(function(url){
responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg');
});

return responseBody
/https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/profile\/top.*/
  • AI Shit artworks page (pixiv)

var resp = JSON.parse(responseBody);

var urlToChange = [];
Object.keys(resp.body.works).forEach(key => {
  if (resp.body.works[key].aiType == 2){
    urlToChange.push(resp.body.works[key].url);
  } else if (bannedTags.some(i => resp.body.works[key].tags.includes(i))){
    urlToChange.push(resp.body.works[key].url);
  }
});

urlToChange.forEach(function(url){
responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg');
});

return responseBody
/https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/profile\/illusts.*/
/https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/illustmanga\/tag/
  • AI Shit tag search (pixiv)
var bannedTags = ["AI-generated", "AIイラスト"];

var resp = JSON.parse(responseBody);

var urlToChange = [];
Object.keys(resp.body.illustManga.data).forEach(key => {
  if (resp.body.illustManga.data[key].aiType == 2){
    urlToChange.push(resp.body.illustManga.data[key].url);
  } else if (bannedTags.some(i => resp.body.illustManga.data[key].tags.includes(i))){
    urlToChange.push(resp.body.illustManga.data[key].url);
  }
});

urlToChange.forEach(function(url){
responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg');
});

return responseBody
/https\:\/\/www\.pixiv\.net\/ajax\/search\/top\/.*/
/https\:\/\/www.pixiv.net\/ajax\/search\/artworks\/.*/
  • AI Shit Follow suggestion (pixiv)
var bannedTags = ["AI-generated", "AIイラスト"];

var resp = JSON.parse(responseBody);

var urlToChange = [];
Object.keys(resp.body.thumbnails.illust).forEach(key => {
  if (resp.body.thumbnails.illust[key].aiType == 2){
    urlToChange.push(resp.body.thumbnails.illust[key].url);
  } else if (bannedTags.some(i => resp.body.thumbnails.illust[key].tags.includes(i))){
    urlToChange.push(resp.body.thumbnails.illust[key].url);
  }
});

urlToChange.forEach(function(url){
responseBody = responseBody.replaceAll(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg');
});

return responseBody
/https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/recommends.*/
  • AI Shit homepage auth highlight (pixiv)
var bannedTags = ["AI-generated", "AIイラスト"];

var resp = JSON.parse(responseBody);

var urlToChange = [];
Object.keys(resp.body.pickup).forEach(key => {
  if (resp.body.pickup[key].aiType == 2){
    urlToChange.push(resp.body.pickup[key].url);
  }else if (bannedTags.some(i => resp.body.pickup[key].tags.includes(i))){
    urlToChange.push(resp.body.pickup[key].url);
  }
});

urlToChange.forEach(function(url){
responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg');
});

return responseBody
/https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/profile\/all.*/

Hope it helps

<!-- gh-comment-id:2132380083 --> @MonoS commented on GitHub (May 26, 2024): I did something similar using this other extension https://addons.mozilla.org/en-US/firefox/addon/man-in-the-middle/ You will need to create 5 rules like this ![image](https://github.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/assets/801011/6aa7e4af-b80e-4c19-b273-b9c0869e62a8) - AI Shit homepage auth (pixiv) ``` var bannedTags = ["AI-generated", "AIイラスト"]; var resp = JSON.parse(responseBody); var urlToChange = []; Object.keys(resp.body.illusts).forEach(key => { if (resp.body.illusts[key].aiType == 2){ urlToChange.push(resp.body.illusts[key].url); }else if (bannedTags.some(i => resp.body.illusts[key].tags.includes(i))){ urlToChange.push(resp.body.illusts[key].url); } }); urlToChange.forEach(function(url){ responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg'); }); return responseBody ``` ``` /https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/profile\/top.*/ ``` - AI Shit artworks page (pixiv) ```var bannedTags = ["AI-generated", "AIイラスト"]; var resp = JSON.parse(responseBody); var urlToChange = []; Object.keys(resp.body.works).forEach(key => { if (resp.body.works[key].aiType == 2){ urlToChange.push(resp.body.works[key].url); } else if (bannedTags.some(i => resp.body.works[key].tags.includes(i))){ urlToChange.push(resp.body.works[key].url); } }); urlToChange.forEach(function(url){ responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg'); }); return responseBody ``` ``` /https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/profile\/illusts.*/ /https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/illustmanga\/tag/ ``` - AI Shit tag search (pixiv) ``` var bannedTags = ["AI-generated", "AIイラスト"]; var resp = JSON.parse(responseBody); var urlToChange = []; Object.keys(resp.body.illustManga.data).forEach(key => { if (resp.body.illustManga.data[key].aiType == 2){ urlToChange.push(resp.body.illustManga.data[key].url); } else if (bannedTags.some(i => resp.body.illustManga.data[key].tags.includes(i))){ urlToChange.push(resp.body.illustManga.data[key].url); } }); urlToChange.forEach(function(url){ responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg'); }); return responseBody ``` ``` /https\:\/\/www\.pixiv\.net\/ajax\/search\/top\/.*/ /https\:\/\/www.pixiv.net\/ajax\/search\/artworks\/.*/ ``` - AI Shit Follow suggestion (pixiv) ``` var bannedTags = ["AI-generated", "AIイラスト"]; var resp = JSON.parse(responseBody); var urlToChange = []; Object.keys(resp.body.thumbnails.illust).forEach(key => { if (resp.body.thumbnails.illust[key].aiType == 2){ urlToChange.push(resp.body.thumbnails.illust[key].url); } else if (bannedTags.some(i => resp.body.thumbnails.illust[key].tags.includes(i))){ urlToChange.push(resp.body.thumbnails.illust[key].url); } }); urlToChange.forEach(function(url){ responseBody = responseBody.replaceAll(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg'); }); return responseBody ``` ``` /https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/recommends.*/ ``` - AI Shit homepage auth highlight (pixiv) ``` var bannedTags = ["AI-generated", "AIイラスト"]; var resp = JSON.parse(responseBody); var urlToChange = []; Object.keys(resp.body.pickup).forEach(key => { if (resp.body.pickup[key].aiType == 2){ urlToChange.push(resp.body.pickup[key].url); }else if (bannedTags.some(i => resp.body.pickup[key].tags.includes(i))){ urlToChange.push(resp.body.pickup[key].url); } }); urlToChange.forEach(function(url){ responseBody = responseBody.replace(url.replace(/\//g, '\\\/'), 'https://dataconomy.com/wp-content/uploads/2022/12/No-to-AI-generated-images-ArtStation-protest-explained-1.jpg'); }); return responseBody ``` ``` /https\:\/\/www\.pixiv\.net\/ajax\/user\/\d+\/profile\/all.*/ ``` Hope it helps
Author
Owner

@laylavish commented on GitHub (Jun 1, 2024):

I'm not sure if this is possible, since i'm pretty sure uBO only has access to CSS selectors, not to the actual page data like what Google or DuckDuckGo has. Using something like -intext:"AI-generated" in your search query (for Google Search) actually crawls for webpages without the Pixiv tag AI-generated. Unfortunately I think this isn't possible with plain CSS selectors, as there is not enough information to do that with since information like tags and descriptions are usually truncated.

Oh, I just realized that you mean on the actual pixiv site, not on search engines (or did you mean that?). Anyways, for the actual pixiv site, I dunno. Haven't looked into it yet. Will see tho!

<!-- gh-comment-id:2143587127 --> @laylavish commented on GitHub (Jun 1, 2024): I'm not sure if this is possible, since i'm pretty sure uBO only has access to CSS selectors, not to the actual page data like what Google or DuckDuckGo has. Using something like `-intext:"AI-generated"` in your search query (for Google Search) actually crawls for webpages without the Pixiv tag `AI-generated`. Unfortunately I think this isn't possible with plain CSS selectors, as there is not enough information to do that with since information like tags and descriptions are usually truncated. Oh, I just realized that you mean on the actual pixiv site, not on search engines (or did you mean that?). Anyways, for the actual pixiv site, I dunno. Haven't looked into it yet. Will see tho!
Author
Owner

@SaltSouls commented on GitHub (Jun 1, 2024):

Yeah I mean on the pixiv site itself, it has a full tag for AI-Generated images and the like.
I don't know if uBlock is able to take advantage of it, but I figure if it could, then it would be nice to filter out all the slop when searching for images there.

<!-- gh-comment-id:2143660012 --> @SaltSouls commented on GitHub (Jun 1, 2024): Yeah I mean on the pixiv site itself, it has a full tag for AI-Generated images and the like. I don't know if uBlock is able to take advantage of it, but I figure if it could, then it would be nice to filter out all the slop when searching for images there.
Author
Owner

@laylavish commented on GitHub (Jun 19, 2024):

So I've looked into this a bit, and the closest thing to the tags pixiv has is the alt text, which can house tags. Problem is, is that alt text is user-specified; it isn't actually tied to the tags system at all. The tags do not appear in html (when searching for images, eg. scrolling homepage, search bar queries, etc), so uBlock can't take advantage of them. Pretty unfortunate.

I will say however that Pixiv does have an AI-generated content toggle in Display settings in your Pixiv settings, which would hide any AI content that is tagged with AI-generated. I could be wrong about this, but I believe the AI-generated content toggle is off by default, meaning that all AI slop should be hidden.

<!-- gh-comment-id:2179128465 --> @laylavish commented on GitHub (Jun 19, 2024): So I've looked into this a bit, and the closest thing to the tags pixiv has is the alt text, which can house tags. Problem is, is that alt text is user-specified; it isn't actually tied to the tags system at all. The tags do not appear in html (when searching for images, eg. scrolling homepage, search bar queries, etc), so uBlock can't take advantage of them. Pretty unfortunate. I will say however that Pixiv does have an AI-generated content toggle in `Display settings` in your Pixiv settings, which would hide any AI content that is tagged with `AI-generated`. I could be wrong about this, but I believe the AI-generated content toggle is off by default, meaning that all AI slop should be hidden.
Author
Owner

@MonoS commented on GitHub (Jun 29, 2024):

I did something similar...

I wrote a possible solution using another plugin, firefox only, it was hidden up until now as my account was being limited, so check the second comment https://github.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/issues/10#issuecomment-2132380083

<!-- gh-comment-id:2198124171 --> @MonoS commented on GitHub (Jun 29, 2024): > I did something similar... I wrote a possible solution using another plugin, firefox only, it was hidden up until now as my account was being limited, so check the second comment https://github.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/issues/10#issuecomment-2132380083
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/uBlockOrigin-HUGE-AI-Blocklist#9