Skip to content

How to export an image's tags to a plaintext txt file? #1896

Answered by mikf
pomiru asked this question in Q&A
Discussion options

You must be logged in to vote

For Pixiv:

        {
            "name"  : "metadata",
            "event" : "post",
            "mode"  : "custom",
            "format": "{tags:J\n}\n",
            "filename": "{id}.tags.txt"
        }

(Replacing mode and format with just "mode" : "tags" would also work)

For Twitter, assuming a want to write a Tweet's hashtags:

        {
            "name"  : "metadata",
            "event" : "post",
            "mode"  : "custom",
            "format": "{hashtags:?//J\n}\n",
            "filename": "{tweet_id}.tags.txt"
        }

This will write empty files for Tweets without hashtags.
To prevent this, add a "filter": "'hashtags' in locals()"

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pomiru
Comment options

@mikf
Comment options

@pomiru
Comment options

Answer selected by pomiru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants