diff --git a/cli-manifest.json b/cli-manifest.json index 944958737..5c72555e8 100644 --- a/cli-manifest.json +++ b/cli-manifest.json @@ -8316,7 +8316,8 @@ "index", "title", "status", - "size" + "size", + "path" ], "type": "js", "modulePath": "douban/download.js", diff --git a/clis/douban/download.js b/clis/douban/download.js index 561367b6b..3a0c784b2 100644 --- a/clis/douban/download.js +++ b/clis/douban/download.js @@ -24,7 +24,7 @@ cli({ { name: 'photo-id', help: '只下载指定 photo_id 的图片' }, { name: 'output', default: './douban-downloads', help: '输出目录' }, ], - columns: ['index', 'title', 'status', 'size'], + columns: ['index', 'title', 'status', 'size', 'path'], func: async (page, kwargs) => { const subjectId = normalizeDoubanSubjectId(String(kwargs.id || '')); const output = String(kwargs.output || './douban-downloads'); @@ -61,6 +61,7 @@ cli({ detail_url: photo.detailUrl, status: result.success ? 'success' : 'failed', size: result.success ? formatBytes(result.size) : (result.error || 'unknown error'), + path: path.resolve(destPath), }); } return results; diff --git a/clis/douban/download.test.js b/clis/douban/download.test.js index 6b0e30c2b..37dc69ba0 100644 --- a/clis/douban/download.test.js +++ b/clis/douban/download.test.js @@ -103,6 +103,7 @@ describe('douban download', () => { detail_url: 'https://movie.douban.com/photos/photo/2913450214/', status: 'success', size: '1200 B', + path: path.resolve('/tmp/douban-test/30382501/30382501_001_2913450214_Main_poster.webp'), }, { index: 2, @@ -112,6 +113,7 @@ describe('douban download', () => { detail_url: 'https://movie.douban.com/photos/photo/2913450215/', status: 'success', size: '980 B', + path: path.resolve('/tmp/douban-test/30382501/30382501_002_2913450215_Character_poster.jpg'), }, ]); }); @@ -160,6 +162,7 @@ describe('douban download', () => { detail_url: 'https://movie.douban.com/photos/photo/2913450215/', status: 'success', size: '980 B', + path: path.resolve('/tmp/douban-test/30382501/30382501_002_2913450215_Character_poster.jpg'), }, ]); });