honghaitzz11 6 years ago
parent
commit
b6d77cbff4
9 changed files with 438 additions and 416 deletions
  1. 1 0
      .gitignore
  2. 13 12
      01-app.js
  3. 24 355
      02-other.js
  4. 11 12
      03-jietu.js
  5. 14 13
      04-page.js
  6. 367 24
      utils/base.js
  7. 8 0
      utils/config.js
  8. 0 0
      utils/list.js
  9. 0 0
      xindaming.js

+ 1 - 0
.gitignore

@@ -2,5 +2,6 @@
 *.epub
 package-lock.json
 *.lock
+.idea/
 book/
 node_modules/

+ 13 - 12
01-app.js

@@ -1,22 +1,25 @@
 const puppeteer = require('puppeteer');
 const fs = require("fs");
 const shell = require('shelljs');
+const config = require('./utils/config');
+// 开启代理
+shell.exec('export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:1080');
 (async () => {
   const browser = await puppeteer.launch({
     // executablePath: './chromium/chrome.exe',
     args: ['--no-sandbox', '--disable-setuid-sandbox'],  // 沙箱模式下运行
-    headless: true, //默认为true(无头),不显示浏览器界面
-    slowMo: 200, //减速显示,有时会作为模拟人操作特意减速
-    devtools: true //显示开发者工具。页面宽高默认800*600,把开发者工具显示再隐藏页面会占满屏幕,有没有大佬解释下?
+    // headless: false, //默认为true(无头),不显示浏览器界面
+    // slowMo: 200, //减速显示,有时会作为模拟人操作特意减速
+    // devtools: true //显示开发者工具。页面宽高默认800*600,把开发者工具显示再隐藏页面会占满屏幕,有没有大佬解释下?
   });
   //生成Page对象
   //const page = await browser.newPage();//官网写法:一打开浏览器会打开两个tab,第二个才是你正在操作的tab
   const page = (await browser.pages())[0]; //这是我的写法,只有一个tab
-  await page.goto('https://www.qu.la/book/27473/'); //跳转到掘金
-
+  await page.goto(config.url); //跳转到掘金
+  
   //请开始你的表演...
-  const result = await page.evaluate(() => {
-
+  const result = await page.evaluate((config) => {
+    
     return new Promise(resolve => {
       // let $titles = document.querySelector('.cell-items').getElementsByTagName('li');
       let $titles = document.getElementsByTagName('dd');
@@ -35,19 +38,17 @@ const shell = require('shelljs');
         }
         console.log($titles[index]);
         titles.push({
-          href: `https://www.qu.la${$titles[index].getElementsByTagName('a')[0].getAttribute('href')}`,
+          href: `${config.href}${$titles[index].getElementsByTagName('a')[0].getAttribute('href')}`,
           title: $titles[index].getElementsByTagName('a')[0].innerText,
           index: index + 1
         });
         index += 1;
       }, 30);
     });
-
-
-  });
+  }, config);
   await browser.close(); //关闭浏览器
   console.log('over');
-  fs.writeFileSync('./xindaming.js', 'module.exports =' + JSON.stringify(result));
+  fs.writeFileSync('./utils/list.js', 'module.exports =' + JSON.stringify(result));
   // 执行其他命令
   shell.exec('node 02-other.js');
   shell.exec('node 03-jietu.js');

+ 24 - 355
02-other.js

@@ -2,370 +2,39 @@ const fs = require('fs');
 const moment = require('moment');
 const shell = require('shelljs');
 const utils = require('./utils/base');
-
-var $xindaming = require('./xindaming');
-utils.uid = moment().format();
-utils.time = moment().format('YYYY-MM-DD');
+const config = require('./utils/config');
+const _list = require('./utils/list');
+config.uid = moment().format();
+config.time = moment().format('YYYY-MM-DD');
 
 function mkdir(path) {
-	if (!fs.existsSync(path)) {
-		fs.mkdirSync(path)
-	}
+  if (!fs.existsSync(path)) {
+    fs.mkdirSync(path);
+  }
 }
 
-// shell.exec('rm -rf book && mkdir book');
+shell.exec('rm -rf book && mkdir book');
 
 mkdir('./book/META-INF');
 
