Skip to content

Commit

Permalink
v1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Apr 12, 2019
1 parent 293d3e5 commit 08b56eb
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
若是您使用後問題已解決,請記得回來關掉本議題。仍發現有相關問題的話,可重開這個議題。
遇到不同的問題,請另外開個議題來修正。
本工具以修正錯誤為主,由於人力有限,只能把精力放在維護常用的網站。新增網站僅在行有餘力時為之,請見諒。
本工具以修正錯誤為主,由於人力有限,這邊主要把精力放在維護常用的網站。新增網站僅在行有餘力時為之,請見諒。
英語或韓語的網站煩請利用 Free Manga Downloader 之類軟體會比較好。這邊幾乎不會上英語或者韓語網站,就算做了出來也很少在做維護,沒有專門看英語韓語網站的工具維護得勤勞。
I am sorry that for English or Korean sites, using Free Manga Downloader is much suitable. For the deficiency of time, it is hard to maintain the tools instantly.
新增網站時,請 **一個網站開一個議題,除了在標題說明要新增網站,並加上網站名稱**。
Expand Down
1 change: 1 addition & 0 deletions _build/pack_up.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function build_package(update_script_name) {
var directory_name = repository + '-' + branch;
if (node_fs.existsSync(directory_name)) {
show_info('清理戰場...');
// node_fs.renameSync(directory_name, directory_name + '.old');
remove_directory(directory_name);
}
// clean previous cache
Expand Down
8 changes: 7 additions & 1 deletion arrangement/list_kuaiZip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/**
* @fileoverview 檢測篩選並且列出可能是 快压(kuaiZip) 檔案
* @fileoverview 檢測目標目錄中所有壓縮檔案,並且篩選列出可能是 快压(kuaiZip) 檔案。
*
* @example<code>
node list_kuaiZip.js target_directory
</code>
*
* @since 2018/11/4 13:49:0
*/
Expand Down
2 changes: 1 addition & 1 deletion book.cmn-Hant-TW/ljswio.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var crawler = new CeL.work_crawler({
var _this = this, media_data = this.media_list[0];
CeL.log('get_media_file: ' + media_data.file + ' ('
+ this.media_list.length + ' left)');
CeL.get_URL_cache(media_data.url, function(data) {
CeL.get_URL_cache(media_data.url, function(data, error) {
// CeL.info('get_media_file: OK: ' + media_data.file);
_this.media_list.shift();
if (_this.media_list.length > 0) {
Expand Down
5 changes: 4 additions & 1 deletion comic.cmn-Hans-CN/57mh.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ var crawler = new CeL.work_crawler({

// one_by_one : true,
// 早於2017/11-2019/1底換域名: http://www.57mh.com/
base_URL : 'http://www.5qmh.com/',
// 2019/2/15 19:56 最後一次成功連接 http://www.5qmh.com/
// 2019/3/1 改 http://www.wuqimh.com/
base_URL : 'http://www.wuqimh.com/',

// 取得伺服器列表。
// use_server_cache : true,
Expand All @@ -33,6 +35,7 @@ var crawler = new CeL.work_crawler({
return this.base_URL + 'templates/wuqi/default/scripts/configs.js';
},
parse_server_list : function(html) {
// console.log(html);
return Object.values(JSON.parse(
// var pageConfig = { 'host': { ...
html.replace(/^[^{]+/, '').replace(/[^}]+$/, '')
Expand Down
2 changes: 2 additions & 0 deletions comic.cmn-Hans-CN/dagu.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ var crawler = new CeL.work_crawler({
},
parse_chapter_data : function(html, work_data, get_label, chapter_NO) {
var chapter_data = work_data.chapter_list[chapter_NO - 1];
// console.log(chapter_data);

// 已在 pre_parse_chapter_data() 設定完 {Array}chapter_data.image_list
return chapter_data;
}
Expand Down
14 changes: 9 additions & 5 deletions comic.cmn-Hans-CN/dm5.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,18 @@ var crawler = new CeL.work_crawler({
//
DM5 = work_data.DM5 = CeL.null_Object(), matched,
//
PATTERN_data =
//
/\sDM5_([a-zA-Z\d_]+)\s*=\s*(\d+|(["'])(?:\\.|[^\\"']+)*\3)/g;
PATTERN_assignment =
// [ expression, variable name, value, quote ]
/\sDM5_([a-zA-Z\d_]+)\s*=\s*(\d+|true|false|(["'])(?:\\.|[^\\"']+)*\3)/g
// @see sfacg.js
;
// console.log(text);
while (matched = PATTERN_data.exec(text)) {
while (matched = PATTERN_assignment.exec(text)) {
// console.log(matched);
DM5[matched[1]] = JSON.parse(matched[3] === "'" ? matched[2]
.replace(/^'|'$/g, '"') : matched[2]);
.replace(/^'([\s\S]*?)'$/g, function(all, inner) {
return '"' + inner.replace(/"/g, '\\"') + '"';
}) : matched[2]);
}
// console.log(DM5);
if (!(DM5.IMAGE_COUNT > 0)) {
Expand Down
2 changes: 2 additions & 0 deletions comic.cmn-Hans-CN/manhuadb.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ crawler = new CeL.work_crawler({
},
parse_chapter_data : function(html, work_data, get_label, chapter_NO) {
var chapter_data = work_data.chapter_list[chapter_NO - 1];
// console.log(chapter_data);

// 已在 pre_parse_chapter_data() 設定完 {Array}chapter_data.image_list
return chapter_data;
}
Expand Down
2 changes: 1 addition & 1 deletion comic.cmn-Hans-CN/manhuagui.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ CeL.create_directory(crawler.main_directory);
var LZString;
CeL.get_URL_cache(crawler.script_base_URL + decode_filename,
// 2017/3/3? ikanman 改版
function(contents) {
function(contents, error) {
contents = contents.between('\nwindow["\\x65\\x76\\x61\\x6c"]', ';\n')
//
.replace(/window\[([^\[\]]+)\]/g, function($0, key) {
Expand Down
2 changes: 1 addition & 1 deletion comic.cmn-Hans-CN/manhuagui_tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ CeL.create_directory(crawler.main_directory);
var LZString;
CeL.get_URL_cache(crawler.script_base_URL + decode_filename,
// 2017/3/3? ikanman 改版
function(contents) {
function(contents, error) {
contents = contents.between('\nwindow["\\x65\\x76\\x61\\x6c"]', ';\n')
//
.replace(/window\[([^\[\]]+)\]/g, function($0, key) {
Expand Down
2 changes: 1 addition & 1 deletion comic.cmn-Hans-CN/omanhua.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ setup_crawler(crawler, typeof module === 'object' && module);
CeL.create_directory(crawler.main_directory);

var decode_filename = 'scripts/show/ssncore.js';
CeL.get_URL_cache(crawler.base_URL + decode_filename, function(contents) {
CeL.get_URL_cache(crawler.base_URL + decode_filename, function(contents, error) {
// var servs = [{...
start_crawler(crawler, typeof module === 'object' && module);
}, crawler.main_directory + decode_filename.match(/[^\\\/]+$/)[0]);
4 changes: 2 additions & 2 deletions comic.en-US/rocaca.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ CeL.get_URL_cache(crawler.base_URL + chapter_init_filename,
+ chapter_init_filename.match(/[^\\\/]+$/)[0].replace(/\?.*/,
''));

function get_chapter_filename(contents) {
function get_chapter_filename(contents, error) {
decode_function += contents;
CeL.get_URL_cache(crawler.base_URL + chapter_filename,
patch_decoder_and_start_crawler, crawler.main_directory
+ chapter_filename.match(/[^\\\/]+$/)[0]
.replace(/\?.*/, ''));
}

function patch_decoder_and_start_crawler(contents_2) {
function patch_decoder_and_start_crawler(contents_2, error) {
if (false) {
console
.log(contents_2
Expand Down
Binary file modified gui_electron/gui_electron.css
Binary file not shown.
2 changes: 1 addition & 1 deletion gui_electron/gui_electron.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3 id="search_results_trigger">

<div id="download_job_panel" class="panel">
<h3 id="download_job_trigger">
<span data-gettext="下載中的作品"></span>
📥<span data-gettext="下載中的作品"></span>
</h3>
<div id="download_job_queue"></div>
</div>
Expand Down
14 changes: 12 additions & 2 deletions novel.cmn-Hans-CN/qidian.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ var crawler = new CeL.work_crawler({
.replace(/\/(?:180|90|300)$/, '/600'),
author : get_label(text.between(' class="writer"', '</a>').between(
'>')),
status : text.between('<p class="tag">', '</p>').split(
tags : text.between('<p class="tag">', '</p>').split(
/<\/(?:span|a)>/).append(
// 作者自定义标签
html.between(' class="book-intro"', ' class="update"')
.between(' class="detail"', '</div>').between('>')
.split('</a>')).map(
Expand All @@ -119,13 +120,22 @@ var crawler = new CeL.work_crawler({
};

if (work_data.is_free) {
work_data.status.push('限免');
work_data.tags.push('限免');
// 將限免作品移至特殊目錄下。
work_data.base_directory_name = 'free';
work_data.directory_name_extension = '.'
+ (new Date).format('%Y%2m%2d');
}

work_data.status = work_data.tags.filter(function(tag) {
return tag === '连载' || tag === '完本';
});
if (work_data.status.length === 0) {
// 無法判別作品是否完結。
work_data.status = work_data.tags;
delete work_data.tags;
}

// console.log(work_data);
return work_data;
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "work_crawler",
"title" : "CeJS online novels and comics downloader",
"version" : "v1.10.0",
"version" : "v1.11.0",
"description" : "A tool using CeJS library to download online novels / comics.",
"keywords" : [ "comic-downloader", "novel-downloader", "cejs",
"downloader", "download-comic", "epub", "ebook", "comics",
Expand Down
1 change: 1 addition & 0 deletions start_gui_electron.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

# Will call "main" @ package.json
node_modules/.bin/electron . || ~/node_modules/.bin/electron .
10 changes: 7 additions & 3 deletions work_crawler.updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@ function download_update_tool(update_script_url, callback) {
});
}

function install_npm(package_name, message, dev) {
function install_npm(package_name, message, for_development) {
try {
require(package_name);
} catch (e) {
// e.code: 'MODULE_NOT_FOUND'
// console.error(e);

show_info(message || ('安裝需要用到的組件 [' + package_name + ']...'));
show_info(message || ('安裝'
// for development purpose
+ (for_development ? '開發時' : '執行時')
//
+ '需要用到的組件 [' + package_name + ']...'));
if (!node_fs.existsSync('node_modules'))
node_fs.mkdirSync('node_modules');
require('child_process').execSync('npm install '
// https://github.com/kanasimi/work_crawler/issues/104
// https://docs.npmjs.com/cli/install
// npm install electron --save-dev
// sudo npm install -g electron --unsafe-perm=true --allow-root
+ (dev ? '--save-dev ' : '') + package_name + '@latest', {
+ (for_development ? '--save-dev ' : '') + package_name + '@latest', {
stdio : 'inherit'
});
}
Expand Down

0 comments on commit 08b56eb

Please sign in to comment.