diff --git a/fanficdownloader/epubmerge.py b/fanficdownloader/epubmerge.py index 6d35be6a..88b0bcb6 100644 --- a/fanficdownloader/epubmerge.py +++ b/fanficdownloader/epubmerge.py @@ -81,6 +81,10 @@ def main(): outputepub = ZipFile(outputopt, "w", compression=ZIP_STORED) outputepub.debug = 3 outputepub.writestr("mimetype", "application/epub+zip") + # declares all the files created by Windows. otherwise, when + # it runs in appengine, windows unzips the files as 000 perms. + for zf in outputepub.filelist: + zf.create_system = 0 outputepub.close() ## Re-open file for content. @@ -277,6 +281,10 @@ def main(): outputepub.writestr("content.opf",contentdom.toxml('utf-8')) outputepub.writestr("toc.ncx",tocncxdom.toxml('utf-8')) + # declares all the files created by Windows. otherwise, when + # it runs in appengine, windows unzips the files as 000 perms. + for zf in outputepub.filelist: + zf.create_system = 0 outputepub.close() ## Utility method for creating new tags. diff --git a/fanficdownloader/writers/base_writer.py b/fanficdownloader/writers/base_writer.py index f8866d55..7e8d13c3 100644 --- a/fanficdownloader/writers/base_writer.py +++ b/fanficdownloader/writers/base_writer.py @@ -159,6 +159,10 @@ class BaseStoryWriter(Configurable): self.writeStoryImpl(out) zipout = ZipFile(outstream, 'w', compression=ZIP_DEFLATED) zipout.writestr(filename,out.getvalue()) + # declares all the files created by Windows. otherwise, when + # it runs in appengine, windows unzips the files as 000 perms. + for zf in zipout.filelist: + zf.create_system = 0 zipout.close() out.close() else: diff --git a/fanficdownloader/writers/writer_epub.py b/fanficdownloader/writers/writer_epub.py index a7d149c6..150ab7ab 100644 --- a/fanficdownloader/writers/writer_epub.py +++ b/fanficdownloader/writers/writer_epub.py @@ -153,11 +153,13 @@ h6 { text-align: center; } ## ZipFile can't change compression type file-by-file, so we ## have to close and re-open outputepub = ZipFile(zipio, 'w', compression=ZIP_STORED) + outputepub.debug=3 outputepub.writestr('mimetype','application/epub+zip') outputepub.close() ## Re-open file for content. outputepub = ZipFile(zipio, 'a', compression=ZIP_DEFLATED) + outputepub.debug=3 ## Create META-INF/container.xml file. The only thing it does is ## point to content.opf @@ -238,6 +240,8 @@ h6 { text-align: center; } metadata.appendChild(newTag(contentdom,"dc:description",text= self.getMetadata('description'))) + metadata.appendChild(newTag(contentdom,"dc:subject",text= + self.getMetadata('status'))) # listables all go into dc:suject tags, but only if they are configured. for (name,lst) in self.story.getLists().iteritems(): if name in self.getConfigList("include_subject_tags"): @@ -387,7 +391,12 @@ h6 { text-align: center; } fullhtml = fullhtml.replace('
','\n').replace('Hi, {{ nickname }}! This is a fan fiction downloader, which makes reading stories from various websites much easier.
-For Amazon Kindle use Mobi output(see notice below), for Sony Reader, Nook and iPad use ePub
Or see your personal list of previously downloaded fanfics.
- If you select EPub format, when it's done you will also be given a 'Convert' link. + This version is a new re-org/re-write of the code
- That link will take you to convertfiles.com where you can - directly convert your new story to FictionBook (fb2), Mobipocket (mobi), MS Reader (lit) or Adobe Portable - Document Format(pdf). - There's also a 'Convert' link for EPubs on your recent downloads - page. We'd really like to hear from users about this in our Google Group. + So far, only a few sites are supported: fanfiction.net, twilighted.net and whofic.com.
- We'd especially like Kindle and other Mobi users to try it. The convertfiles.com Mobi file - appears to be more correct than our Mobi output. + Mobi support (for Kindle) is only via EPub conversion in this version.
For Mobi (Kindle) select EPub and Convert it.
+For Mobi (Kindle) select EPub and use the Convert link when it's finished.