Fix image in PDF and filename
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c1203f98fe
commit
19ee4f1eb5
13
index.js
13
index.js
@ -24,6 +24,14 @@ const fetchPage = async (url) => {
|
|||||||
content.querySelectorAll('iframe').map((c) => c.remove())
|
content.querySelectorAll('iframe').map((c) => c.remove())
|
||||||
content.querySelectorAll('script').map((c) => c.remove())
|
content.querySelectorAll('script').map((c) => c.remove())
|
||||||
content.querySelectorAll('div.tiled-gallery').map((c) => c.remove())
|
content.querySelectorAll('div.tiled-gallery').map((c) => c.remove())
|
||||||
|
content.querySelectorAll('img').map((c) => {
|
||||||
|
for (const attr in c.attributes) {
|
||||||
|
if (attr !== 'src') {
|
||||||
|
c.removeAttribute(attr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const data = content.toString()
|
const data = content.toString()
|
||||||
|
|
||||||
console.log(title)
|
console.log(title)
|
||||||
@ -62,7 +70,10 @@ const run = async (url, author, lang) => {
|
|||||||
const page = await fetchPage(link)
|
const page = await fetchPage(link)
|
||||||
metadatas.content.push(page)
|
metadatas.content.push(page)
|
||||||
}
|
}
|
||||||
const epub = new EPub(metadatas, `output/${title} Volume ${volume}.epub`)
|
const epub = new EPub(
|
||||||
|
metadatas,
|
||||||
|
`output/${title} - Volume ${volume}.epub`
|
||||||
|
)
|
||||||
await epub.render()
|
await epub.render()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user