-fs.writeFileSync('./book/META-INF/container.xml', `<?xml version="1.0" encoding="UTF-8"?>
-<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
-    <rootfiles>
-        <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
-   </rootfiles>
-</container>
-`)
-fs.writeFileSync('./book/mimetype', 'application/epub+zip')
-
-mkdir('./book/OEBPS')
-mkdir('./book/OEBPS/Images')
-mkdir('./book/OEBPS/Styles')
-fs.writeFileSync('./book/OEBPS/Styles/mc-style.css', `@charset "UTF-8";
-
-/*=========================font-face=========================*/
-@font-face {
-	font-family:"zw";
-	src:
-	local("宋体"),local("明体"),local("明朝"),
-	local("微软雅黑"),local("黑体"),
-	local("Songti"),local("Songti SC"),local("Songti TC"),
-	local("Song S"),local("Song T"),local("STBShusong"),local("TBMincho"),local("HYMyeongJo"),
-	local("DK-SONGTI")
-	local("Heiti"),local("Heiti SC"),local("Heiti TC"),
-	local("MYing Hei S"),local("MYing Hei T"),local("TBGothic"),
-	local("DK-HEITI"),
-	url(../Fonts/fzzy.ttf);
-}
-
-/* This defines styles and classes used in sioebook */
-
-/*Global Setting*/
-
-* {
-	margin: 0;
-	padding: 0;
-}
-
-body {
-	padding: 3% 2%;
-	margin-top: 3%;
-	margin-bottom: 3%;
-	margin-left: 1%;
-	margin-right: 1%;
-	line-height: 1.3em;
-	text-align: justify;
-	font-family: "Times New Roman","方正书宋","宋体","明体","zw",sans-serif;
-}
-
-/* P 正常段落 */
-p {
-	margin: 0.5em 0em;
-	line-height: 1.3em;
-	text-indent: 2em;
-}
-
-/* 居中、右、左 */
-.center {
-	text-indent: 0em;
-	text-align: center;
-}
-.right {
-	text-indent: 0em;
-	text-align: right;
-}
-.left {
-	text-indent: 0em;
-	text-align: left;
-}
-
-/*图片*/
-img {
-	border: none;
-	text-align: center;
-	/*max-width: 100%;*/
-	max-height: 100%;
-}
-
-/* 表格 */
-table {
-	border-collapse: collapse;
-	border-spacing: 0;
-	margin: 0 auto 0;
-	width: 100%;
-	font-size: small;
-	vertical-align:center;
-}
-tr,th,td {
-	margin: 0;
-	padding: 0.25em;
-	border: none;
-	font-size: 95%;
-	font-family: "Times New Roman","方正书宋","宋体","明体","zw",sans-serif;
-	text-indent: 0!important;
-	text-align: left;
-	vertical-align: middle;
-	color: #666666;
-	line-height: 1.05em;
-}
-
-/* 列表格式 */
-ul, ol	{
-	list-style:none;
-}
-/* 链接 颜色 不加下划线 */
-a {
-	text-decoration:none;
-	color: #663366;
-}
-a:hover {
-	text-decoration:none;
-	color: #CC99CC;
-}
-/* 文案 */
-.oval {
-	padding: 5% 5%;
-	margin: 12% 5% 2%;
-	border: 0px dotted #993333;
-	text-indent: 0em;
-	font-size: 0.9em;
-	color: #666666;
-}
-
-/* 水平线 */
-hr {
-	border:0;
-	background-color:#BEBEBE;
-	height:1.5px;
-	margin-top: 2%;
-	margin-bottom: 2%;
-}
-
-/* 上下标注 */
-sup {
-	font-size:small;
-}
-sub {
-	font-size:small;
-}
-
-/* 标题1 书名 卷 */
-h1 {
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	text-indent: 0em;
-	text-align:center;
-	line-height: 2em;
-	margin-top: 30%;
-	color: #996699;
-	text-shadow: 1px 1px 1px gray;
-}
-
-h2 {
-	color: #FFFFFF;
-	margin-left:25%;
-	line-height:200%;
-	border-style: none double solid solid;
-	border-width: 0px 3px 2px 30px;
-	font-weight:bold;
-	font-size:large;
-	border-color: #FFFFFF;
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	text-shadow: 1px 1px 1px gray;
-	padding: 2px 10px 2px 10px;
-}
-h2.epub {
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	text-indent: 0em;
-	font-size: 1.2em;
-	text-align: center;
-	width: 1em;
-	margin: 0em 5% 1.5em;
-	line-height: 110%;
-	color: #EEEEEE;
-	border-style: none double none none;
-	border-width: 0px 3px 0px 0px;
-	border-color: #EEEEEE;
-	padding: 0.5em 10px 0.5em 2px;
-	text-shadow: 0px 0px 0px #AAAAAA;
-}
-
-h3 {
-	margin: 1em 0 5em;
-	color: #663366;
-	line-height: 120%;
-	text-align: left;
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	text-shadow: 1px 1px 1px gray;
-	padding: 15px 12px 1em 5px;
-	border-style: none none dotted none;
-	border-color: #CC6699;
-	border-width: 0px 0px 1px 0px;
-	text-shadow: 1px 1px 1px #AAAAAA;
-}
-h3.ebook {
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	text-indent: 0em;
-	margin: 1em 0 1em;
-	padding: 2px 12px 2px 2px;
-	text-align: left;
-	line-height: 120%;
-	border-style: none none none none;
-	text-shadow: 1px 1px 1px #AAAAAA;
-}
-
-/* 章节序号 */
-.num {
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	background-color: #CC6699;
-	border-radius: 2px;
-	padding: 4px 0.5em;
-	color: #FFF;
-	font-size: small;
-	text-shadow: 1px 1px 1px #AAAAAA;
-}
-
-h4 {
-	line-height: 2em;
-	text-indent: 0em;
-	color: #FFFFFF;
-	margin-left:25%;
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	text-shadow: 1px 1px 1px gray;
-}
-
-h5 {
-	line-height: 1.5em;
-	text-indent: 0em;
-	color: #FF9900;
-	font-size: 14px;
-}
-
-.vol {
-	padding: 30% 5% 20%;
-	margin: 15% -2em 2%;
-	background-color: #996699;
-	text-indent: 0em;
-}
-.volbg {
-	background-color: #996699;
-}
-
-/* 作者译者编者等 */
-.author {
-	margin: 20% 0;
-	text-indent: 0em;
-	text-align: center;
-	font-size: 1em;
-	line-height: 120%;
-	font-weight: 600;
-	color: #;
-}
-.wt {
-	text-indent: 0em;
-	font-style:italic;
-	font-size: 0.9rem;
-	line-height: 1.2em;
-	color: #336699;
-}
-
-/* 出版社 */
-.copyright {
-	margin: 35% 0 0;
-	text-indent: 0em;
-	text-align: center;
-	font-size: 1em;
-	line-height: 120%;
-	font-weight: 300;
-	color: #;
-}
-
-/* 书票 */
-.exL {
-	margin: 45% 0;
-	text-align: center;
-	page-break-before: always;
-}
-.kh {
-	text-indent: 0em;
-	text-align: center;
-	font-size: 0.80em;
-	color: #EEEEEE;
-}
-
-/* 电子书信息 */
-.info {
-	font-size: 1em;
-	font-weight: bold;
-	line-height: 150%;
-	color: #666666;
-	margin: 0 0 1em 20%;
-}
-.info_items {
-	font-size: 0.8em;
-	line-height: 120%;
-	color: #666666;
-	margin: 0 0 0 20%;
-}
-/* 多看 图框 */
-.duokan-image-single {
-	margin: 0.5em 0;
-	bottom: 2%;
-	text-align: center;
-}
-
-/*++*/
-.rht {
-	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
-	font-size: 115%;
-	line-height: 120%;
-	text-indent: 0em;
-	text-align: right;
-	color: #CCCCCC;
-}
-.lt {
-	font-size: 80%;
-	text-indent: 0em;
-	text-align: right;
-	color: #003366;
-}
-div.float {
-	width: 42%;
-	float: right;
-	margin: 1em 0 0em 1em;
-}`)
-mkdir('./book/OEBPS/Text')
-fs.writeFileSync('./book/OEBPS/Text/cover.xhtml', `<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+fs.writeFileSync('./book/META-INF/container.xml', utils.container());
+fs.writeFileSync('./book/mimetype', 'application/epub+zip');
 
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <title>Cover</title>
-</head>
-<body>
-  <div style="text-align: center; padding: 0pt; margin: 0pt;">
-    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 240 300" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
-      <image width="240" height="300" xlink:href="../Images/cover.jpg"/>
-    </svg>
-  </div>
-</body>
-</html>`)
+mkdir('./book/OEBPS');
+mkdir('./book/OEBPS/Images');
+mkdir('./book/OEBPS/Styles');
+fs.writeFileSync('./book/OEBPS/Styles/mc-style.css', utils.style());
+mkdir('./book/OEBPS/Text');
+fs.writeFileSync('./book/OEBPS/Text/cover.xhtml', utils.cover());
 
 // opf toc.ncx ...
