@kadaliao/geektime-downloader 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/download.js +7 -3
  2. package/package.json +1 -1
package/download.js CHANGED
@@ -237,7 +237,7 @@ function parseCookies(cookieString) {
237
237
  });
238
238
  }
239
239
 
240
- // 获取专栏所有文章列表(通过API
240
+ // 获取专栏所有文章列表(通过API)
241
241
  async function getArticleList(page, columnUrl) {
242
242
  const spinner = ora('正在获取专栏信息...').start();
243
243
 
@@ -462,7 +462,8 @@ async function getArticleList(page, columnUrl) {
462
462
 
463
463
  // 解析文章列表
464
464
  const rawArticles = articlesData.data.list;
465
- const articles = rawArticles.map((article) => {
465
+
466
+ const articles = rawArticles.map((article, index) => {
466
467
  const title = article.article_title || article.article_sharetitle || 'Untitled';
467
468
  const id = article.id;
468
469
 
@@ -477,7 +478,10 @@ async function getArticleList(page, columnUrl) {
477
478
  title: cleanTitle,
478
479
  url: `https://time.geekbang.org/column/article/${id}`,
479
480
  originalTitle: title,
480
- id: id
481
+ id: id,
482
+ sectionName: article.section_name || '',
483
+ chapterIndex: article.chapter_index || 0,
484
+ originalIndex: index
481
485
  };
482
486
  });
483
487
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kadaliao/geektime-downloader",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "极客时间专栏文章批量下载工具 - 支持一键下载整个专栏为PDF",
5
5
  "type": "module",
6
6
  "main": "download.js",