您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Tải truyện từ truyen.tangthuvien.vn định dạng epub.
// ==UserScript== // @name TangThuVien downloader // @namespace https://nntoan.com/ // @description Tải truyện từ truyen.tangthuvien.vn định dạng epub. // @version 1.1.2 // @icon https://i.imgur.com/rt1QT6z.png // @author Toan Nguyen // @oujs:author nntoan // @license MIT; https://nntoan.mit-license.org/ // @supportURL https://github.com/nntoan/UserScripts/issues // @match http://truyen.tangthuvien.vn/doc-truyen/* // @match https://truyen.tangthuvien.vn/doc-truyen/* // @require https://unpkg.com/[email protected]/dist/jszip.min.js // @require https://unpkg.com/[email protected]/ejs.min.js // @require https://unpkg.com/[email protected]/dist/jepub.min.js // @require https://unpkg.com/[email protected]/dist/FileSaver.min.js // @connect self // @run-at document-idle // @noframes // ==/UserScript== /*global console, location*/ (function ($, window, document) { // eslint-disable-line 'use strict'; $(document).ready(function() { $.widget('nntoan.mbDownloader', $.nntoan.mbDownloader, { _create: function () { var self = this; this._super(); // Extending options this.options.processing.ebookFileName = this.options.general.pathname.slice(12); this.options.xhr.chapter.data = $.extend(this.options.xhr.chapter.data, { story_id: self.elements.$novelId.val() }); this.options.xhr.content.url = this.options.general.pathname + this.options.chapters.chapId + '/'; this.elements.$downloadBtn.css('margin-top', '10px'); console.time('downloadAndGenerateEpub'); } }); $(this).mbDownloader({ readyToInit: true, processing: { ebookFileExt: '.epub' }, classNames: { novelId: '#story_id_hidden', infoBlock: '.book-detail-wrap', chapterContent: '.box-chap:not(.hidden)', chapterNotContent: 'iframe, script, style, a, div, p:has(a[href*="truyen.tangthuvien.vn"])', chapterVip: '#btnChapterVip', chapterTitle: 'h2', ebookTitle: 'h1', ebookAuthor: '#authorId', ebookCover: '#bookImg', ebookDesc: '.book-intro', ebookType: '.tag-wrap a', downloadBtnStatus: 'btn-primary btn-success btn-info btn-warning btn-danger blue success warning info danger error', downloadAppendTo: '.book-info p:last-child', }, ebook: { fallbackCover: 'https://truyen.tangthuvien.vn/images/default-book.png' }, chapters: { chapListSlice: [6, -1], }, xhr: { chapter: { type: 'GET', url: '/story/chapters', }, content: { type: 'GET', xhrFields: { withCredentials: true } } }, bookInfoUpdated: function (event, data) { console.log('Book information updated...', data.epubInfo); }, chapTitleUpdated: function(event, data) { console.log('Chapter: ' + data.chapNum + ' downloaded...'); }, beforeCreateEpub: function(event, that) { console.log('Prepare generate epub...'); }, complete: function(event, that) { console.log('Epub downloaded successfully. Please check your Downloads folder.'); console.timeEnd('downloadAndGenerateEpub'); } }); }); })(jQuery, window, document); // eslint-disable-line
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址