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

fix kobo file names with . #616

Merged
merged 2 commits into from
Dec 21, 2023
Merged

fix kobo file names with . #616

merged 2 commits into from
Dec 21, 2023

Conversation

axu2
Copy link
Collaborator

@axu2 axu2 commented Nov 13, 2023

@HamzaM
@vietvu94
Can you verify if this fixes your issue?

Various characters are illegal in older EPUB readers, including spaces. https://www.w3.org/TR/epub-33/#sec-container-filenames

Code based on: https://stackoverflow.com/questions/12985456/replace-all-non-alphanumeric-characters-in-a-string

Before and after:

image

I do not have a kobo to test so there's no way for me to verify if this build causes other issues.

@axu2 axu2 changed the title Fix Kobo EPUB filename escaping change kobo file names Nov 13, 2023
@hvmzx
Copy link

hvmzx commented Nov 13, 2023

Just checked, this is what I get with the input : Oda Eiichiro - One Piece - Chapter 1053 The New Emperors.cbz

python3 kcc-c2e.py -p KoC -m -u -s -d -f EPUB -> Oda_Eiichiro_One_Piece_Chapter_1053_The_New_Emperors.kepub.epub
python3 kcc-c2e.py -p K -m -u -s -d -f KV EPUB -> Oda Eiichiro - One Piece - Chapter 1053 The New Emperors.epub

Both are considered epubs, yet the Kindle profile has spaces but the Kobo one is handled differently with "_" instead.

Also, I find the author/creator set to KCC in the metadata, is there option to bypass that ? Because it later on messes up the metadata and puts every manga under the author KCC. Or if there is a way to set the metadata based on the filename ? Like AUTHOR - TITLE - Volume.epub and those parameters are parsed and filled up in the metadata.

@axu2 axu2 marked this pull request as draft November 14, 2023 02:43
@axu2 axu2 changed the title change kobo file names fix kobo file names with . Nov 17, 2023
@axu2 axu2 marked this pull request as ready for review November 19, 2023 05:53
@axu2 axu2 marked this pull request as draft November 21, 2023 17:45
@axu2 axu2 marked this pull request as ready for review December 14, 2023 06:31
@axu2 axu2 merged commit 6cdd9d5 into ciromattia:master Dec 21, 2023
@axu2 axu2 deleted the kobo-epub branch December 21, 2023 20:51
@hvmzx
Copy link

hvmzx commented Sep 22, 2024

Hi, I am still getting the same behavior, instead of spaces I got underscores everywhere. It'd be nice for the filename not to change

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

Successfully merging this pull request may close these issues.

Filename problem if contain "." in Kobo profiles
2 participants