-utils.opf(utils, $xindaming).then(res => {
-	fs.writeFileSync('./book/OEBPS/content.opf', res);
-	return utils.tocNcx(utils, $xindaming)
+utils.opf(config, _list).then(res => {
+  fs.writeFileSync('./book/OEBPS/content.opf', res);
+  return utils.tocNcx(config, _list);
 }).then(res => {
-	fs.writeFileSync('./book/OEBPS/toc.ncx', res);
-	return utils.book(utils)
+  fs.writeFileSync('./book/OEBPS/toc.ncx', res);
+  return utils.book(config);
 }).then(res => {
-	fs.writeFileSync('./book/OEBPS/Text/book.xhtml', res)
-});
+  fs.writeFileSync('./book/OEBPS/Text/book.xhtml', res);
+});
+console.log('基本目录结构创建完毕!');

+ 11 - 12
03-jietu.js

@@ -1,32 +1,31 @@
 const express = require('express');
 const shell = require('shelljs');
+const config = require('./utils/config');
 const app = express();
 
 app.use(express.static('cover'));
 
 app.listen(3000, function () {
-  console.log('Example app listening on port 3000!');
+  console.log('开始制作封面!');
 });
 const pid = process.pid;
 // return
 const puppeteer = require('puppeteer');
 
-const utils = require('./utils/base');
-
-const start = async (utils) => {
+const start = async (config) => {
   const browser = await puppeteer.launch({
     args: ['--no-sandbox', '--disable-setuid-sandbox'], // 沙箱模式下运行
   });
   const page = await browser.newPage();
   await page.goto('http://localhost:3000/');
-
+  
   //调用evaluate 方法返回id 为form元素的位置信息
-  let clip = await page.evaluate((utils) => {
+  let clip = await page.evaluate((config) => {
     // 设置标题
     const title = document.getElementById('title');
     const author = document.getElementById('author');
-    title.innerText = utils.name;
-    author.innerText = utils.author;
+    title.innerText = config.name;
+    author.innerText = config.author;
     let {
       x,
       y,
@@ -39,8 +38,8 @@ const start = async (utils) => {
       width,
       height
     };
-  }, utils);
-
+  }, config);
+  
   await page.screenshot({
     path: './book/OEBPS/Images/cover.jpg',
     clip: clip //设置clip 属性
@@ -48,6 +47,6 @@ const start = async (utils) => {
   await page.close();
   await browser.close();
   shell.exec(`kill ${pid}`);
-}
+};
 
-start(utils);
+start(config);

+ 14 - 13
04-page.js

@@ -2,15 +2,16 @@ const fs = require("fs");
 const puppeteer = require('puppeteer');
 const shell = require('shelljs');
 const utils = require('./utils/base');
-var $xindaming = require('./xindaming');
-const len = $xindaming.length;
-let index = 1019;
+const config = require('./utils/config');
+var _list = require('./utils/list');
+const len = _list.length;
+let index = 735;
 
 const createPage = async (url) => {
   const browser = await puppeteer.launch({
     args: ['--no-sandbox', '--disable-setuid-sandbox'], // 沙箱模式下运行
-    headless: true, //默认为true(无头),不显示浏览器界面
-    // slowMo: 200,
+    // headless: false, //默认为true(无头),不显示浏览器界面
+    slowMo: 200,
   });
   const page = (await browser.pages())[0]; //这是我的写法,只有一个tab
   await page.goto(url); //跳转到掘金
@@ -29,24 +30,24 @@ const createPage = async (url) => {
 forEachUrl();
 
 function forEachUrl() {
-  if ($xindaming[index] !== undefined) {
+  if (_list[index] !== undefined) {
     console.clear();
-    console.log(`还剩${len - index};  当前进度:${$xindaming[index].index}  ${$xindaming[index].title}`);
-    createPage($xindaming[index].href).then(res => {
-      return utils.page($xindaming[index], res);
+    console.log(`还剩${len - index};  当前进度:${_list[index].index}  ${_list[index].title}`);
+    createPage(_list[index].href).then(res => {
+      return utils.page(_list[index], res);
     }).then(res => {
-      fs.writeFileSync('./book/OEBPS/Text/text' + $xindaming[index].index + '.xhtml', res);
+      fs.writeFileSync('./book/OEBPS/Text/text' + _list[index].index + '.xhtml', res);
       setTimeout(() => {
         index += 1;
         forEachUrl();
-      }, 30);
+      }, 200);
     });
   } else {
-    shell.exec(`zip -p -r ${utils.name}.epub book`);
+    shell.exec(`zip -p -r ${config.name}.epub book`);
     // linux 下执行命令
     // shell.exec(`./utils/kindlegen -c1 ${utils.name}.epub -locale zh`);
     // mac下执行命令
-    shell.exec(`/Users/honghaitao/Applications/KindleGen_Mac_i386_v2_9/kindlegen -c1 ${utils.name}.epub -locale zh`);
+    shell.exec(`/Users/honghaitao/Applications/KindleGen_Mac_i386_v2_9/kindlegen -c1 ${config.name}.epub -locale zh`);
     // shell.exec(`rm ${utils.name}.epub`);
   }
 }

+ 367 - 24
utils/base.js

@@ -13,7 +13,7 @@ module.exports = {
         });
         return html;
       }
-
+      
       function itemref(list) {
         let html = '';
         list.forEach(key => {
@@ -24,7 +24,7 @@ module.exports = {
         });
         return html;
       }
-
+      
       let html = `<?xml version="1.0" encoding="utf-8"?>
       <package version="2.0" unique-identifier="BookId" xmlns="http://www.idpf.org/2007/opf">
         <metadata xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/">
@@ -68,11 +68,12 @@ module.exports = {
               <text>${key.title}</text>
             </navLabel>
             <content src="Text/text${key.index}.xhtml"/>
-          </navPoint>`
+          </navPoint>`;
           }
-        })
-        return page
+        });
+        return page;
       }
+      
       const html = `<?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
          "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
@@ -94,13 +95,13 @@ module.exports = {
             </navLabel>
             <content src="Text/book.xhtml"/>
           </navPoint>
-          ${navPoint(list)}    
+          ${navPoint(list)}
         </navMap>
       </ncx>
       `;
-      resolve(html)
-
-    })
+      resolve(html);
+      
+    });
   },
   book: function (info) {
     return new Promise(resolve => {
@@ -128,25 +129,31 @@ module.exports = {
   
     <p style="text-align: center; font-size: smaller; text-indent: 0;"><a href="http://mebook.cc" target="_blank">www.mebook.cc</a></p>
   </body>
-  </html>`
-      resolve(html)
-    })
+  </html>`;
+      resolve(html);
+    });
   },
-
   page: function (item, content) {
     return new Promise(resolve => {
       function page(content) {
         let contents = content.split('\n');
-        let html = ''
+        let html = '';
         contents.forEach(key => {
           html += `
-          <p>${key}</p>`
-        })
-        return html
+          <p>${key}</p>`;
+        });
+        return html;
       }
+      
       const html = `
-<html  xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh">
-<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title></title>
+<link href="../Styles/mc-style.css" type="text/css" rel="stylesheet"/>
+</head>
 <body>
 <h3 id="id${item.index}">${content.title}</h3>
 ${page(content.page)}
@@ -156,12 +163,348 @@ ${page(content.page)}
       resolve(html);
     });
   },
-  name: '末世之全能大师',
-  author: '秦小词',
-  uid: '',
-  time: ''
+  cover: function () {
+    return `<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>Cover</title>
+</head>
+<body>
+  <div style="text-align: center; padding: 0pt; margin: 0pt;">
+    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 240 300" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
+      <image width="240" height="300" xlink:href="../Images/cover.jpg"/>
+    </svg>
+  </div>
+</body>
+</html>`;
+  },
+  style() {
+    return `@charset "UTF-8";
+
+/*=========================font-face=========================*/
+@font-face {
+	font-family:"zw";
+	src:
+	local("宋体"),local("明体"),local("明朝"),
+	local("微软雅黑"),local("黑体"),
+	local("Songti"),local("Songti SC"),local("Songti TC"),
+	local("Song S"),local("Song T"),local("STBShusong"),local("TBMincho"),local("HYMyeongJo"),
+	local("DK-SONGTI")
+	local("Heiti"),local("Heiti SC"),local("Heiti TC"),
+	local("MYing Hei S"),local("MYing Hei T"),local("TBGothic"),
+	local("DK-HEITI"),
+	url(../Fonts/fzzy.ttf);
+}
+
+/* This defines styles and classes used in sioebook */
+
+/*Global Setting*/
+
+* {
+	margin: 0;
+	padding: 0;
+}
+
+body {
+	padding: 3% 2%;
+	margin-top: 3%;
+	margin-bottom: 3%;
+	margin-left: 1%;
+	margin-right: 1%;
+	line-height: 1.3em;
+	text-align: justify;
+	font-family: "Times New Roman","方正书宋","宋体","明体","zw",sans-serif;
+}
+
+/* P 正常段落 */
+p {
+	margin: 0.5em 0em;
+	line-height: 1.3em;
+	text-indent: 2em;
+}
+
+/* 居中、右、左 */
+.center {
+	text-indent: 0em;
+	text-align: center;
+}
+.right {
+	text-indent: 0em;
+	text-align: right;
+}
+.left {
+	text-indent: 0em;
+	text-align: left;
+}
+
+/*图片*/
+img {
+	border: none;
+	text-align: center;
+	/*max-width: 100%;*/
+	max-height: 100%;
+}
+
+/* 表格 */
+table {
+	border-collapse: collapse;
+	border-spacing: 0;
+	margin: 0 auto 0;
+	width: 100%;
+	font-size: small;
+	vertical-align:center;
+}
+tr,th,td {
+	margin: 0;
+	padding: 0.25em;
+	border: none;
+	font-size: 95%;
+	font-family: "Times New Roman","方正书宋","宋体","明体","zw",sans-serif;
+	text-indent: 0!important;
+	text-align: left;
+	vertical-align: middle;
+	color: #666666;
+	line-height: 1.05em;
+}
+
+/* 列表格式 */
+ul, ol	{
+	list-style:none;
+}
+/* 链接 颜色 不加下划线 */
+a {
+	text-decoration:none;
+	color: #663366;
+}
+a:hover {
+	text-decoration:none;
+	color: #CC99CC;
+}
+/* 文案 */
+.oval {
+	padding: 5% 5%;
+	margin: 12% 5% 2%;
+	border: 0px dotted #993333;
+	text-indent: 0em;
+	font-size: 0.9em;
+	color: #666666;
+}
+
+/* 水平线 */
+hr {
+	border:0;
+	background-color:#BEBEBE;
+	height:1.5px;
+	margin-top: 2%;
+	margin-bottom: 2%;
+}
+
+/* 上下标注 */
+sup {
+	font-size:small;
+}
+sub {
+	font-size:small;
+}
+
+/* 标题1 书名 卷 */
+h1 {
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	text-indent: 0em;
+	text-align:center;
+	line-height: 2em;
+	margin-top: 30%;
+	color: #996699;
+	text-shadow: 1px 1px 1px gray;
+}
+
+h2 {
+	color: #FFFFFF;
+	margin-left:25%;
+	line-height:200%;
+	border-style: none double solid solid;
+	border-width: 0px 3px 2px 30px;
+	font-weight:bold;
+	font-size:large;
+	border-color: #FFFFFF;
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	text-shadow: 1px 1px 1px gray;
+	padding: 2px 10px 2px 10px;
+}
+h2.epub {
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	text-indent: 0em;
+	font-size: 1.2em;
+	text-align: center;
+	width: 1em;
+	margin: 0em 5% 1.5em;
+	line-height: 110%;
+	color: #EEEEEE;
+	border-style: none double none none;
+	border-width: 0px 3px 0px 0px;
+	border-color: #EEEEEE;
+	padding: 0.5em 10px 0.5em 2px;
+	text-shadow: 0px 0px 0px #AAAAAA;
+}
+
+h3 {
+	margin: 1em 0 5em;
+	color: #663366;
+	line-height: 120%;
+	text-align: left;
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	text-shadow: 1px 1px 1px gray;
+	padding: 15px 12px 1em 5px;
+	border-style: none none dotted none;
+	border-color: #CC6699;
+	border-width: 0px 0px 1px 0px;
+	text-shadow: 1px 1px 1px #AAAAAA;
+}
+h3.ebook {
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	text-indent: 0em;
+	margin: 1em 0 1em;
+	padding: 2px 12px 2px 2px;
+	text-align: left;
+	line-height: 120%;
+	border-style: none none none none;
+	text-shadow: 1px 1px 1px #AAAAAA;
+}
+
+/* 章节序号 */
+.num {
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	background-color: #CC6699;
+	border-radius: 2px;
+	padding: 4px 0.5em;
+	color: #FFF;
+	font-size: small;
+	text-shadow: 1px 1px 1px #AAAAAA;
+}
+
+h4 {
+	line-height: 2em;
+	text-indent: 0em;
+	color: #FFFFFF;
+	margin-left:25%;
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	text-shadow: 1px 1px 1px gray;
+}
+
+h5 {
+	line-height: 1.5em;
+	text-indent: 0em;
+	color: #FF9900;
+	font-size: 14px;
+}
+
+.vol {
+	padding: 30% 5% 20%;
+	margin: 15% -2em 2%;
+	background-color: #996699;
+	text-indent: 0em;
+}
+.volbg {
+	background-color: #996699;
+}
+
+/* 作者译者编者等 */
+.author {
+	margin: 20% 0;
+	text-indent: 0em;
+	text-align: center;
+	font-size: 1em;
+	line-height: 60%;
+	font-weight: 600;
+	/*color: #;*/
+}
+.wt {
+	text-indent: 0em;
+	font-style:italic;
+	font-size: 0.9rem;
+	line-height: 1.2em;
+	color: #336699;
+}
+
+/* 出版社 */
+.copyright {
+	margin: 35% 0 0;
+	text-indent: 0em;
+	text-align: center;
+	font-size: 1em;
+	line-height: 120%;
+	font-weight: 300;
+	/*color: #;*/
+}
+
+/* 书票 */
+.exL {
+	margin: 45% 0;
+	text-align: center;
+	page-break-before: always;
+}
+.kh {
+	text-indent: 0em;
+	text-align: center;
+	font-size: 0.80em;
+	color: #EEEEEE;
+}
+
+/* 电子书信息 */
+.info {
+	font-size: 1em;
+	font-weight: bold;
+	line-height: 150%;
+	color: #666666;
+	margin: 0 0 1em 20%;
+}
+.info_items {
+	font-size: 0.8em;
+	line-height: 120%;
+	color: #666666;
+	margin: 0 0 0 20%;
+}
+/* 多看 图框 */
+.duokan-image-single {
+	margin: 0.5em 0;
+	bottom: 2%;
+	text-align: center;
+}
+
+/*++*/
+.rht {
+	font-family: "微软雅黑","黑体","ht","zw",sans-serif;
+	font-size: 115%;
+	line-height: 120%;
+	text-indent: 0em;
+	text-align: right;
+	color: #CCCCCC;
+}
+.lt {
+	font-size: 80%;
+	text-indent: 0em;
+	text-align: right;
+	color: #003366;
+}
+div.float {
+	width: 42%;
+	float: right;
+	margin: 1em 0 0em 1em;
+}`;
+  },
+  container() {
+    return `<?xml version="1.0" encoding="UTF-8"?>
+<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
+    <rootfiles>
+        <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
+   </rootfiles>
+</container>`;
+  }
 };
 
 function startAndEnd(item) {
-  return item.index > 0 && item.index < 605;
+  return item.index > 0 && item.index < 6005;
 }

+ 8 - 0
utils/config.js

@@ -0,0 +1,8 @@
+module.exports = {
+  name: '天影',
+  author: '萧鼎',
+  uid: '',
+  time: '',
+  url: 'https://www.qu.la/book/20616/',
+  href: 'https://www.qu.la'
+};

File diff suppressed because it is too large
+ 0 - 0
utils/list.js


File diff suppressed because it is too large
+ 0 - 0
xindaming.js


Some files were not shown because too many files changed in this diff