Sitelet https://web.archive.org/web/20200525161002/https://github.com/Xonshiz/comic-dl/issues/234
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

Filenames need to be sanitized during conversions #234

Open
GiovanH opened this issue Jun 22, 2019 · 1 comment
Open

Filenames need to be sanitized during conversions #234

GiovanH opened this issue Jun 22, 2019 · 1 comment

Comments

@GiovanH
Copy link
Contributor

@GiovanH GiovanH commented Jun 22, 2019

Comics with special characters in their names will fail with OS errors if their names contain special characters. A slug function needs to be implemented and referenced in GlobalFunctions

@GiovanH
Copy link
Contributor Author

@GiovanH GiovanH commented Jun 22, 2019

A very simple implementation in windows is

def easySlug(string, repl="-", directory=False):
    import re
    if directory:
        return re.sub("^\.|\.+$", "", easySlug(string, directory=False))
    else:
        return re.sub("[\\\\/:*?\"<>\|]|\ $", repl, string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.