Label Pixiv Bookmarks

Automatically add existing labels for images in the bookmarks, and users are able to search the bookmarks

Author
philimao
Daily installs
7
Total installs
2,796
Ratings
33 3 4
Version
5.16
Created
2021-03-23
Updated
2024-03-25
License
MIT
Applies to

Label Pixiv Bookmarks

Automatically add existing tags for images in the bookmarks, and search them

Please Use Tampermonkey as the script manager

  • The script is developed on Tampermonkey, whereas Greasemonkey has quite different API calls.

Latest

  • Added functions to replace the tag-selection dialog, displaying tags alphabetically (Function Page)

  • Added functions to regard author name and uid as work tags (Label Page - Advanced)

  • Added functions to show user-labeled tags (in script manager menu)

Intro

  • The script will compare your existing bookmark tags and tags of the image, then find the intersection and save

  • If there is no intersection, the script will skip the image. Or you can configure the script to add the first tag of the image by default.

  • You might also search your bookmarks by your custom tag

  • The script is implemented by Pixiv Web APIs. Please open a new issue at GitHub if it was outdated.

For First-time User

  • This is a new account with all bookmarked images uncategorized. Let's start from here.

step1

  • There are several ways to build up your bookmarked tags pool from scratch before using the script
  1. In the bookmarks page, hovering on the thumbnail and clicking the Edit tags button. you will find the Creat a tag button in the dialog. After saving all your changes, those created tags will be saved to your bookmarked tags.

step2.1

  1. In the bookmark detail page, you can choose some tags from Tags for this work, and then click Edit Bookmark to save

step2.2

  1. Let the script grabs the first tag from the work to build up your bookmarked tags pool. In this case you should make sure that in the advanced settings of the script add the first tag option is set to Yes. You are free to remove those unwanted tags later, and don't forget to reset the value to No after you tags pool has been settled.

step2.3

  1. Use the synonym dictionary of the script. All the user tags (i.e. the target tag) will be added to your bookmarked tags pool. See below to find out how to use the synonym dict.

Start Labeling

  • In the Bookmarks Page, click Label button to open the script page
  • For first time user, if you already have some bookmarked tags, just click Start to run
  • Or you might need to add some tags to your pool as aforementioned
  • Assume that we already have the tag [新世紀エヴァンゲリオン] being bookmarked

step3

  • Wait for the progress bar until it reaches the end.
  • Refresh the page, and we will find that all images with the tag [新世紀エヴァンゲリオン] have been categorized

step3

Synonym Dictionary

  • Sometimes the author does not provide the so-called official tag for the artwork. This inconsistency makes it hard for us to do labeling.
  • Here we introduce the synonym dictionary that stores tag-alias pairs. All alias for a tag will be regarded as the same as the tag itself.
  • For example, the tags of the image contains [EVA] instead of [新世紀エヴァンゲリオン], so that it won't be categorized into [新世紀エヴァンゲリオン].
  • You can find a sample file in Load Dict section which can be used to load for first-time users.

step4

  • Open the script page and we wil find the Edit Dict button.
  • The Target Tag is the one that you want it in your bookmark tags pool (eg: 新世紀エヴァンゲリオン); and the Alias are the tags that you want them to be regarded as the target tag (eg: eva, evangelion).
  • Note that all alias should be delimited by spaces, or line breakers
  • Click Update Tag to save the user tag and alias into the dictionary. If the alias is empty the user tag will be removed
  • You can export the dictionary to local disk as a backup
  • To modify the alias, enter the user tag value and click Load Tag to load the alias value from the dict (or use tab key), and click Update Tag to save

step5

  • After executing the script again, all uncategorized images with either the target tag, or the alias tag now have been categorized to your target tag.

step6

  • There are a lot of things you can do with this functionality. For example, most character in pixiv use the katakana (片仮名) as its official name, which makes the non-Japanese speakers hard to recognize the name.

  • Take Soryu Asuka Langley as an instance. She has at least four kinds of appellations like 惣流・アスカ・ラングレー/式波・アスカ・ラングレー/そうりゅう・アスカ・ラングレー/しきなみ・アスカ・ラングレー. Now we can set asuka as the target tag, and those Japanese names as the alias.

step7

step7

Examples

  • Here are the example of my own synonym dictionary and user tags. You might refer it to set yours.

dictionary userTags

