(crawler, crawler_module)
| 364 | globalThis.setup_crawler = setup_crawler; |
| 365 | |
| 366 | function start_crawler(crawler, crawler_module) { |
| 367 | setup_crawler(crawler, crawler_module); |
| 368 | // console.log(crawler_module); |
| 369 | if (!is_CLI) { |
| 370 | // GUI has its process. |
| 371 | return; |
| 372 | } |
| 373 | |
| 374 | if (work_id === 'l' && default_favorite_list) { |
| 375 | work_id = default_favorite_list; |
| 376 | if (typeof work_id === 'function') |
| 377 | work_id = work_id.call(crawler); |
| 378 | } |
| 379 | |
| 380 | // 從其他程式匯入作品資料 可使用API會更有效率 |
| 381 | // show work information only 純粹只要在命令列介面顯示作品資料即可 |
| 382 | if (CeL.env.arg_hash.show_information_only) { |
| 383 | crawler.data_of(work_id, function got_work_data(work_data) { |
| 384 | // console.log(work_data); |
| 385 | crawler.show_work_data(work_data); |
| 386 | }, { |
| 387 | get_data_only : CeL.env.arg_hash.show_information_only |
| 388 | }); |
| 389 | return; |
| 390 | } |
| 391 | |
| 392 | crawler.start(work_id, crawler.after_download_list); |
| 393 | } |
| 394 | |
| 395 | globalThis.start_crawler = start_crawler; |
| 396 |
no test coverage detected