Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip illegal chars from filename #657

Open
jk779 opened this issue Dec 21, 2024 · 1 comment
Open

Strip illegal chars from filename #657

jk779 opened this issue Dec 21, 2024 · 1 comment

Comments

@jk779
Copy link

jk779 commented Dec 21, 2024

Im getting a lot of Invalid argument errors when using the posts text as file name substring. Maybe it's possible to have another filename placeholder that includes only completely stripped message texts. For example:

with config:

  "PostFileNameFormat": "{username}_{text}_{id}_{mediaid}_{mediaCreatedAt}",

I frequently encounter this:

An error occurred: Invalid argument : '/config/__user_data__/sites/OnlyFans/xxx/Posts/Free/Videos/xxx_Let’s play ride the 🤠 ?_116061234_2043891234_2021-03-01.mp4'

Probably the text is Let’s play ride the 🤠 ? in this case, which might not get quoted/escaped everywhere. A regex like https://rubular.com/r/v3XNERrtK8hLvL could produce something like a {safe_text} one can use as filename part? :)

eg. in Ruby:

irb(main):019" text = "Let’s pla˙∆˚ˆ√˜µ¬y ride the 🤠  ? fo            oooo bar
irb(main):020"
irb(main):021> Bla blaaaa÷¿¿¿"
=> "Let’s pla˙∆˚ˆ√˜µ¬y ride the 🤠  ? fo            oooo bar\n\nBla blaaaa÷¿¿¿"
irb(main):023> text.scan(/[a-zA-Z0-9]+(?:\s[a-zA-Z0-9]+)*/).join(' ')
=> "Let s pla y ride the fo oooo bar Bla blaaaa"

Thanks for considering :) ❤️

(I'm really not that into C#, otherwiese I would probably open a PR, sorry. Maybe you can point me to a file as entrypoint for this change, I could try tho :))

@Dark-Sider
Copy link

yeah would love an option to strip the illegal characters from the filenames!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants