Entry tags:
Another calibre question
HI, I have a calibre conversion question fandom people might understand better than MobileRead forumers.
I had the fanfiction downloader program called Graffer installed on my comp. I was happy with it because it would download fics from multiple sources and produced clean html files. Unfortunately it's creator gave up on the program and it is no longer updated, and it has stopped working for several major archives.
My work on converting my fics via calibre is slow, ad I often want to chuck my comp out the window, that's how frustrated calibre makes me feel. I was expecting import and conversion to be fairly straightforward, but calibre kept messing up the authors. I finally loked at the html coding and discovered that Graffer added a line in the metadata section which calibre would read as author name, but was actually the name of the programmer: <meta name='author' content='Grzegorz Hordynski' />
I wet to MobileRead to see if I can find a way to change this line in the html file automatically through bulk convert, but couldn't figure out the instructions or the regexes. I've been having a back and forth conversation with a member who doesn't understand what I'm after, so does anyone here know how to set up calibre so that it changes the programmer's name into the correct author name for selected ebooks in the actual html file, not just in the metadata?
I had the fanfiction downloader program called Graffer installed on my comp. I was happy with it because it would download fics from multiple sources and produced clean html files. Unfortunately it's creator gave up on the program and it is no longer updated, and it has stopped working for several major archives.
My work on converting my fics via calibre is slow, ad I often want to chuck my comp out the window, that's how frustrated calibre makes me feel. I was expecting import and conversion to be fairly straightforward, but calibre kept messing up the authors. I finally loked at the html coding and discovered that Graffer added a line in the metadata section which calibre would read as author name, but was actually the name of the programmer: <meta name='author' content='Grzegorz Hordynski' />
I wet to MobileRead to see if I can find a way to change this line in the html file automatically through bulk convert, but couldn't figure out the instructions or the regexes. I've been having a back and forth conversation with a member who doesn't understand what I'm after, so does anyone here know how to set up calibre so that it changes the programmer's name into the correct author name for selected ebooks in the actual html file, not just in the metadata?
no subject
If you don't find another solution to your problem and if you are willing to install Python, I'd write that script for you.
OTOH, I just looked at the bulk conversion thing of Calibre, and the Search & Replace looks exactly like what you need. Your regular expression would most likely just be the offensive tag as is if it stays exactly the same in all files:
<meta name='author' content='Grzegorz Hordynski' />
Leave the replacement string empty. If that doesn't work, try
<meta name='author' content='Grzegorz Hordynski' \/>
(With a backslash before the slash to tell calibre that you mean the character slash. The slash might have a special meaning in regular expressions which you don't want here.)
no subject
:back a while later:
It populates the Author(s) column correctly, but it does nothing to the file itself. When I look into the zip file created by calibre, that bloody line is still there. It is supposed to be able to change the content of the file. I know, because I read tutorials on MR that show how to remove repeating headers and footers. Why am I not able to change this one bloody line in the html file???
And it doesn't convert all books I selected, just the first one, and renames the fic in an insane fashion - I start with a file in an author folder numbered by the order in which events happen in these six connected fics, and calibre rearranges the order the way it sees fit. When I convert the fic, it renames it to Title by Author - Author.epub. WTF is that?
Just to make my workflow a little clearer, here's the setup of my fandom folders (I'll use Harry Potter as the example):
My fandoms > Harry Potter > Fics > Individual authors > Author folder > Title. html (or number Title.html if they make up a series)
My fandoms > Harry Potter > Fics > Various authors > Author name - Title.html
So I imported the books from the very first author folder, I clicked on Convert books, Bulk convert, went to Search & Replace, entered the offending line, entered text I wanted to replace it with, hit OK and the conversion was done only on first book. The rest were disregarded, and the resulting epub was named Title by Author - Author.epub (Title by Author is the first line of the fic, fllowed by a short synopsis and story word count, and the original link. The fic was downloaded from fanfiction.net)
no subject
Re the "Title by author - Author.epub" -- is maybe the title tag in the meta info of the html set to "Title by author"? You might want to try removing that with the bulk import search and replace, too. It's going to fallback on filename for title, then, I think. If you convert one author folder at a time, you can just edit the author back in via bulk editing of meta tags.
no subject
and from the file when opened normally:
Darling by agelade
A canon-compliant retelling of book 7, mostly from Draco's point of view. There's a good reason the Malfoys weren't immediately arrested after V was defeated, and it's not because his parents suddenly got lovey-dovey. Canon compliant, canon ships.
Story word count: 33355
Original link
no subject
no subject
<title>.*?</title>
no subject
So tell me at least how do I replace the author tag with the correct author name? That at least should be the same for each selected story.
no subject
no subject
So let's go with actual examples:
I start with Harry Potter > Fics > Individual authors >agelade
The stories are:
01 Darling.htm
02 Daring Coda The Same.htm
03 Darling Coda The Portrait.htm
04 Darling Coda 12th August, 2004.htm
05 Darling Coda The Notion of Bluffing.htm
06 Darling Coda Stars
Upon importing end conversion, I end up with
Calibre Library > agelade > Darling by agelade (272) > Darling by agelade - agelade.epub
Calibre Library > agelade > Darling Coda_ 12th August, 2004 by agela (275) > Darling Coda_ 12th August, 2004 by agela - agelade.epub
Calibre Library > agelade > Darling Coda_ Stars by agelade (277) > Darling Coda_ Stars by agelade - agelade.epub
Calibre Library > agelade > Darling Coda_ The Notion of Bluffing by (276) > Darling Coda_ The Notion of Bluffing by - agelade.epub
Calibre Library > agelade > Darling Coda_ The Portrait by agelade (274) > Darling Coda_ The Portrait by agelade - agelade.epub
Calibre Library > agelade > Darling Coda_ The Same by agelade (273) > Darling Coda_ The Same by agelade - agelade.epub
So I have to rename all my fics BEFORE importing to calibre following a certain scheme (which is what, exactly? How do I organize my files so that calibre populates authors and series in a correct way? And that is doubling the work; it was supposed to automate things for me, not make me work twice as hard to fix it before conversion. What if I had imported my entire Fandoms flder???)
herve leger
(Anonymous) 2011-12-06 08:05 am (UTC)(link)