Skip to content

Commit

Permalink
v2.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Apr 10, 2021
1 parent 1e2d6b5 commit 50ae054
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 25 deletions.
3 changes: 2 additions & 1 deletion arrangement/classify_and_compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ function check_fso(fso_name) {
// 經過測試,.pkg file 通常越壓縮越大。
if (false && PATTERN_executable_file.test(fso_name)) {
process_queue.push([ directory_path, 'game file',
CeL.gettext('為遊戲可執行檔或函式庫') ]);
// 為遊戲可執行檔或函式庫
CeL.gettext('為可執行檔或函式庫') ]);
} else
classify(fso_name, directory_path, fso_status);
return;
Expand Down
4 changes: 2 additions & 2 deletions arrangement/list_kuaiZip.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ CeL.storage.traverse_file_system(target_directory, function(file_path) {
// archive_file.verify();
return;
}
if (!archive_file.information.offset
&& !archive_file.information['tail size']) {
if (!archive_file.information.Offset
&& !archive_file.information['Tail Size']) {
// archive_file.verify();
return;
}
Expand Down
16 changes: 10 additions & 6 deletions arrangement/recover_mulitiple_downloaded_bad_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,18 @@ function most_frequently_byte(selector_configuration) {
return selected_byte;
}


const use_select_by_process_to = 0;
let latest_block_index;
function select_by_process_to(selector_configuration) {
const { from_buffer_list, buffer_index, bytesRead_array, start_index, base_byte, block_index } = selector_configuration;

let list_index = block_index < 3900 ? 1 : 0;
//list_index = block_index < 800 ? 1 : 0;
list_index = process_to / max_size > .95 ? 1 : 0;

if (list_index === 0 && latest_block_index !== block_index) {
latest_block_index = block_index;
console.log(block_index);
CeL.warn(`${select_by_process_to.name}: Different block: ${block_index} / ${max_size / BUFFER_SIZE + 1 | 0} (${block_index / (max_size / BUFFER_SIZE) * 100 | 0}%)`);
}

return from_buffer_list[list_index][buffer_index];
Expand Down Expand Up @@ -152,8 +155,9 @@ do {

const selector_configuration = { from_buffer_list, buffer_index, bytesRead_array, start_index, base_byte, block_index };

const selected_byte = most_frequently_byte(selector_configuration);
//const selected_byte = select_by_process_to(selector_configuration);
const selected_byte = use_select_by_process_to
? select_by_process_to(selector_configuration)
: most_frequently_byte(selector_configuration);

from_buffer_list[BUFFER_INDEX_TO_WRITE][buffer_index] = selected_byte;
}
Expand All @@ -162,8 +166,8 @@ do {
bad_block_list.push(block_index);
node_fs.writeSync(target_fd, from_buffer_list[BUFFER_INDEX_TO_WRITE], 0, max_buffer_index);
process_to += max_buffer_index;
process.stdout.write(`${process_to / max_size * 100 | 0}% ${CeL.to_KiB(process_to)} / ${CeL.to_KiB(max_size)
}${different_byte_count ? `, ${CeL.to_KiB(different_byte_count)} different` : ''} ...\r`);
CeL.log_temporary(`${process_to / max_size * 100 | 0}% ${CeL.to_KiB(process_to)} / ${CeL.to_KiB(max_size)
}${different_byte_count ? `, ${CeL.to_KiB(different_byte_count)} different` : ''}`);

} while (not_ended);

Expand Down
4 changes: 2 additions & 2 deletions book.cmn-Hant-TW/fetch_all_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ function download_next() {
// XMLHttp.status === 200
var time_interval = 60 * 1000;
setTimeout(download_next, time_interval);
process.stdout.write('Wait ' + CeL.age_of(0, time_interval)
+ ' to get next file...\r');
CeL.log_temporary('Wait ' + CeL.age_of(0, time_interval)
+ ' to get next file');
}
} else {
downloaded_count++;
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 @@ -78,7 +78,7 @@ var crawler = new CeL.work_crawler({
}

CeL.run_serial(function(run_next, item, index, list) {
process.stdout.write(item + '/' + last_list_NO + '...\r');
CeL.log_temporary(item + '/' + last_list_NO);

CeL.get_URL(_this.base_URL + chapter_base_URL + item, function(
XMLHttp) {
Expand Down
4 changes: 2 additions & 2 deletions comic.cmn-Hans-CN/dagu.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ var crawler = CeL.qTcms2017({
console.log('Get #' + index + '/' + image_count + ': '
+ image_page_url);
}
process.stdout.write('Get image data page of §' + chapter_NO + ': '
+ image_NO + '/' + image_count + '...\r');
CeL.log_temporary('Get image data page of §' + chapter_NO + ': '
+ image_NO + '/' + image_count);
_this.get_URL(image_page_url, function(XMLHttp) {
extract_image(XMLHttp);
run_next();
Expand Down
4 changes: 2 additions & 2 deletions comic.cmn-Hans-CN/migudm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require('../work_crawler_loader.js');

// ----------------------------------------------------------------------------

var PATTERN_characters = /<span class="authorItem">([\s\S]+?)<span class="authorDesc">([\s\S]+?)<\/span>/;
var PATTERN_characters = /<span class="authorItem">([\s\S]+?)<span class="authorDesc">([\s\S]+?)<\/span>/g;
var PATTERN_chapter_keys = /<input +type="hidden" +(?:class|id)="([a-zA-Z]+)" +value="([^<>"]+)"/g;
var crawler = new CeL.work_crawler({
// 所有的子檔案要修訂註解說明時,應該都要順便更改在CeL.application.net.comic中Comic_site.prototype內的母comments,並以其為主體。
Expand Down Expand Up @@ -120,7 +120,7 @@ var crawler = new CeL.work_crawler({
characters : Object.create(null)
};

Array.from(text.matchAll(/>([^<>]+)<\/a>/)).forEach(function(matched) {
Array.from(text.matchAll(/>([^<>]+)<\/a>/g)).forEach(function(matched) {
// delete matched.input;
// console.log(matched);
matched = get_label(matched[1]);
Expand Down
5 changes: 3 additions & 2 deletions comic.cmn-Hant-TW/18comic.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ var crawler = new CeL.work_crawler({
: function(XMLHttp, work_data, callback, chapter_NO) {
var chapter_data = work_data.chapter_list[chapter_NO - 1],
//
html = XMLHttp.responseText, _this = this;
html = XMLHttp.responseText;

if (!chapter_data.latest_pages_got++) {
// 此時假如有 chapter_data.image_list,
Expand Down Expand Up @@ -198,6 +198,7 @@ var crawler = new CeL.work_crawler({
.between('<li', '</li>').between(' href="', '"');
if (next_image_page_url) {
// console.log(next_image_page_url);
var _this = this;
this.get_URL(next_image_page_url, function(XMLHttp) {
_this.pre_parse_chapter_data(XMLHttp, work_data, callback,
chapter_NO);
Expand All @@ -207,7 +208,7 @@ var crawler = new CeL.work_crawler({

if (this.write_chapter_index
&& chapter_data.url.match(/\d+$/)[0] >= 220980) {
var chapter_label = _this.get_chapter_directory_name(work_data,
var chapter_label = this.get_chapter_directory_name(work_data,
chapter_NO, chapter_data, false);
var chapter_directory = CeL.append_path_separator(
//
Expand Down
3 changes: 1 addition & 2 deletions comic.ja-JP/moae.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ var crawler = new CeL.work_crawler({
work_data.chapter_list = data.ep;

CeL.run_serial(function(run_next, item, index, list) {
process.stdout.write(item + '/' + work_data.pager.maxPage
+ '...\r');
CeL.log_temporary(item + '/' + work_data.pager.maxPage);

_this.get_URL(get_chapter_data_URL(item), function(XMLHttp) {
data = parse_JSON(XMLHttp);
Expand Down
2 changes: 1 addition & 1 deletion gui_electron/gui_electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function start_update(event_sender) {
});

autoUpdater.on('download-progress', function(progressObj) {
// process.stdout.write(progressObj.percent + '%...\r'));
// CeL.log_temporary(progressObj.percent + '%'));
event_sender.send('send_message_debug', [
'安裝包已下載 %1,下載速度 %2 bytes/s。',
progressObj.percent.toFixed(2) + '%' + ' ('
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" : "v2.10.0",
"version" : "v2.12.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
5 changes: 2 additions & 3 deletions work_crawler.updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ function fetch_url(url, callback) {
url = url.parse(url);
url.agent = new SocksProxyAgent(process.env.socks_proxy);
} catch (e) {
console.error('Please install socks-proxy-agent to using proxy: '
+ '`npm install socks-proxy-agent`');
throw e;
//console.error('Please install socks-proxy-agent to using proxy: ' + '`npm install socks-proxy-agent`');
//throw e;
}
}

Expand Down

0 comments on commit 50ae054

Please sign in to comment.