9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import { loadDoubanSubjectDetail } from './utils.js';
|
|
|
|
cli({
|
|
site: 'douban',
|
|
name: 'subject',
|
|
access: 'read',
|
|
description: '获取豆瓣条目详情',
|
|
domain: 'movie.douban.com',
|
|
strategy: Strategy.COOKIE,
|
|
browser: true,
|
|
navigateBefore: false,
|
|
args: [
|
|
{ name: 'id', required: true, positional: true, help: '豆瓣条目 ID' },
|
|
{ name: 'type', default: 'movie', choices: ['movie', 'book'], help: '条目类型(movie=电影, book=图书)' },
|
|
],
|
|
columns: [
|
|
'id',
|
|
'type',
|
|
'title',
|
|
'subtitle',
|
|
'originalTitle',
|
|
'authors',
|
|
'translators',
|
|
'publisher',
|
|
'publishDate',
|
|
'publishYear',
|
|
'pageCount',
|
|
'binding',
|
|
'price',
|
|
'series',
|
|
'isbn10',
|
|
'isbn13',
|
|
'year',
|
|
'rating',
|
|
'ratingCount',
|
|
'genres',
|
|
'directors',
|
|
'casts',
|
|
'country',
|
|
'duration',
|
|
'summary',
|
|
'url',
|
|
],
|
|
func: async (page, args) => [await loadDoubanSubjectDetail(page, args.id, args.type)],
|
|
});
|