Skip to content

Actual Names for Folders Instead of IDs #25

@LuanaNight

Description

@LuanaNight

Any chance you will add the option to name the folder like the post title, or maybe reason why you haven't done it yet?

I have been looking into this myself, right now:

The line that is responsible for the folder name is:

post_folder = os.path.join(posts_folder, post_id)

(kcposts.py line 397)

Getting the post name should also not be a problem, as it's already available from the part of the code that writes into the markdown file.

Some posts don't have a title, in which case it would revert back to the post id.

As for sanitization, one should exclude symbols windows doesn't like, as well as emojis (other non-English letters like Japanese for example should be allowed however).

# remove things windows doesn't like
invalid_chars = r'[\\/:*?"<>|]'
filename = re.sub(invalid_chars, '', filename)

# remove emojis
filename = ''.join(c for c in filename if not unicodedata.category(c).startswith('C'))

Having this feature also prevents one from getting the same post from different services like onlyfans and fansly if a creator uses both, as the name of the folder would directly show you that they are the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions