2016-06-28 09:19:01 +12:00
|
|
|
|
|
|
|
import JSZip from 'jszip'
|
|
|
|
import escapeStringRegexp from 'escape-string-regexp'
|
|
|
|
import zeroFill from 'zero-fill'
|
|
|
|
import { XmlEntities } from 'html-entities'
|
2016-08-15 21:11:20 +12:00
|
|
|
import sanitize from 'sanitize-filename'
|
2016-08-16 01:12:20 +12:00
|
|
|
import URL from 'url'
|
2016-06-28 09:19:01 +12:00
|
|
|
import isNode from 'detect-node'
|
|
|
|
|
|
|
|
import { styleCss, coverstyleCss, titlestyleCss } from './styles'
|
|
|
|
|
|
|
|
import { cleanMarkup } from './cleanMarkup'
|
|
|
|
import fetchRemote from './fetchRemote'
|
|
|
|
import * as template from './templates'
|
|
|
|
|
|
|
|
import { mimeMap, containerXml } from './constants'
|
|
|
|
|
|
|
|
const entities = new XmlEntities()
|
|
|
|
|
2016-08-15 08:42:57 +12:00
|
|
|
module.exports = class FimFic2Epub {
|
2016-06-28 09:19:01 +12:00
|
|
|
|
2016-08-17 02:33:52 +12:00
|
|
|
static getStoryId (id) {
|
|
|
|
if (isNaN(id)) {
|
|
|
|
let url = URL.parse(id, false, true)
|
2016-08-16 01:12:20 +12:00
|
|
|
if (url.hostname === 'www.fimfiction.net' || url.hostname === 'fimfiction.net') {
|
|
|
|
let m = url.pathname.match(/^\/story\/(\d+)/)
|
|
|
|
if (m) {
|
2016-08-17 02:33:52 +12:00
|
|
|
id = m[1]
|
2016-08-16 01:12:20 +12:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-08-17 02:33:52 +12:00
|
|
|
return id
|
|
|
|
}
|
|
|
|
|
|
|
|
static getFilename (storyInfo) {
|
|
|
|
return sanitize(storyInfo.title + ' by ' + storyInfo.author.name + '.epub')
|
|
|
|
}
|
|
|
|
|
|
|
|
static fetchStoryInfo (storyId) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
storyId = FimFic2Epub.getStoryId(storyId)
|
|
|
|
let url = 'https://www.fimfiction.net/api/story.php?story=' + storyId
|
|
|
|
fetchRemote(url, (raw, type) => {
|
|
|
|
let data
|
|
|
|
try {
|
|
|
|
data = JSON.parse(raw)
|
|
|
|
} catch (e) {}
|
|
|
|
if (!data) {
|
|
|
|
reject('Unable to fetch story info')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (data.error) {
|
|
|
|
reject(data.error)
|
|
|
|
return
|
|
|
|
}
|
2016-08-17 20:37:41 +12:00
|
|
|
let story = data.story
|
|
|
|
// this is so the metadata can be cached.
|
|
|
|
if (!story.chapters) story.chapters = []
|
|
|
|
delete story.likes
|
|
|
|
delete story.dislikes
|
|
|
|
delete story.views
|
|
|
|
delete story.total_views
|
|
|
|
delete story.comments
|
|
|
|
story.chapters.forEach((ch) => {
|
|
|
|
delete ch.views
|
|
|
|
})
|
2016-08-17 02:33:52 +12:00
|
|
|
resolve(data.story)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor (storyId) {
|
|
|
|
this.storyId = FimFic2Epub.getStoryId(storyId)
|
|
|
|
|
2016-08-16 01:12:20 +12:00
|
|
|
this.hasDownloaded = false
|
2016-06-28 09:19:01 +12:00
|
|
|
this.isDownloading = false
|
|
|
|
this.zip = null
|
|
|
|
this.chapterContent = []
|
|
|
|
this.remoteResources = new Map()
|
|
|
|
this.storyInfo = null
|
|
|
|
this.isDownloading = false
|
2016-08-15 21:11:20 +12:00
|
|
|
this.cachedFile = null
|
2016-06-28 09:19:01 +12:00
|
|
|
this.hasCoverImage = false
|
2016-08-16 01:12:20 +12:00
|
|
|
this.coverImageDimensions = {width: 0, height: 0}
|
2016-06-28 09:19:01 +12:00
|
|
|
this.includeTitlePage = true
|
|
|
|
this.categories = []
|
|
|
|
this.tags = []
|
|
|
|
}
|
|
|
|
|
|
|
|
download () {
|
2016-06-28 19:39:31 +12:00
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
if (this.isDownloading) {
|
2016-08-15 21:11:20 +12:00
|
|
|
reject('Already downloading')
|
2016-06-28 09:19:01 +12:00
|
|
|
return
|
|
|
|
}
|
2016-08-16 01:12:20 +12:00
|
|
|
if (this.hasDownloaded) {
|
2016-06-28 19:39:31 +12:00
|
|
|
resolve()
|
2016-06-28 09:19:01 +12:00
|
|
|
return
|
|
|
|
}
|
2016-06-28 19:39:31 +12:00
|
|
|
this.build().then(resolve).catch(reject)
|
|
|
|
})
|
|
|
|
}
|
2016-06-28 09:19:01 +12:00
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
build () {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
this.isDownloading = true
|
|
|
|
|
|
|
|
this.zip = new JSZip()
|
|
|
|
this.zip.file('mimetype', 'application/epub+zip')
|
|
|
|
this.zip.file('META-INF/container.xml', containerXml)
|
|
|
|
|
|
|
|
console.log('Fetching story metadata...')
|
|
|
|
|
2016-08-17 02:33:52 +12:00
|
|
|
FimFic2Epub.fetchStoryInfo(this.storyId).then((storyInfo) => {
|
|
|
|
this.storyInfo = storyInfo
|
2016-06-28 19:39:31 +12:00
|
|
|
this.storyInfo.uuid = 'urn:fimfiction:' + this.storyInfo.id
|
|
|
|
|
2016-08-17 02:33:52 +12:00
|
|
|
this.filename = FimFic2Epub.getFilename(this.storyInfo)
|
2016-08-15 21:11:20 +12:00
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
this.zip.file('Styles/style.css', styleCss)
|
|
|
|
this.zip.file('Styles/coverstyle.css', coverstyleCss)
|
|
|
|
if (this.includeTitlePage) {
|
|
|
|
this.zip.file('Styles/titlestyle.css', titlestyleCss)
|
|
|
|
}
|
2016-06-28 09:19:01 +12:00
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
this.zip.file('toc.ncx', template.createNcx(this))
|
|
|
|
this.zip.file('Text/nav.xhtml', template.createNav(this))
|
|
|
|
|
|
|
|
this.fetchTitlePage(resolve, reject)
|
2016-08-17 02:33:52 +12:00
|
|
|
}).catch(reject)
|
2016-06-28 09:19:01 +12:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
fetchTitlePage (resolve, reject) {
|
|
|
|
console.log('Fetching index page...')
|
2016-08-17 02:33:52 +12:00
|
|
|
fetchRemote(this.storyInfo.url, (raw, type) => {
|
2016-06-28 19:39:31 +12:00
|
|
|
this.extractTitlePageInfo(raw).then(() => this.checkCoverImage(resolve, reject))
|
2016-06-28 09:19:01 +12:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
extractTitlePageInfo (html) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
let descPos = html.indexOf('<div class="description" id="description')
|
|
|
|
descPos = descPos + html.substring(descPos).indexOf('">') + 2
|
|
|
|
html = html.substring(descPos)
|
|
|
|
let ma = html.match(/<a href="(.*?)" class="source">Source<\/a>/)
|
|
|
|
this.storyInfo.source_image = null
|
|
|
|
if (ma) {
|
|
|
|
this.storyInfo.source_image = ma[1]
|
|
|
|
}
|
|
|
|
let endCatsPos = html.indexOf('<hr />')
|
|
|
|
let startCatsPos = html.substring(0, endCatsPos).lastIndexOf('</div>')
|
|
|
|
let catsHtml = html.substring(startCatsPos, endCatsPos)
|
|
|
|
html = html.substring(endCatsPos + 6)
|
|
|
|
|
|
|
|
let categories = []
|
|
|
|
let matchCategory = /<a href="(.*?)" class="(.*?)">(.*?)<\/a>/g
|
|
|
|
for (let c; (c = matchCategory.exec(catsHtml));) {
|
|
|
|
categories.push({
|
|
|
|
url: 'http://www.fimfiction.net' + c[1],
|
|
|
|
className: c[2],
|
|
|
|
name: entities.decode(c[3])
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.categories = categories
|
2016-06-28 09:19:01 +12:00
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
ma = html.match(/This story is a sequel to <a href="([^"]*)">(.*?)<\/a>/)
|
|
|
|
if (ma) {
|
|
|
|
this.storyInfo.prequel = {
|
|
|
|
url: 'http://www.fimfiction.net' + ma[1],
|
|
|
|
title: entities.decode(ma[2])
|
|
|
|
}
|
|
|
|
html = html.substring(html.indexOf('<hr />') + 6)
|
|
|
|
}
|
|
|
|
let endDescPos = html.indexOf('</div>\n')
|
|
|
|
let description = html.substring(0, endDescPos).trim()
|
|
|
|
|
|
|
|
html = html.substring(endDescPos + 7)
|
|
|
|
let extraPos = html.indexOf('<div class="extra_story_data">')
|
|
|
|
html = html.substring(extraPos + 30)
|
|
|
|
|
|
|
|
ma = html.match(/<span class="published">First Published<\/span><br \/><span>(.*?)<\/span>/)
|
|
|
|
if (ma) {
|
|
|
|
let date = ma[1]
|
|
|
|
date = date.replace(/^(\d+)[a-z]+? ([a-zA-Z]+? \d+)$/, '$1 $2')
|
|
|
|
this.storyInfo.publishDate = (new Date(date).getTime() / 1000) | 0
|
2016-06-28 09:19:01 +12:00
|
|
|
}
|
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
html = html.substring(0, html.indexOf('<div class="button-group"'))
|
2016-06-28 09:19:01 +12:00
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
let tags = []
|
|
|
|
tags.byImage = {}
|
|
|
|
let matchTag = /<a href="\/tag\/(.*?)" class="character_icon" title="(.*?)" style=".*?"><img src="(.*?)" class="character_icon" \/><\/a>/g
|
|
|
|
for (let tag; (tag = matchTag.exec(html));) {
|
|
|
|
let t = {
|
|
|
|
url: 'http://www.fimfiction.net/tag/' + tag[1],
|
|
|
|
name: entities.decode(tag[2]),
|
|
|
|
image: entities.decode(tag[3])
|
|
|
|
}
|
|
|
|
tags.push(t)
|
|
|
|
tags.byImage[t.image] = t
|
|
|
|
if (this.includeTitlePage) {
|
|
|
|
this.remoteResources.set(t.image, {filename: 'tag-' + tag[1], originalUrl: t.image, where: ['tags']})
|
|
|
|
}
|
2016-06-28 09:19:01 +12:00
|
|
|
}
|
2016-06-28 19:39:31 +12:00
|
|
|
this.tags = tags
|
2016-06-28 09:19:01 +12:00
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
cleanMarkup(description, (html) => {
|
|
|
|
this.storyInfo.description = html
|
|
|
|
this.findRemoteResources('description', 'description', html)
|
|
|
|
resolve()
|
|
|
|
})
|
2016-06-28 09:19:01 +12:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-06-28 19:39:31 +12:00
|
|
|
checkCoverImage (resolve, reject) {
|
2016-06-28 09:19:01 +12:00
|
|
|
this.hasCoverImage = !!this.storyInfo.full_image
|
|
|
|
|
|
|
|
if (this.hasCoverImage) {
|
|
|
|
this.remoteResources.set(this.storyInfo.full_image, {filename: 'cover', where: ['cover']})
|
|
|
|
|
|
|
|
if (!isNode) {
|
|
|
|
let coverImage = new Image()
|
|
|
|
coverImage.src = this.storyInfo.full_image
|
|
|
|
|
|
|
|
coverImage.addEventListener('load', () => {
|
2016-08-16 01:12:20 +12:00
|
|
|
this.coverImageDimensions.width = coverImage.width
|
|
|
|
this.coverImageDimensions.height = coverImage.height
|
|
|
|
this.processStory(resolve, reject)
|
2016-06-28 09:19:01 +12:00
|
|
|
}, false)
|
2016-08-16 01:12:20 +12:00
|
|
|
coverImage.addEventListener('error', () => {
|
|
|
|
console.warn('Unable to fetch cover image, skipping...')
|
|
|
|
this.hasCoverImage = false
|
|
|
|
this.processStory(resolve, reject)
|
|
|
|
})
|
2016-06-28 09:19:01 +12:00
|
|
|
} else {
|
2016-08-16 01:12:20 +12:00
|
|
|
this.processStory(resolve, reject)
|
2016-06-28 09:19:01 +12:00
|
|
|
}
|
|
|
|
} else {
|
2016-06-28 19:39:31 +12:00
|
|
|
this.processStory(resolve, reject)
|
2016-06-28 09:19:01 +12:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-16 01:12:20 +12:00
|
|
|
processStory (resolve, reject) {
|
2016-06-28 09:19:01 +12:00
|
|
|
console.log('Fetching chapters...')
|
|
|
|
|
|
|
|
this.fetchChapters(() => {
|
2016-08-16 01:12:20 +12:00
|
|
|
console.log('Fetching remote files...')
|
|
|
|
|
2016-06-28 09:19:01 +12:00
|
|
|
this.fetchRemoteFiles(() => {
|
2016-08-16 01:12:20 +12:00
|
|
|
console.log('Finishing build...')
|
|
|
|
|
2016-06-28 09:19:01 +12:00
|
|
|
let coverFilename = ''
|
|
|
|
this.remoteResources.forEach((r, url) => {
|
|
|
|
let dest = '../' + r.dest
|
|
|
|
if (r.dest && r.originalUrl && r.where) {
|
|
|
|
let ourl = new RegExp(escapeStringRegexp(r.originalUrl), 'g')
|
|
|
|
for (var i = 0; i < r.where.length; i++) {
|
|
|
|
let w = r.where[i]
|
|
|
|
if (typeof w === 'number') {
|
|
|
|
this.chapterContent[w] = this.chapterContent[w].replace(ourl, dest)
|
|
|
|
} else if (w === 'description') {
|
|
|
|
this.storyInfo.description = this.storyInfo.description.replace(ourl, dest)
|
|
|
|
} else if (w === 'tags') {
|
|
|
|
this.tags.byImage[r.originalUrl].image = dest
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (r.filename === 'cover' && r.dest) {
|
|
|
|
coverFilename = dest
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
for (let num = 0; num < this.chapterContent.length; num++) {
|
|
|
|
let html = this.chapterContent[num]
|
|
|
|
let filename = 'Text/chapter_' + zeroFill(3, num + 1) + '.xhtml'
|
|
|
|
this.zip.file(filename, html)
|
|
|
|
}
|
|
|
|
|
|
|
|
this.chapterContent.length = 0
|
|
|
|
|
|
|
|
if (this.hasCoverImage) {
|
2016-08-16 01:12:20 +12:00
|
|
|
this.zip.file('Text/cover.xhtml', template.createCoverPage(coverFilename, this.coverImageDimensions.width, this.coverImageDimensions.height))
|
2016-06-28 09:19:01 +12:00
|
|
|
} else {
|
|
|
|
this.zip.file('Text/cover.xhtml', template.createCoverPage(this))
|
|
|
|
}
|
|
|
|
|
2016-08-16 01:12:20 +12:00
|
|
|
if (this.includeTitlePage) {
|
|
|
|
this.zip.file('Text/title.xhtml', template.createTitlePage(this))
|
|
|
|
}
|
|
|
|
|
2016-06-28 09:19:01 +12:00
|
|
|
this.zip.file('content.opf', template.createOpf(this))
|
|
|
|
|
2016-08-15 21:11:20 +12:00
|
|
|
this.isDownloading = false
|
2016-08-16 01:12:20 +12:00
|
|
|
this.hasDownloaded = true
|
2016-08-15 21:11:20 +12:00
|
|
|
resolve()
|
2016-06-28 09:19:01 +12:00
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchRemoteFiles (cb) {
|
|
|
|
let iter = this.remoteResources.entries()
|
|
|
|
let count = 0
|
|
|
|
let completeCount = 0
|
|
|
|
|
|
|
|
let recursive = () => {
|
|
|
|
let r = iter.next().value
|
|
|
|
if (!r) {
|
|
|
|
if (completeCount === this.remoteResources.size) {
|
|
|
|
cb()
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
let url = r[0]
|
|
|
|
r = r[1]
|
|
|
|
|
|
|
|
console.log('Fetching remote file ' + (count + 1) + ' of ' + this.remoteResources.size + ': ' + r.filename, url)
|
|
|
|
count++
|
|
|
|
|
|
|
|
fetchRemote(url, (data, type) => {
|
|
|
|
r.dest = null
|
|
|
|
r.type = type
|
|
|
|
let dest = mimeMap[type]
|
|
|
|
|
|
|
|
if (dest) {
|
|
|
|
r.dest = dest.replace('*', r.filename)
|
|
|
|
this.zip.file(r.dest, data)
|
2016-08-16 01:12:20 +12:00
|
|
|
if (isNode && r.filename === 'cover') {
|
|
|
|
const sizeOf = require('image-size')
|
|
|
|
this.coverImageDimensions = sizeOf(data)
|
|
|
|
}
|
2016-06-28 09:19:01 +12:00
|
|
|
}
|
|
|
|
completeCount++
|
|
|
|
recursive()
|
|
|
|
}, 'arraybuffer')
|
|
|
|
}
|
|
|
|
|
|
|
|
// concurrent downloads!
|
|
|
|
recursive()
|
|
|
|
recursive()
|
|
|
|
recursive()
|
|
|
|
recursive()
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchChapters (cb) {
|
|
|
|
let chapters = this.storyInfo.chapters
|
|
|
|
let chapterCount = this.storyInfo.chapters.length
|
|
|
|
let currentChapter = 0
|
|
|
|
let completeCount = 0
|
|
|
|
|
|
|
|
if (chapterCount === 0) {
|
|
|
|
cb()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
let recursive = () => {
|
|
|
|
let index = currentChapter++
|
|
|
|
let ch = chapters[index]
|
|
|
|
if (!ch) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
console.log('Fetching chapter ' + (index + 1) + ' of ' + chapters.length + ': ' + ch.title)
|
2016-08-16 01:12:20 +12:00
|
|
|
let url = ch.link.replace('http', 'https')
|
|
|
|
fetchRemote(url, (html) => {
|
2016-06-28 09:19:01 +12:00
|
|
|
template.createChapter(ch, html, (html) => {
|
|
|
|
this.findRemoteResources('ch_' + zeroFill(3, index + 1), index, html)
|
|
|
|
this.chapterContent[index] = html
|
|
|
|
completeCount++
|
|
|
|
if (completeCount < chapterCount) {
|
|
|
|
recursive()
|
|
|
|
} else {
|
|
|
|
cb()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// concurrent downloads!
|
|
|
|
recursive()
|
|
|
|
recursive()
|
|
|
|
recursive()
|
|
|
|
recursive()
|
|
|
|
}
|
|
|
|
|
|
|
|
findRemoteResources (prefix, where, html) {
|
|
|
|
let remoteCounter = 1
|
|
|
|
let matchUrl = /<img.*?src="([^">]*\/([^">]*?))".*?>/g
|
|
|
|
let emoticonUrl = /static\.fimfiction\.net\/images\/emoticons\/([a-z_]*)\.[a-z]*$/
|
|
|
|
|
|
|
|
for (let ma; (ma = matchUrl.exec(html));) {
|
|
|
|
let url = ma[1]
|
|
|
|
let cleanurl = decodeURI(entities.decode(url))
|
|
|
|
if (this.remoteResources.has(cleanurl)) {
|
|
|
|
let r = this.remoteResources.get(cleanurl)
|
|
|
|
if (r.where.indexOf(where) === -1) {
|
|
|
|
r.where.push(where)
|
|
|
|
}
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
let filename = prefix + '_' + remoteCounter
|
|
|
|
let emoticon = url.match(emoticonUrl)
|
|
|
|
if (emoticon) {
|
|
|
|
filename = 'emoticon_' + emoticon[1]
|
|
|
|
}
|
|
|
|
remoteCounter++
|
|
|
|
this.remoteResources.set(cleanurl, {filename: filename, where: [where], originalUrl: url})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-15 21:11:20 +12:00
|
|
|
// for node, resolve a Buffer, in browser resolve a Blob
|
|
|
|
getFile () {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
if (this.cachedFile) {
|
2016-08-17 20:59:09 +12:00
|
|
|
resolve(this.cachedFile)
|
2016-08-15 21:11:20 +12:00
|
|
|
return
|
|
|
|
}
|
2016-08-16 01:12:20 +12:00
|
|
|
if (!this.hasDownloaded) {
|
|
|
|
reject('Not downloaded.')
|
|
|
|
return
|
|
|
|
}
|
2016-06-28 19:39:31 +12:00
|
|
|
this.zip
|
2016-08-15 21:11:20 +12:00
|
|
|
.generateAsync({
|
|
|
|
type: isNode ? 'nodebuffer' : 'blob',
|
2016-06-28 19:39:31 +12:00
|
|
|
mimeType: 'application/epub+zip',
|
|
|
|
compression: 'DEFLATE',
|
|
|
|
compressionOptions: {level: 9}
|
2016-08-15 21:11:20 +12:00
|
|
|
}).then((file) => {
|
|
|
|
this.cachedFile = file
|
2016-08-17 20:59:09 +12:00
|
|
|
resolve(file)
|
2016-06-28 19:39:31 +12:00
|
|
|
})
|
2016-08-15 21:11:20 +12:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// example usage: .pipe(fs.createWriteStream(filename))
|
|
|
|
streamFile () {
|
2016-08-16 01:12:20 +12:00
|
|
|
if (!this.hasDownloaded) {
|
2016-08-16 01:15:13 +12:00
|
|
|
return null
|
2016-08-16 01:12:20 +12:00
|
|
|
}
|
2016-08-15 21:11:20 +12:00
|
|
|
return this.zip
|
|
|
|
.generateNodeStream({
|
|
|
|
type: 'nodebuffer',
|
|
|
|
streamFiles: true,
|
|
|
|
mimeType: 'application/epub+zip',
|
|
|
|
compression: 'DEFLATE',
|
|
|
|
compressionOptions: {level: 9}
|
|
|
|
})
|
2016-06-28 09:19:01 +12:00
|
|
|
}
|
|
|
|
}
|