LJ multichapter fanfic onto your ereader easily?

Jan 27, 2012 14:12

I have a kindle touch and I am trying to figure out an easy way to get LJ Multichapter fics into one epub/mobi file. I already use the epub conversion website so that I can easily get all the chapters into epub - but I can't find a way to actually combine them into one epub file ( Read more... )

conversion-tools, programs: fanfiction downloader, device: kindle, calibre

Leave a comment

the_darkglow January 28 2012, 06:29:54 UTC
I cobbled my own system together from separate components found online and code I wrote. I've been meaning to make it presentable and post it somewhere but it hasn't happened yet (and I wouldn't hold my breath).

First, I use a GreaseMonkey script I wrote in Firefox. It turns most LJ links into the "light" format and "reply" mode to make conversion easier and avoid a long stream of comments in my ebooks. Basically, it appends "?format=light&mode=reply" to LJ links (try copy/pasting at the end of an LJ URL to see what it does)... with some exceptions for the non-fic LJs I read and a bit of smarts so links that already have a "?" don't break.

Then I use the FlashGot Firefox extension to download all the chapters (using the Firefox built-in downloader so it can see everything I can without having to re-enter my password). This works especially well if the story has a masterpost: just select all the chapter links, tell it where to download them and they're all there. Otherwise, I have to go to each chapter, hit the "next" link and save the file.

Then I wrote a Python script that chews on the HTML to remove a bunch of things my reader didn't like, things I didn't like, things that were useless on an ereader (like forms and javascript), etc. Oh, I also remove all images (keeping them made things way more complicated so I went the simple route); so if a story relies heavily on included images, this isn't the best way to go. That script is the most complex part of my "system" (and the first one I wrote, actually). If the story is a single chapter, I stop here since my reader does fine with HTML.

If I have a multi-chapter story, I have a bash script (that's a linux/unix command line scripting language) that creates a table of content file and gives it to Calibre's ebook-convert utility to bring it all together into an ePub with the given title and author info. I used to do the last step with MobiPerl back when I had a reader that read .mobi files but swiched reader so I had to create something else.

The only thing that "breaks" this workflow is when an author doesn't post chapters in the order they should be read because the system relies on the number of the post (the number before the .html in the URL) to know in what order the chapters go. Other than that, this works pretty well.

I've been evolving this for almost 4 years in starts and spurts, that's why it's all in different languages and using different tools.

It's creaky, but it works. :)

Reply


Leave a comment

Up