About Some Advanced Settings

  • Auto Labeling For

    • By default, the script does label for those uncategorized images
    • You may want to re-label all your favorite artworks when some newly-added tags were not applied to those former images.
    • For example, if you just add [ayanami_rei] to your user tags, you can choose [新世紀エヴァンゲリオン] and re-run the script. Therefore, all images with [新世紀エヴァンゲリオン] tag will be searched and labeled again.
  • Whether the first tag will be added if there is not any match

    • Design for a cold start
    • It works when the intersection of your existing bookmark tags and tags of the work is empty, then the first tag of the image will be added
    • When ignore tags are provided, the script will use the first tag that is not ignored
  • Whether ALL work tags will be added to your user tags

    • For people who just want to manage the bookmarks by the work tags
    • Work tags will be FIRST added
    • Synonym dict still works if you want to merge similar work tags
  • Publication Type for Labeling

    • Pixiv stores public and private bookmarks in different places, and they have independent tags
    • By default, the script only does label for public bookmarks
  • Whether NSFW works will be labeled as #R-18?

    • By default, the script will categorize those NSFW works into the R-18 tag
    • If you don't want the tag, set it as No before starting
  • Whether NSFW works will be labeled as #R-18?

    • By default, the script will not categorize those SFW works into the SFW tag
    • If you need to label the tag, set it as Yes before starting
  • Whether AI-generated works will be labeled as AI

    • By default, the script will not label AI-generated works
    • Set the config as Yes to distinguish them
  • Whether author name and uid will be regarded as part of work tags

    • Enable users to use author name and uid as the alias name of synonym dict
  • Whether the work tag and user tag need to be strictly match (both character name and work title)

    • Eg: work A, tagged as #Asuka #EVA; work B, tagged as #Asuka; work C, tagged as #Asuka(EVA). And you have #Asuka(EVA) in your user tags
    • When set to Yes, only work A and C will be tagged as #Asuka(EVA)
    • When set to No, all of them will be tagged as #Asuka(EVA)

Remove All Tags from Selected Works

  • The script can help you remove all tags from selected artworks easily
  • This usually helps when you want to reset multiple images to Uncategorized
  • Click on the Edit Bookmarks button, and you will find an extra Remove Tags button below the tags section
  • The button is disabled until you select several images

Remove a Bookmark Tag from Related Works

  • It is not hard for you to find that a new button named Delete Tag XXX comes out when you click on the Edit Bookmarks button
  • This will help you to remove this bookmark tag from ALL related images
  • This operation will not affect the bookmarked status, i.e. the images will become uncategorized if there is not any other tag remains

Search Your Bookmarks

  • You can also search your bookmarks with this script
  • Click Search Button to open the search page, and search with the keyword [asuka], which is the target tag we have registered before
  • The script will return all images with tag [asuka] or [asuka]'s alias.

Manually enable some functions

  • In order not to crowd to UI, some non-core functions need to be enabled manually by clicking corresponding button in the extension menu

enableFunctions

Display Shuffled Images

  • This function is used to view random images of specified tag, or split a big tag into smaller ones
  • Set the tag to load and other configs (loading all works takes quite long time) and click on the Load button on the bottom right to start
  • Images of the tag will be split into N batches by the batch size. Click on the Load button will switch to the next batch
  • Click on the thumbnail to enter gallery mode. Use four arrow keys to manipulate. Click on the X on the top left to exit
  • Click on the Save to Tag button to save N batches into N sub-tags which is used for split a big tag into smaller ones and facilitates easier access to early bookmarks

Additional Functions

  • Some scattered and independent functions are resided in this page
  • Tags
    • Click on Toggle Publication Type button to toggle the publication type of related works between public and private
    • Click on Delete This Tag button to the tag from all related works (select tag1, tag1,tag2 => tag2)
    • Click on Clear Work Tags button to set all related works to uncategorized (select tag1, tag1,tag2 => uncategorized)
    • Enter a new tag name (cannot duplicate) and click on Rename Tag to update the tag name, as well as the name in synonym dictionary and all related works
  • Bookmarks
    • Still in development. Meant to back up the whole bookmarks and retrieve information when necessary
    • When you find some works got deleted/private, and you have a previous version of backup, Click on Lookup Invalid Works and choose the backup to make a comparison.
    • The lookup function relies on the order of your bookmarks. By indexing and locating its previous work id, the script would find the information of the invalid work.

Show User-label Tags

  • User-labeled tags can be displayed under the work image
  • Enable it in the script manager menu (where you enable/disable this script)

FAQ

  • Some function fails?

    • Except internal bugs, there are other reasons lead to the function failure
    • Pixiv UI updates
    • Browser and script manager compatibility
    • Please open an issue at Github提交issue
    • Please note the following information:
    • Browser and script manager used
    • How to reproduce the bug
    • Does it work before?
    • You might get some error information in the console by pressing F12
  • The Label button cannot be found on the website

    • Firstly make sure that you are at the correct place, and try to refresh before the next step
    • The new version of Pixiv UI uses React to update the page without refreshing, so the button might not be loaded
    • Generally, the correct path should be like https://www.pixiv.net/users/{YOUR UID}/bookmarks/artworks or https://www.pixiv.net/bookmark.php
    • If the path is correct, and the button is still nowhere to find, it is probably because Pixiv updates its UI. Inform me at GitHub by opening an issue
  • The script cannot work and alert a prompt

    • Please take down the prompt and open an issue at GitHub. The problem can be specific
  • The synonym dictionary got lost accidentally

    • Expand Load Dict and click the restore button the download the backup. The file could be imported to restore your dictionary.
    • If you think it is a bug, open an issue.
  • Whether Pixiv will ban my account for the script

    • The script is basically for self-use, and I have limited the speed of sending requests. It works properly on thousands of images.

Copyright and contact

The script complies with the MIT license.

Please report bugs or new features expected at GitHub.