Skip to content

Commit

Permalink
fix kanasimi#586 kuaikan下載章節倒序
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Oct 27, 2022
1 parent ccb54c5 commit c5b4fcb
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions comic.cmn-Hans-CN/kuaikan.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,31 @@ var crawler = new CeL.work_crawler({
// skip_error : true,

// 解析 作品名稱 → 作品id get_work()
search_URL : function(work_title, get_label) {
// 2022/10
search_URL : 'sou/',
parse_search_result : function(html, get_label) {
// html = html.between('<div class="resultList cls">');
// console.log(html);
var id_list = [], id_data = [];
html.each_between('<a href="/web/topic/', '</a>', function(text) {
id_list.push(text.between(null, '"'));
id_data.push(get_label(text.between('title="', '"')));
});
return [ id_list, id_data ];
},

search_URL_2021 : function(work_title, get_label) {
return 'v1/search/topic?q=' + encodeURIComponent(work_title)
+ '&since=0&size=20&f=3';
},
parse_search_result : function(html, get_label) {
parse_search_result_2021 : function(html, get_label) {
html = JSON.parse(html).data.hit;
return [ html, html ];
},
id_of_search_result : 'id',
title_of_search_result : 'title',
id_of_search_result_2021 : 'id',
title_of_search_result_2021 : 'title',

// old than search_URL_2021
search_URL_web : 's/result/',
parse_search_result_web : function(html, get_label) {
html = html.between('<div class="resultList cls">',
Expand Down Expand Up @@ -86,7 +100,9 @@ var crawler = new CeL.work_crawler({
.between('<script>window.__NUXT__=', ';</script>')).data[0];
// console.trace(html);
Object.assign(work_data, html.topicInfo);
work_data.chapter_list = html.comics.reverse()
work_data.chapter_list = html.comics
// 2022/10/24前 改版
// .reverse()
//
.map(function(chapter_data, index) {
chapter_data.url = 'web/comic/' + chapter_data.id;
Expand Down

0 comments on commit c5b4fcb

Please sign in to comment.