publishport-opencli 1.0.20 → 1.0.21
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.
- package/clis/12306/me.js +2 -2
- package/clis/12306/orders.js +3 -3
- package/clis/12306/passengers.js +3 -3
- package/clis/12306/price.js +1 -1
- package/clis/12306/stations.js +1 -1
- package/clis/12306/train.js +1 -1
- package/clis/12306/trains.js +1 -1
- package/clis/12306/utils.js +1 -1
- package/clis/1688/download.js +1 -1
- package/clis/1688/item.js +4 -4
- package/clis/1688/search.js +4 -4
- package/clis/1688/store.js +4 -4
- package/clis/1point3acres/forum.js +1 -1
- package/clis/1point3acres/forums.js +1 -1
- package/clis/1point3acres/notifications.js +1 -1
- package/clis/1point3acres/search.js +1 -1
- package/clis/1point3acres/thread.js +2 -2
- package/clis/1point3acres/user.js +1 -1
- package/clis/1point3acres/utils.js +2 -2
- package/clis/36kr/article.js +2 -2
- package/clis/36kr/hot.js +2 -2
- package/clis/36kr/news.js +1 -1
- package/clis/36kr/search.js +2 -2
- package/clis/51job/company.js +2 -2
- package/clis/51job/detail.js +2 -2
- package/clis/51job/hot.js +1 -1
- package/clis/51job/search.js +1 -1
- package/clis/51job/utils.js +7 -7
- package/clis/_atlassian/shared.js +9 -9
- package/clis/_shared/article/auth.js +4 -4
- package/clis/_shared/article/douban-md2draft.js +4 -4
- package/clis/_shared/article/format.js +1 -1
- package/clis/_shared/article/images.js +7 -7
- package/clis/_shared/article/login.js +1 -1
- package/clis/_shared/article/publish.js +11 -11
- package/clis/_shared/common.js +1 -1
- package/clis/_shared/content-guard.js +1 -1
- package/clis/_shared/desktop-commands.js +1 -1
- package/clis/_shared/file-inject.js +12 -12
- package/clis/_shared/self-hosted-sites.js +2 -2
- package/clis/_shared/site-auth.js +1 -1
- package/clis/_shared/token-auth.js +2 -2
- package/clis/_shared/video-publish.js +9 -9
- package/clis/amazon/offer.js +3 -3
- package/clis/amazon/product.js +5 -5
- package/clis/amazon/shared.js +6 -6
- package/clis/antigravity/_actions.js +13 -13
- package/clis/antigravity/audit-extras.js +10 -10
- package/clis/antigravity/delete.js +1 -1
- package/clis/antigravity/model.js +6 -6
- package/clis/antigravity/new.js +2 -2
- package/clis/antigravity/read.js +2 -2
- package/clis/antigravity/rename.js +1 -1
- package/clis/antigravity/send.js +3 -3
- package/clis/antigravity/serve.js +17 -17
- package/clis/antigravity/storage.js +6 -6
- package/clis/antigravity/watch.js +2 -2
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/apple-podcasts/utils.js +1 -1
- package/clis/archive/item.js +1 -1
- package/clis/archive/search.js +1 -1
- package/clis/archive/snapshots.js +1 -1
- package/clis/archive/wayback.js +1 -1
- package/clis/arxiv/author.js +1 -1
- package/clis/arxiv/utils.js +1 -1
- package/clis/autohome/brand.js +1 -1
- package/clis/autohome/score.js +1 -1
- package/clis/autohome/utils.js +1 -1
- package/clis/baijiahao/article.js +1 -1
- package/clis/baijiahao/lists.js +1 -1
- package/clis/baijiahao/login.js +1 -1
- package/clis/baijiahao/publish.js +9 -9
- package/clis/baijiahao/stats.js +1 -1
- package/clis/baijiahao/whoami.js +1 -1
- package/clis/band/bands.js +2 -2
- package/clis/band/mentions.js +2 -2
- package/clis/band/post.js +4 -4
- package/clis/band/posts.js +3 -3
- package/clis/barchart/flow.js +3 -3
- package/clis/barchart/greeks.js +2 -2
- package/clis/barchart/quote.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bbc/topic.js +1 -1
- package/clis/bbc/utils.js +1 -1
- package/clis/bilibili/article.js +1 -1
- package/clis/bilibili/categories.js +1 -1
- package/clis/bilibili/coin.js +1 -1
- package/clis/bilibili/comment-del.js +1 -1
- package/clis/bilibili/comment-like.js +1 -1
- package/clis/bilibili/comment.js +1 -1
- package/clis/bilibili/comments.js +1 -1
- package/clis/bilibili/dm-list.js +1 -1
- package/clis/bilibili/dm-read.js +1 -1
- package/clis/bilibili/dm-send.js +1 -1
- package/clis/bilibili/download.js +2 -2
- package/clis/bilibili/drafts.js +1 -1
- package/clis/bilibili/dynamic-post.js +3 -3
- package/clis/bilibili/favorite-add.js +1 -1
- package/clis/bilibili/favorite.js +1 -1
- package/clis/bilibili/feed.js +2 -2
- package/clis/bilibili/follow.js +1 -1
- package/clis/bilibili/following.js +1 -1
- package/clis/bilibili/like.js +1 -1
- package/clis/bilibili/partitions.js +1 -1
- package/clis/bilibili/stats.js +1 -1
- package/clis/bilibili/subtitle.js +3 -3
- package/clis/bilibili/summary.js +1 -1
- package/clis/bilibili/topics.js +1 -1
- package/clis/bilibili/unfollow.js +1 -1
- package/clis/bilibili/upload.js +1 -1
- package/clis/bilibili/utils.js +10 -10
- package/clis/bilibili/video-drafts.js +1 -1
- package/clis/bilibili/video.js +1 -1
- package/clis/bloomberg/businessweek.js +4 -4
- package/clis/bloomberg/news.js +2 -2
- package/clis/bloomberg/utils.js +13 -13
- package/clis/bluesky/post.js +1 -1
- package/clis/bluesky/shared.js +11 -11
- package/clis/bluesky/whoami.js +1 -1
- package/clis/booking/search.js +2 -2
- package/clis/boss/accept.js +1 -1
- package/clis/boss/applied.js +1 -1
- package/clis/boss/auth.js +1 -1
- package/clis/boss/batchgreet.js +1 -1
- package/clis/boss/bossinfo.js +1 -1
- package/clis/boss/chatlist.js +1 -1
- package/clis/boss/chatmsg.js +1 -1
- package/clis/boss/cities.js +1 -1
- package/clis/boss/detail.js +1 -1
- package/clis/boss/exchange.js +1 -1
- package/clis/boss/greet.js +1 -1
- package/clis/boss/interviews.js +1 -1
- package/clis/boss/invite.js +1 -1
- package/clis/boss/joblist.js +1 -1
- package/clis/boss/mark.js +1 -1
- package/clis/boss/me.js +2 -2
- package/clis/boss/recommend.js +1 -1
- package/clis/boss/resumedelete.js +1 -1
- package/clis/boss/resumelist.js +1 -1
- package/clis/boss/resumeupload.js +11 -11
- package/clis/boss/search.js +1 -1
- package/clis/boss/send.js +1 -1
- package/clis/boss/sendresume.js +1 -1
- package/clis/boss/stats.js +1 -1
- package/clis/boss/unread.js +1 -1
- package/clis/boss/utils.js +13 -13
- package/clis/chaoxing/assignments.js +1 -1
- package/clis/chaoxing/exams.js +1 -1
- package/clis/chaoxing/utils.js +9 -9
- package/clis/chatgpt/ask.js +1 -1
- package/clis/chatgpt/auth.js +2 -2
- package/clis/chatgpt/detail.js +1 -1
- package/clis/chatgpt/image.js +1 -1
- package/clis/chatgpt/read.js +1 -1
- package/clis/chatgpt/send.js +1 -1
- package/clis/chatgpt/utils.js +59 -59
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatwise/model.js +6 -6
- package/clis/chess/analyze.js +1 -1
- package/clis/chess/game.js +1 -1
- package/clis/chess/games.js +1 -1
- package/clis/chess/stats.js +1 -1
- package/clis/chess/utils.js +1 -1
- package/clis/claude/ask.js +2 -2
- package/clis/claude/detail.js +1 -1
- package/clis/claude/new.js +1 -1
- package/clis/claude/read.js +1 -1
- package/clis/claude/send.js +1 -1
- package/clis/claude/utils.js +23 -23
- package/clis/cnblogs/article.js +1 -1
- package/clis/cnblogs/login.js +1 -1
- package/clis/cnblogs/stats.js +7 -7
- package/clis/cnblogs/whoami.js +1 -1
- package/clis/codex/_actions.js +3 -3
- package/clis/codex/archive.js +1 -1
- package/clis/codex/ask.js +6 -6
- package/clis/codex/model.js +8 -8
- package/clis/codex/pin.js +1 -1
- package/clis/codex/rename.js +4 -4
- package/clis/codex/send.js +3 -3
- package/clis/codex/sidebar.js +1 -1
- package/clis/coingecko/categories.js +1 -1
- package/clis/coingecko/coin.js +1 -1
- package/clis/coingecko/derivatives.js +1 -1
- package/clis/coingecko/exchanges.js +1 -1
- package/clis/coingecko/global.js +1 -1
- package/clis/coingecko/trending.js +1 -1
- package/clis/confluence/search.js +1 -1
- package/clis/coupang/product.js +3 -3
- package/clis/coupang/utils.js +1 -1
- package/clis/crates/crate.js +1 -1
- package/clis/crates/search.js +1 -1
- package/clis/crates/utils.js +1 -1
- package/clis/csdn/article.js +13 -13
- package/clis/csdn/columns.js +1 -1
- package/clis/csdn/login.js +1 -1
- package/clis/csdn/stats.js +4 -4
- package/clis/csdn/whoami.js +1 -1
- package/clis/cto51/article.js +1 -1
- package/clis/cto51/whoami.js +1 -1
- package/clis/ctrip/flight.js +2 -2
- package/clis/ctrip/hotel-search.js +3 -3
- package/clis/ctrip/hotel-suggest.js +1 -1
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/utils.js +6 -6
- package/clis/cursor/ask.js +5 -5
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/model.js +4 -4
- package/clis/cursor/send.js +2 -2
- package/clis/dblp/author.js +1 -1
- package/clis/dblp/paper.js +1 -1
- package/clis/dblp/search.js +1 -1
- package/clis/dblp/utils.js +1 -1
- package/clis/dblp/venue.js +1 -1
- package/clis/deepseek/ask.js +1 -1
- package/clis/deepseek/auth.js +2 -2
- package/clis/deepseek/detail.js +1 -1
- package/clis/deepseek/new.js +1 -1
- package/clis/deepseek/read.js +1 -1
- package/clis/deepseek/send.js +7 -7
- package/clis/deepseek/utils.js +25 -25
- package/clis/defillama/protocol.js +1 -1
- package/clis/defillama/protocols.js +1 -1
- package/clis/defillama/utils.js +1 -1
- package/clis/devto/auth.js +2 -2
- package/clis/devto/latest.js +1 -1
- package/clis/devto/publish.js +5 -5
- package/clis/devto/read.js +2 -2
- package/clis/devto/stats.js +3 -3
- package/clis/dianping/auth.js +2 -2
- package/clis/dianping/cityResolver.js +2 -2
- package/clis/dianping/search.js +1 -1
- package/clis/dianping/shop.js +1 -1
- package/clis/dianping/utils.js +1 -1
- package/clis/discord-app/delete.js +3 -3
- package/clis/discord-app/read.js +1 -1
- package/clis/discord-app/thread-read.js +1 -1
- package/clis/discord-web/auth.js +2 -2
- package/clis/discord-web/send.js +5 -5
- package/clis/dockerhub/image.js +1 -1
- package/clis/dockerhub/search.js +1 -1
- package/clis/dockerhub/utils.js +1 -1
- package/clis/dongchedi/koubei.js +1 -1
- package/clis/dongchedi/models.js +1 -1
- package/clis/dongchedi/score.js +1 -1
- package/clis/dongchedi/search.js +1 -1
- package/clis/dongchedi/series.js +1 -1
- package/clis/dongchedi/specs.js +1 -1
- package/clis/dongchedi/utils.js +1 -1
- package/clis/douban/article.js +3 -3
- package/clis/douban/auth.js +2 -2
- package/clis/douban/download.js +1 -1
- package/clis/douban/utils.js +23 -23
- package/clis/doubao/auth.js +3 -3
- package/clis/doubao/utils.js +39 -39
- package/clis/doubao-app/ask.js +1 -1
- package/clis/doubao-app/utils.js +4 -4
- package/clis/douyin/_shared/browser-fetch.js +7 -7
- package/clis/douyin/_shared/draft-cache.js +1 -1
- package/clis/douyin/_shared/imagex-upload.js +1 -1
- package/clis/douyin/_shared/sts2.js +1 -1
- package/clis/douyin/_shared/text-extra.js +1 -1
- package/clis/douyin/_shared/tos-upload.js +4 -4
- package/clis/douyin/_shared/transcode.js +1 -1
- package/clis/douyin/_shared/vod-upload.js +4 -4
- package/clis/douyin/draft.js +18 -18
- package/clis/douyin/drafts.js +1 -1
- package/clis/douyin/publish-image.js +12 -12
- package/clis/douyin/publish.js +9 -9
- package/clis/douyin/search.js +3 -3
- package/clis/douyin/videos.js +1 -1
- package/clis/eastmoney/_secid.js +1 -1
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/article.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/endoflife/product.js +1 -1
- package/clis/endoflife/utils.js +1 -1
- package/clis/facebook/comment.js +8 -8
- package/clis/facebook/feed.js +4 -4
- package/clis/facebook/like.js +5 -5
- package/clis/facebook/notifications.js +3 -3
- package/clis/facebook/post.js +11 -11
- package/clis/facebook/search.js +3 -3
- package/clis/flathub/app.js +1 -1
- package/clis/flathub/search.js +1 -1
- package/clis/flathub/utils.js +1 -1
- package/clis/flomo/memos.js +1 -1
- package/clis/gemini/deep-research-result.js +4 -4
- package/clis/gemini/deep-research.js +1 -1
- package/clis/gemini/detail.js +1 -1
- package/clis/gemini/history.js +1 -1
- package/clis/gemini/image.js +2 -2
- package/clis/gemini/status.js +1 -1
- package/clis/gemini/utils.js +43 -43
- package/clis/geogebra/hexagon.js +1 -1
- package/clis/geogebra/info.js +3 -3
- package/clis/geogebra/triangle.js +1 -1
- package/clis/geogebra/utils.js +11 -11
- package/clis/ghost/login.js +1 -1
- package/clis/ghost/shared.js +2 -2
- package/clis/gitee/auth.js +2 -2
- package/clis/github-trending/repos.js +1 -1
- package/clis/google/news.js +1 -1
- package/clis/google/search.js +2 -2
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google/utils.js +1 -1
- package/clis/goproxy/module.js +1 -1
- package/clis/goproxy/utils.js +1 -1
- package/clis/goproxy/versions.js +1 -1
- package/clis/gov-policy/recent.js +2 -2
- package/clis/gov-policy/search.js +2 -2
- package/clis/grok/ask.js +1 -1
- package/clis/grok/detail.js +1 -1
- package/clis/grok/image.js +8 -8
- package/clis/grok/pin.js +1 -1
- package/clis/grok/send.js +1 -1
- package/clis/grok/status.js +1 -1
- package/clis/grok/utils.js +21 -21
- package/clis/guazi/browse.js +1 -1
- package/clis/guazi/car.js +1 -1
- package/clis/guazi/utils.js +1 -1
- package/clis/hackernews/auth.js +2 -2
- package/clis/hackernews/comment.js +8 -8
- package/clis/hackernews/read.js +7 -7
- package/clis/hackernews/submit.js +7 -7
- package/clis/hashnode/auth.js +3 -3
- package/clis/hashnode/publish.js +14 -14
- package/clis/hf/auth.js +2 -2
- package/clis/hf/models.js +1 -1
- package/clis/hf/paper.js +1 -1
- package/clis/hf/spaces.js +1 -1
- package/clis/hf/top.js +1 -1
- package/clis/homebrew/cask.js +1 -1
- package/clis/homebrew/formula.js +1 -1
- package/clis/homebrew/popular.js +1 -1
- package/clis/homebrew/utils.js +1 -1
- package/clis/huodongxing/events.js +1 -1
- package/clis/hupu/detail.js +4 -4
- package/clis/hupu/hot.js +3 -3
- package/clis/hupu/reply.js +1 -1
- package/clis/hupu/search.js +1 -1
- package/clis/hupu/unlike.js +1 -1
- package/clis/hupu/utils.js +10 -10
- package/clis/imdb/person.js +2 -2
- package/clis/imdb/reviews.js +3 -3
- package/clis/imdb/search.js +2 -2
- package/clis/imdb/title.js +1 -1
- package/clis/imdb/top.js +1 -1
- package/clis/imdb/trending.js +1 -1
- package/clis/imdb/utils.js +13 -13
- package/clis/imooc/article.js +6 -6
- package/clis/imooc/login.js +1 -1
- package/clis/imooc/whoami.js +1 -1
- package/clis/indeed/job.js +2 -2
- package/clis/indeed/search.js +2 -2
- package/clis/indeed/utils.js +1 -1
- package/clis/infoq/article.js +2 -2
- package/clis/infoq/login.js +1 -1
- package/clis/infoq/whoami.js +1 -1
- package/clis/instagram/_shared/private-publish.js +4 -4
- package/clis/instagram/_shared/protocol-capture.js +9 -9
- package/clis/instagram/detail.js +3 -3
- package/clis/instagram/post.js +25 -25
- package/clis/instagram/reel.js +18 -18
- package/clis/instagram/story.js +4 -4
- package/clis/instagram/user.js +2 -2
- package/clis/jd/item.js +65 -65
- package/clis/jianshu/article.js +1 -1
- package/clis/jianshu/login.js +1 -1
- package/clis/jianshu/notebooks.js +1 -1
- package/clis/jianshu/whoami.js +1 -1
- package/clis/jianyu/search.js +6 -6
- package/clis/jianyu/shared/procurement-contract.js +1 -1
- package/clis/jike/api.js +6 -6
- package/clis/jike/auth.js +3 -3
- package/clis/jike/comment.js +1 -1
- package/clis/jike/create.js +6 -6
- package/clis/jike/feed.js +3 -3
- package/clis/jike/like.js +1 -1
- package/clis/jike/notifications.js +3 -3
- package/clis/jike/repost.js +13 -13
- package/clis/jike/search.js +3 -3
- package/clis/jimeng/auth.js +2 -2
- package/clis/jimeng/generate.js +10 -10
- package/clis/jira/shared.js +1 -1
- package/clis/juejin/article.js +4 -4
- package/clis/juejin/categories.js +1 -1
- package/clis/juejin/hot.js +1 -1
- package/clis/juejin/login.js +1 -1
- package/clis/juejin/recommend.js +1 -1
- package/clis/juejin/stats.js +3 -3
- package/clis/juejin/tags.js +1 -1
- package/clis/juejin/utils.js +1 -1
- package/clis/juejin/whoami.js +1 -1
- package/clis/ke/utils.js +4 -4
- package/clis/kimi/_utils.js +7 -7
- package/clis/kimi/audit-extras.js +14 -14
- package/clis/kimi/auth.js +3 -3
- package/clis/kimi/chat.js +15 -15
- package/clis/kimi/storage.js +5 -5
- package/clis/kimi/ui.js +13 -13
- package/clis/kimi/usage.js +3 -3
- package/clis/kuaishou/auth.js +1 -1
- package/clis/kuaishou/publish.js +6 -6
- package/clis/lesswrong/_helpers.js +5 -5
- package/clis/lesswrong/comments.js +5 -5
- package/clis/lichess/top.js +1 -1
- package/clis/lichess/user.js +1 -1
- package/clis/lichess/utils.js +1 -1
- package/clis/linkedin/comment.js +1 -1
- package/clis/linkedin/connect.js +11 -11
- package/clis/linkedin/create.js +5 -5
- package/clis/linkedin/follow.js +1 -1
- package/clis/linkedin/inbox.js +1 -1
- package/clis/linkedin/job-detail.js +3 -3
- package/clis/linkedin/like.js +1 -1
- package/clis/linkedin/notifications.js +1 -1
- package/clis/linkedin/people-search.js +1 -1
- package/clis/linkedin/post-comments.js +1 -1
- package/clis/linkedin/post-detail.js +1 -1
- package/clis/linkedin/profile-analytics.js +1 -1
- package/clis/linkedin/profile-api.js +13 -13
- package/clis/linkedin/profile-experience.js +1 -1
- package/clis/linkedin/profile-projects.js +1 -1
- package/clis/linkedin/profile-read.js +3 -3
- package/clis/linkedin/reply.js +1 -1
- package/clis/linkedin/repost.js +1 -1
- package/clis/linkedin/safe-send.js +8 -8
- package/clis/linkedin/salesnav-inbox.js +5 -5
- package/clis/linkedin/salesnav-message.js +3 -3
- package/clis/linkedin/salesnav-search.js +4 -4
- package/clis/linkedin/salesnav-thread.js +1 -1
- package/clis/linkedin/search-api.js +3 -3
- package/clis/linkedin/search.js +8 -8
- package/clis/linkedin/social-api.js +31 -31
- package/clis/linkedin/timeline.js +3 -3
- package/clis/linkedin-learning/search.js +2 -2
- package/clis/linkedin-learning/trending.js +2 -2
- package/clis/linux-do/feed.js +4 -4
- package/clis/linux-do/topic-content.js +8 -8
- package/clis/lobsters/domain.js +1 -1
- package/clis/lobsters/read.js +7 -7
- package/clis/maimai/auth.js +2 -2
- package/clis/maimai/search-talents.js +4 -4
- package/clis/manus/_utils.js +1 -1
- package/clis/mastodon/login.js +1 -1
- package/clis/mastodon/post.js +1 -1
- package/clis/mastodon/shared.js +12 -12
- package/clis/mastodon/whoami.js +1 -1
- package/clis/maven/artifact.js +1 -1
- package/clis/maven/search.js +1 -1
- package/clis/maven/utils.js +1 -1
- package/clis/mdn/search.js +1 -1
- package/clis/medium/article.js +5 -5
- package/clis/medium/login.js +1 -1
- package/clis/medium/stats.js +3 -3
- package/clis/medium/tag.js +1 -1
- package/clis/medium/whoami.js +1 -1
- package/clis/mubu/notes.js +1 -1
- package/clis/mubu/utils.js +15 -15
- package/clis/note/auth.js +2 -2
- package/clis/note/note-utils.js +2 -2
- package/clis/note/publish.js +8 -8
- package/clis/notebooklm/add-source.js +8 -8
- package/clis/notebooklm/create.js +1 -1
- package/clis/notebooklm/generate-slides.js +1 -1
- package/clis/notebooklm/notes-get.js +1 -1
- package/clis/notebooklm/rpc.js +8 -8
- package/clis/notebooklm/source-fulltext.js +1 -1
- package/clis/notebooklm/utils.js +10 -10
- package/clis/nowcoder/auth.js +2 -2
- package/clis/nowcoder/comment.js +1 -1
- package/clis/nowcoder/comments.js +1 -1
- package/clis/nowcoder/dm-list.js +1 -1
- package/clis/nowcoder/dm-read.js +1 -1
- package/clis/nowcoder/dm-send.js +1 -1
- package/clis/nowcoder/drafts.js +1 -1
- package/clis/nowcoder/inbox.js +1 -1
- package/clis/nowcoder/like.js +1 -1
- package/clis/nowcoder/my.js +1 -1
- package/clis/nowcoder/post.js +1 -1
- package/clis/nowcoder/utils.js +13 -13
- package/clis/npm/downloads.js +1 -1
- package/clis/npm/package.js +1 -1
- package/clis/npm/search.js +1 -1
- package/clis/npm/utils.js +1 -1
- package/clis/nuget/package.js +1 -1
- package/clis/nuget/search.js +1 -1
- package/clis/nuget/utils.js +1 -1
- package/clis/nvd/cve.js +1 -1
- package/clis/oeis/search.js +1 -1
- package/clis/oeis/sequence.js +1 -1
- package/clis/oeis/utils.js +1 -1
- package/clis/ones/common.js +6 -6
- package/clis/ones/enrich-tasks.js +1 -1
- package/clis/ones/my-tasks.js +1 -1
- package/clis/ones/resolve-labels.js +1 -1
- package/clis/ones/task-helpers.js +1 -1
- package/clis/ones/task.js +1 -1
- package/clis/ones/worklog.js +7 -7
- package/clis/openalex/search.js +1 -1
- package/clis/openalex/utils.js +1 -1
- package/clis/openalex/work.js +1 -1
- package/clis/openfda/drug-label.js +1 -1
- package/clis/openfda/food-recall.js +1 -1
- package/clis/openfda/utils.js +1 -1
- package/clis/openreview/author.js +1 -1
- package/clis/openreview/paper.js +1 -1
- package/clis/openreview/reviews.js +3 -3
- package/clis/openreview/search.js +1 -1
- package/clis/openreview/utils.js +1 -1
- package/clis/openreview/venue.js +1 -1
- package/clis/oschina/article.js +1 -1
- package/clis/oschina/catalogs.js +1 -1
- package/clis/oschina/login.js +1 -1
- package/clis/oschina/stats.js +6 -6
- package/clis/oschina/whoami.js +1 -1
- package/clis/osv/query.js +1 -1
- package/clis/osv/utils.js +1 -1
- package/clis/osv/vulnerability.js +1 -1
- package/clis/packagist/package.js +1 -1
- package/clis/packagist/search.js +1 -1
- package/clis/packagist/utils.js +1 -1
- package/clis/pinterest/api.js +1 -1
- package/clis/pinterest/auth.js +1 -1
- package/clis/pinterest/boards.js +1 -1
- package/clis/pinterest/client.js +6 -6
- package/clis/pinterest/publish.js +5 -5
- package/clis/pixiv/auth.js +2 -2
- package/clis/pixiv/download.js +1 -1
- package/clis/pixiv/illusts.js +1 -1
- package/clis/pixiv/search.js +1 -1
- package/clis/pixiv/utils.js +3 -3
- package/clis/powerchina/auth.js +2 -2
- package/clis/powerchina/search.js +1 -1
- package/clis/producthunt/browse.js +2 -2
- package/clis/producthunt/hot.js +2 -2
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/producthunt/utils.js +1 -1
- package/clis/pypi/downloads.js +1 -1
- package/clis/pypi/package.js +1 -1
- package/clis/pypi/utils.js +1 -1
- package/clis/qiita/auth.js +1 -1
- package/clis/qiita/gql.js +6 -6
- package/clis/qiita/publish.js +4 -4
- package/clis/qiita/stats.js +4 -4
- package/clis/qoder/_utils.js +16 -16
- package/clis/qoder/composer.js +1 -1
- package/clis/qoder/quest.js +1 -1
- package/clis/qoder/ui.js +14 -14
- package/clis/quark/auth.js +2 -2
- package/clis/quark/utils.js +2 -2
- package/clis/quora/answer-comments.js +3 -3
- package/clis/quora/create-answer.js +4 -4
- package/clis/quora/create-question.js +3 -3
- package/clis/quora/shared.js +17 -17
- package/clis/quora/whoami.js +1 -1
- package/clis/qwen/ask.js +1 -1
- package/clis/qwen/auth.js +3 -3
- package/clis/qwen/detail.js +1 -1
- package/clis/qwen/image.js +5 -5
- package/clis/qwen/status.js +1 -1
- package/clis/qwen/utils.js +16 -16
- package/clis/reddit/home.js +3 -3
- package/clis/reddit/read.js +10 -10
- package/clis/reddit/reply.js +4 -4
- package/clis/reddit/submit.js +11 -11
- package/clis/reddit/subreddit-info.js +3 -3
- package/clis/reddit/subscribed.js +4 -4
- package/clis/reddit/whoami.js +2 -2
- package/clis/rednote/comments.js +1 -1
- package/clis/rednote/download.js +1 -1
- package/clis/rednote/feed.js +1 -1
- package/clis/rednote/note.js +1 -1
- package/clis/rednote/notifications.js +2 -2
- package/clis/rednote/search.js +2 -2
- package/clis/rest-countries/country.js +1 -1
- package/clis/rest-countries/region.js +1 -1
- package/clis/rest-countries/utils.js +1 -1
- package/clis/reuters/article-detail.js +1 -1
- package/clis/reuters/auth.js +3 -3
- package/clis/reuters/search.js +1 -1
- package/clis/reuters/utils.js +4 -4
- package/clis/rfc/rfc.js +1 -1
- package/clis/rfc/utils.js +1 -1
- package/clis/rubygems/gem.js +1 -1
- package/clis/rubygems/search.js +1 -1
- package/clis/rubygems/utils.js +1 -1
- package/clis/segmentfault/article.js +3 -3
- package/clis/segmentfault/channels.js +1 -1
- package/clis/segmentfault/login.js +1 -1
- package/clis/segmentfault/stats.js +4 -4
- package/clis/segmentfault/tags.js +1 -1
- package/clis/segmentfault/whoami.js +1 -1
- package/clis/semanticscholar/citations.js +1 -1
- package/clis/semanticscholar/paper.js +1 -1
- package/clis/semanticscholar/recommendations.js +1 -1
- package/clis/semanticscholar/search.js +1 -1
- package/clis/semanticscholar/utils.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock-rank.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/slock/attachment-download.js +1 -1
- package/clis/slock/attachment-upload.js +7 -7
- package/clis/slock/attachment-url.js +1 -1
- package/clis/slock/auth-verify.js +1 -1
- package/clis/slock/bookmark-add.js +1 -1
- package/clis/slock/bookmark-remove.js +1 -1
- package/clis/slock/channel-action.js +1 -1
- package/clis/slock/channel-create.js +1 -1
- package/clis/slock/channel-files.js +1 -1
- package/clis/slock/channel-list.js +1 -1
- package/clis/slock/channel-mark.js +1 -1
- package/clis/slock/channel-members.js +1 -1
- package/clis/slock/channel-unarchive.js +1 -1
- package/clis/slock/dm-list.js +1 -1
- package/clis/slock/errors.js +1 -1
- package/clis/slock/in-page.js +28 -28
- package/clis/slock/inbox-done.js +5 -5
- package/clis/slock/inbox.js +1 -1
- package/clis/slock/message-read.js +22 -22
- package/clis/slock/message-search.js +10 -10
- package/clis/slock/message-send.js +25 -25
- package/clis/slock/reaction-add.js +1 -1
- package/clis/slock/reaction-remove.js +1 -1
- package/clis/slock/resolve.js +1 -1
- package/clis/slock/server-list.js +2 -2
- package/clis/slock/task-claim.js +4 -4
- package/clis/slock/task-convert.js +13 -13
- package/clis/slock/task-create.js +1 -1
- package/clis/slock/task-delete.js +5 -5
- package/clis/slock/task-get.js +5 -5
- package/clis/slock/task-list-server.js +4 -4
- package/clis/slock/task-list.js +5 -5
- package/clis/slock/task-status.js +3 -3
- package/clis/slock/task-unclaim.js +3 -3
- package/clis/slock/thread-follow.js +1 -1
- package/clis/slock/thread-state.js +1 -1
- package/clis/slock/unread-summary.js +5 -5
- package/clis/slock/whoami.js +1 -1
- package/clis/smzdm/search.js +3 -3
- package/clis/sohu/article.js +1 -1
- package/clis/sohu/attributes.js +1 -1
- package/clis/sohu/categories.js +1 -1
- package/clis/sohu/channels.js +1 -1
- package/clis/sohu/columns.js +1 -1
- package/clis/sohu/login.js +1 -1
- package/clis/sohu/stats.js +3 -3
- package/clis/sohu/topics.js +1 -1
- package/clis/sohu/whoami.js +1 -1
- package/clis/spotify/spotify.js +1 -1
- package/clis/stackoverflow/read.js +6 -6
- package/clis/stackoverflow/related.js +1 -1
- package/clis/stackoverflow/tag.js +1 -1
- package/clis/stackoverflow/user.js +1 -1
- package/clis/stackoverflow/utils.js +1 -1
- package/clis/steam/app.js +1 -1
- package/clis/steam/search.js +1 -1
- package/clis/steam/utils.js +1 -1
- package/clis/substack/auth.js +2 -2
- package/clis/substack/post-utils.js +2 -2
- package/clis/substack/publish.js +5 -5
- package/clis/suno/auth.js +2 -2
- package/clis/suno/download.js +5 -5
- package/clis/suno/generate.js +3 -3
- package/clis/suno/list.js +1 -1
- package/clis/suno/status.js +1 -1
- package/clis/suno/utils.js +29 -29
- package/clis/telegram/send.js +7 -7
- package/clis/telegram/shared.js +2 -2
- package/clis/telegram/whoami.js +1 -1
- package/clis/test-utils.js +1 -1
- package/clis/threads/post.js +23 -23
- package/clis/threads/shared.js +3 -3
- package/clis/threads/whoami.js +1 -1
- package/clis/tieba/hot.js +3 -3
- package/clis/tieba/posts.js +1 -1
- package/clis/tieba/read.js +2 -2
- package/clis/tieba/search.js +3 -3
- package/clis/tieba/utils.js +1 -1
- package/clis/tiktok/comment.js +2 -2
- package/clis/tiktok/creator-videos.js +3 -3
- package/clis/tiktok/explore.js +3 -3
- package/clis/tiktok/follow.js +8 -8
- package/clis/tiktok/following.js +4 -4
- package/clis/tiktok/friends.js +7 -7
- package/clis/tiktok/live.js +3 -3
- package/clis/tiktok/notifications.js +6 -6
- package/clis/tiktok/publish.js +17 -17
- package/clis/tiktok/unfollow.js +4 -4
- package/clis/tiktok/user.js +2 -2
- package/clis/tiktok/utils.js +1 -1
- package/clis/toutiao/article.js +1 -1
- package/clis/toutiao/articles.js +2 -2
- package/clis/toutiao/auth.js +2 -2
- package/clis/toutiao/hot.js +1 -1
- package/clis/toutiao/recommend.js +1 -1
- package/clis/toutiao/utils.js +2 -2
- package/clis/trae-solo/_actions.js +4 -4
- package/clis/trae-solo/_fs.js +5 -5
- package/clis/trae-solo/_state.js +2 -2
- package/clis/trae-solo/automation.js +4 -4
- package/clis/trae-solo/mode.js +4 -4
- package/clis/trae-solo/model.js +4 -4
- package/clis/trae-solo/renderer-storage.js +4 -4
- package/clis/trae-solo/settings.js +1 -1
- package/clis/trae-solo/skill-fs.js +1 -1
- package/clis/trae-solo/skill.js +12 -12
- package/clis/trae-solo/state-fs.js +2 -2
- package/clis/trae-solo/task-fs.js +5 -5
- package/clis/trae-solo/workspaces-fs.js +1 -1
- package/clis/tumblr/auth.js +2 -2
- package/clis/tumblr/publish.js +3 -3
- package/clis/tvmaze/search.js +1 -1
- package/clis/tvmaze/show.js +1 -1
- package/clis/tvmaze/utils.js +1 -1
- package/clis/twitter/accept.js +7 -7
- package/clis/twitter/article.js +7 -7
- package/clis/twitter/bookmark-folder.js +3 -3
- package/clis/twitter/bookmark-folders.js +3 -3
- package/clis/twitter/bookmarks.js +4 -4
- package/clis/twitter/delete.js +5 -5
- package/clis/twitter/device-follow.js +3 -3
- package/clis/twitter/dm-list.js +1 -1
- package/clis/twitter/dm-read.js +1 -1
- package/clis/twitter/dm-send.js +5 -5
- package/clis/twitter/dm-shared.js +3 -3
- package/clis/twitter/download.js +6 -6
- package/clis/twitter/followers.js +5 -5
- package/clis/twitter/following.js +2 -2
- package/clis/twitter/like.js +3 -3
- package/clis/twitter/likes.js +8 -8
- package/clis/twitter/list-add-core.js +9 -9
- package/clis/twitter/list-create.js +5 -5
- package/clis/twitter/list-remove-core.js +9 -9
- package/clis/twitter/list-tweets.js +7 -7
- package/clis/twitter/lists.js +6 -6
- package/clis/twitter/notifications.js +2 -2
- package/clis/twitter/post.js +24 -24
- package/clis/twitter/profile.js +7 -7
- package/clis/twitter/quote.js +7 -7
- package/clis/twitter/reply-dm.js +7 -7
- package/clis/twitter/reply.js +12 -12
- package/clis/twitter/retweet.js +3 -3
- package/clis/twitter/scheduled-delete.js +3 -3
- package/clis/twitter/scheduled-list.js +2 -2
- package/clis/twitter/scheduled-utils.js +3 -3
- package/clis/twitter/search.js +5 -5
- package/clis/twitter/shared.js +6 -6
- package/clis/twitter/thread.js +4 -4
- package/clis/twitter/timeline.js +3 -3
- package/clis/twitter/trending.js +2 -2
- package/clis/twitter/tweets.js +11 -11
- package/clis/twitter/unlike.js +3 -3
- package/clis/twitter/unretweet.js +3 -3
- package/clis/twitter/utils.js +6 -6
- package/clis/upwork/detail.js +2 -2
- package/clis/upwork/feed.js +2 -2
- package/clis/upwork/search.js +2 -2
- package/clis/upwork/utils.js +1 -1
- package/clis/v2ex/auth.js +2 -2
- package/clis/v2ex/daily.js +3 -3
- package/clis/v2ex/me.js +2 -2
- package/clis/v2ex/notifications.js +2 -2
- package/clis/vk/post.js +1 -1
- package/clis/vk/shared.js +2 -2
- package/clis/vk/whoami.js +1 -1
- package/clis/web/read.js +8 -8
- package/clis/wechat-channels/auth.js +2 -2
- package/clis/wechat-channels/publish.js +30 -30
- package/clis/weibo/article.js +1 -1
- package/clis/weibo/auth.js +3 -3
- package/clis/weibo/comments.js +1 -1
- package/clis/weibo/delete.js +2 -2
- package/clis/weibo/feed.js +3 -3
- package/clis/weibo/hot.js +1 -1
- package/clis/weibo/publish.js +10 -10
- package/clis/weibo/search.js +2 -2
- package/clis/weibo/user-posts.js +3 -3
- package/clis/weibo/user.js +2 -2
- package/clis/weibo/utils.js +3 -3
- package/clis/weixin/article.js +1 -1
- package/clis/weixin/create-draft.js +26 -26
- package/clis/weixin/download.js +2 -2
- package/clis/weixin/login.js +1 -1
- package/clis/weixin/search.js +2 -2
- package/clis/weixin/stats.js +3 -3
- package/clis/weixin/whoami.js +1 -1
- package/clis/weread/ai-outline.js +2 -2
- package/clis/weread/book-search.js +2 -2
- package/clis/weread/book.js +2 -2
- package/clis/weread/notebooks.js +1 -1
- package/clis/weread/search.js +1 -1
- package/clis/weread/shelf.js +1 -1
- package/clis/weread/utils.js +6 -6
- package/clis/weread-official/book.js +1 -1
- package/clis/weread-official/discover.js +1 -1
- package/clis/weread-official/list-apis.js +1 -1
- package/clis/weread-official/notes.js +1 -1
- package/clis/weread-official/readdata.js +1 -1
- package/clis/weread-official/review.js +1 -1
- package/clis/weread-official/search.js +1 -1
- package/clis/weread-official/shelf.js +1 -1
- package/clis/weread-official/utils.js +1 -1
- package/clis/wikidata/entity.js +1 -1
- package/clis/wikidata/search.js +1 -1
- package/clis/wikidata/utils.js +1 -1
- package/clis/wikipedia/page.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/wikipedia/utils.js +1 -1
- package/clis/wordpress/login.js +1 -1
- package/clis/wordpress/publish.js +1 -1
- package/clis/wordpress/shared.js +3 -3
- package/clis/wordpress/whoami.js +1 -1
- package/clis/woshipm/article.js +1 -1
- package/clis/woshipm/login.js +1 -1
- package/clis/woshipm/stats.js +4 -4
- package/clis/woshipm/whoami.js +1 -1
- package/clis/wttr/current.js +1 -1
- package/clis/wttr/forecast.js +1 -1
- package/clis/wttr/utils.js +1 -1
- package/clis/xianyu/collect.js +1 -1
- package/clis/xianyu/inbox.js +1 -1
- package/clis/xianyu/item-stats.js +2 -2
- package/clis/xianyu/location.js +1 -1
- package/clis/xianyu/manage.js +1 -1
- package/clis/xianyu/messages.js +1 -1
- package/clis/xianyu/mtop.js +5 -5
- package/clis/xianyu/order.js +1 -1
- package/clis/xianyu/promote-stats.js +2 -2
- package/clis/xianyu/publish.js +17 -17
- package/clis/xianyu/rate.js +1 -1
- package/clis/xianyu/reply.js +1 -1
- package/clis/xianyu/search.js +8 -8
- package/clis/xianyu/seller-data.js +1 -1
- package/clis/xianyu/seller-list.js +1 -1
- package/clis/xianyu/user.js +1 -1
- package/clis/xiaoe/catalog.js +2 -2
- package/clis/xiaoe/content.js +2 -2
- package/clis/xiaoe/courses.js +2 -2
- package/clis/xiaohongshu/ask.js +6 -6
- package/clis/xiaohongshu/comments.js +6 -6
- package/clis/xiaohongshu/creator-note-detail.js +7 -7
- package/clis/xiaohongshu/creator-notes-summary.js +1 -1
- package/clis/xiaohongshu/creator-notes.js +13 -13
- package/clis/xiaohongshu/creator-profile.js +2 -2
- package/clis/xiaohongshu/creator-stats.js +2 -2
- package/clis/xiaohongshu/delete-note.js +7 -7
- package/clis/xiaohongshu/download.js +4 -4
- package/clis/xiaohongshu/feed.js +2 -2
- package/clis/xiaohongshu/follow.js +3 -3
- package/clis/xiaohongshu/human.js +3 -3
- package/clis/xiaohongshu/note-helpers.js +1 -1
- package/clis/xiaohongshu/note.js +2 -2
- package/clis/xiaohongshu/notifications.js +1 -1
- package/clis/xiaohongshu/publish-video.js +8 -8
- package/clis/xiaohongshu/publish.js +59 -59
- package/clis/xiaohongshu/search.js +8 -8
- package/clis/xiaohongshu/unfollow.js +4 -4
- package/clis/xiaohongshu/user-helpers.js +1 -1
- package/clis/xiaohongshu/user.js +2 -2
- package/clis/xiaoyuzhou/auth.js +3 -3
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/utils.js +1 -1
- package/clis/xueqiu/article.js +4 -4
- package/clis/xueqiu/comments.js +4 -4
- package/clis/xueqiu/danjuan-utils.js +4 -4
- package/clis/xueqiu/earnings-date.js +1 -1
- package/clis/xueqiu/events.js +3 -3
- package/clis/xueqiu/hashtags.js +3 -3
- package/clis/xueqiu/stocks.js +3 -3
- package/clis/xueqiu/users.js +3 -3
- package/clis/xueqiu/utils.js +3 -3
- package/clis/yahoo-finance/quote.js +1 -1
- package/clis/yollomi/background.js +1 -1
- package/clis/yollomi/edit.js +1 -1
- package/clis/yollomi/face-swap.js +1 -1
- package/clis/yollomi/generate.js +1 -1
- package/clis/yollomi/object-remover.js +1 -1
- package/clis/yollomi/remove-bg.js +1 -1
- package/clis/yollomi/restore.js +1 -1
- package/clis/yollomi/try-on.js +1 -1
- package/clis/yollomi/upload.js +4 -4
- package/clis/yollomi/upscale.js +1 -1
- package/clis/yollomi/utils.js +4 -4
- package/clis/yollomi/video.js +1 -1
- package/clis/youtube/channel.js +4 -4
- package/clis/youtube/feed.js +2 -2
- package/clis/youtube/like.js +5 -5
- package/clis/youtube/playlist.js +7 -7
- package/clis/youtube/publish.js +11 -11
- package/clis/youtube/search.js +3 -3
- package/clis/youtube/subscribe.js +7 -7
- package/clis/youtube/subscriptions.js +1 -1
- package/clis/youtube/transcript-group.js +2 -2
- package/clis/youtube/transcript.js +13 -13
- package/clis/youtube/unlike.js +5 -5
- package/clis/youtube/unsubscribe.js +7 -7
- package/clis/youtube/utils.js +3 -3
- package/clis/youtube/video.js +4 -4
- package/clis/youtube/watch-later.js +2 -2
- package/clis/yuanbao/ask.js +18 -18
- package/clis/yuanbao/detail.js +1 -1
- package/clis/yuanbao/read.js +1 -1
- package/clis/yuanbao/shared.js +9 -9
- package/clis/yuanbao/status.js +1 -1
- package/clis/yuque/article.js +1 -1
- package/clis/yuque/whoami.js +1 -1
- package/clis/zhihu/answer-comments.js +2 -2
- package/clis/zhihu/answer-detail.js +3 -3
- package/clis/zhihu/answer.js +1 -1
- package/clis/zhihu/article-transform.js +1 -1
- package/clis/zhihu/article.js +1 -1
- package/clis/zhihu/auth.js +2 -2
- package/clis/zhihu/collection.js +3 -3
- package/clis/zhihu/collections.js +3 -3
- package/clis/zhihu/download.js +2 -2
- package/clis/zhihu/image-profile.js +6 -6
- package/clis/zhihu/paginate.js +3 -3
- package/clis/zhihu/pin.js +4 -4
- package/clis/zhihu/question.js +3 -3
- package/clis/zhihu/recommend.js +3 -3
- package/clis/zhihu/search.js +3 -3
- package/clis/zhihu/stats.js +3 -3
- package/clis/zhihu/user-arg.js +1 -1
- package/clis/zhihu/write-shared.js +7 -7
- package/clis/zlibrary/utils.js +6 -6
- package/clis/zsxq/auth.js +3 -3
- package/clis/zsxq/search.js +1 -1
- package/clis/zsxq/topic.js +1 -1
- package/clis/zsxq/utils.js +5 -5
- package/dist/src/adapter-source.js +1 -1
- package/dist/src/browser/analyze.js +1 -1
- package/dist/src/browser/article-extract.js +2 -2
- package/dist/src/browser/ax-snapshot.js +2 -2
- package/dist/src/browser/base-page.js +25 -25
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.js +1 -1
- package/dist/src/browser/daemon-client.js +1 -1
- package/dist/src/browser/daemon-lifecycle.js +7 -7
- package/dist/src/browser/dom-helpers.js +35 -35
- package/dist/src/browser/dom-snapshot.js +19 -19
- package/dist/src/browser/errors.js +3 -3
- package/dist/src/browser/extract.js +5 -5
- package/dist/src/browser/find.js +13 -13
- package/dist/src/browser/fingerprint.js +2 -2
- package/dist/src/browser/html-tree.js +6 -6
- package/dist/src/browser/managed-chrome.js +1 -1
- package/dist/src/browser/network-cache.js +1 -1
- package/dist/src/browser/network-key.js +1 -1
- package/dist/src/browser/page.js +7 -7
- package/dist/src/browser/profile.js +2 -2
- package/dist/src/browser/proxy-test.js +8 -8
- package/dist/src/browser/shape-filter.js +1 -1
- package/dist/src/browser/shape.js +1 -1
- package/dist/src/browser/stealth.js +3 -3
- package/dist/src/browser/tabs.js +2 -2
- package/dist/src/browser/target-errors.js +1 -1
- package/dist/src/browser/target-resolver.js +23 -23
- package/dist/src/browser/trace.js +2 -2
- package/dist/src/browser/utils.js +1 -1
- package/dist/src/browser/verify-fixture.js +2 -2
- package/dist/src/browser-session-lock.js +1 -1
- package/dist/src/build-manifest.js +11 -11
- package/dist/src/capabilityRouting.js +1 -1
- package/dist/src/cli-argv-preprocess.js +1 -1
- package/dist/src/cli.js +32 -32
- package/dist/src/commanderAdapter.js +3 -3
- package/dist/src/commands/auth.js +3 -3
- package/dist/src/commands/daemon.js +1 -1
- package/dist/src/completion-fast.js +1 -1
- package/dist/src/completion.js +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/convention-audit.js +2 -2
- package/dist/src/daemon-utils.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/discovery.js +2 -2
- package/dist/src/doctor.js +9 -9
- package/dist/src/download/article-download.js +15 -15
- package/dist/src/download/index.js +4 -4
- package/dist/src/download/media-download.js +1 -1
- package/dist/src/download/progress.js +3 -3
- package/dist/src/electron-apps.js +1 -1
- package/dist/src/errors.js +2 -2
- package/dist/src/execution.js +2 -2
- package/dist/src/external.js +1 -1
- package/dist/src/help.js +8 -8
- package/dist/src/hooks.js +1 -1
- package/dist/src/interceptor.js +21 -21
- package/dist/src/launcher.js +7 -7
- package/dist/src/logger.js +8 -8
- package/dist/src/main.js +7 -7
- package/dist/src/observation/artifact.js +5 -5
- package/dist/src/observation/retention.js +1 -1
- package/dist/src/output.js +2 -2
- package/dist/src/package-paths.js +1 -1
- package/dist/src/pipeline/executor.js +1 -1
- package/dist/src/pipeline/registry.js +1 -1
- package/dist/src/pipeline/steps/browser.js +1 -1
- package/dist/src/pipeline/steps/download.js +1 -1
- package/dist/src/pipeline/steps/fetch.js +6 -6
- package/dist/src/pipeline/steps/intercept.js +1 -1
- package/dist/src/pipeline/steps/tap.js +17 -17
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.js +1 -1
- package/dist/src/plugin-manifest.js +1 -1
- package/dist/src/plugin-scaffold.js +19 -19
- package/dist/src/plugin.js +12 -12
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/runtime-detect.js +1 -1
- package/dist/src/runtime.js +1 -1
- package/dist/src/scripts/framework.js +1 -1
- package/dist/src/scripts/interact.js +1 -1
- package/dist/src/scripts/store.js +1 -1
- package/dist/src/serialization.js +2 -2
- package/dist/src/session-lease.js +1 -1
- package/dist/src/snapshotFormatter.js +2 -2
- package/dist/src/tui.js +12 -12
- package/dist/src/user-runtime.js +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.js +4 -4
- package/dist/src/validate.js +2 -2
- package/dist/src/verify.js +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as L,Strategy as N}from"@jackwener/opencli/registry";import{ArgumentError as g,AuthRequiredError as T,CommandExecutionError as c,EmptyResultError as _}from"@jackwener/opencli/errors";import{stripHtml as Z}from"./text.js";function E(e){return Z(e,{preserveBlocks:!0})}const C=/^\d+$/,U=/^answer:(\d+):(\d+)$/,I=/^\/question\/(\d+)\/answer\/(\d+)\/?$/,q=/^\/answer\/(\d+)\/?$/;function b(e){const n=String(e??"").trim();if(!n)return null;if(C.test(n))return{answerId:n,questionId:""};const t=n.match(U);if(t)return{questionId:t[1],answerId:t[2]};try{const r=new URL(n);if(r.protocol!=="https:"||r.username||r.password||r.port||r.hostname!=="www.zhihu.com"&&r.hostname!=="zhihu.com")return null;let i=r.pathname.match(I);if(i)return{questionId:i[1],answerId:i[2]};i=r.pathname.match(q);if(i)return{answerId:i[1],questionId:""}}catch{return null}return null}function x(e){const n=String(e??"").trim();if(!n)return"";try{const t=new URL(n);if(t.protocol!=="https:"||t.hostname!=="www.zhihu.com"&&t.hostname!=="zhihu.com")return"";return t.pathname.match(I)?.[1]||""}catch{return""}}function k(e){return Number.isInteger(e)&&e>=0?e:0}function v(e){return typeof e==="number"&&Number.isFinite(e)&&e>0?new Date(e*1000).toISOString():""}function R(e){return e?.member?.name||e?.name||""}function H(e){if(typeof e==="string")return e.trim();if(typeof e==="number"&&Number.isSafeInteger(e)&&e>=0)return String(e);return""}function P(e,n,t,r){if(n&&t&&r)return`https://www.zhihu.com/question/${n}/answer/${t}#comment-${r}`;return typeof e==="string"?e:""}function A(e,n){if(typeof e!=="string"||!e)return"";try{const t=new URL(e),r=`/api/v4/answers/${n}/comments`,i=`/answers/${n}/comments`;if(t.protocol!=="https:"||t.username||t.password||t.port)return"";if(t.hostname==="www.zhihu.com"&&t.pathname===r)return t.toString();if(t.hostname==="api.zhihu.com"&&t.pathname===i)return`https://www.zhihu.com${r}${t.search}`}catch{return""}return""}function y(e,{answerId:n,questionId:t,topLevelLimit:r,repliesLimit:i}){const a=[];let w=0,l=0,u=0,f=!1,h=0;for(const s of e){if(!s||typeof s!=="object"||Array.isArray(s)){h+=1;continue}const o=H(s.id);if(!o){h+=1;continue}const d=R(s.author),p=R(s.reply_to_author),m=Boolean(p);if(!m){if(w>=r){f=!0;break}w+=1;l=w;u=0}else if(!l||u>=i)continue;else u+=1;a.push({rank:a.length+1,comment_rank:l,reply_rank:m?u:0,depth:0,id:o,parent_id:"",author:d||"anonymous",reply_to:p,likes:k(s.vote_count),created_at:v(s.created_time),url:P(s.url,t,n,o),content:E(s.content||"")})}return{rows:a,topLevelCount:w,reachedTopLevelLimit:f,malformedComments:h}}const z=1000,S=100,O=20;L({site:"zhihu",name:"answer-comments",access:"read",description:"知乎回答评论列表",domain:"www.zhihu.com",strategy:N.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Answer ID, full Zhihu answer URL, or typed target (answer:<qid>:<aid>)"},{name:"limit",type:"int",default:20,help:"Number of top-level comments (max 1000)"},{name:"replies-limit",type:"int",default:3,help:"Number of replies to include per top-level comment (max 100)"}],columns:["rank","comment_rank","reply_rank","depth","id","parent_id","author","reply_to","likes","created_at","url","content"],func:async(e,n)=>{const t=b(n.id);if(!t)throw new g("Answer ID must be a numeric id, a Zhihu answer URL, or answer:<qid>:<aid>","Example: ppcli zhihu answer-comments 1937205528846655537");const r=Number(n.limit??20);if(!Number.isInteger(r)||r<=0||r>z)throw new g(`--limit must be a positive integer no greater than ${z}`);const i=Number(n["replies-limit"]??3);if(!Number.isInteger(i)||i<0||i>S)throw new g(`--replies-limit must be an integer between 0 and ${S}`);const{answerId:a}=t;try{await e.goto(`https://www.zhihu.com/answer/${a}`)}catch(o){throw new c(`Failed to open Zhihu answer ${a}: ${o instanceof Error?o.message:String(o)}`,"Open the answer URL in Chrome and retry after the page is reachable.")}const w=e.getCurrentUrl?x(await e.getCurrentUrl().catch(()=>"")):"",l=t.questionId||w;let u=`https://www.zhihu.com/api/v4/answers/${a}/comments?order=normal&limit=${O}&offset=0&status=open`;const f=[],h=new Set;while(u&&!h.has(u)){h.add(u);const o=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
const r = await fetch(${JSON.stringify(u)}, { credentials: 'include' });
|
|
4
4
|
if (!r.ok) return { __httpError: r.status };
|
|
@@ -8,4 +8,4 @@ import{cli as S,Strategy as L}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
8
8
|
return { __malformedJson: error instanceof Error ? error.message : String(error) };
|
|
9
9
|
}
|
|
10
10
|
})()
|
|
11
|
-
`).catch((m)=>{throw new c(`Zhihu answer comments request failed: ${m instanceof Error?m.message:String(m)}`,"Try again later or rerun with -v for more detail.")});if(!o||o.__httpError){const m=o?.__httpError;if(m===401||m===403)throw new
|
|
11
|
+
`).catch((m)=>{throw new c(`Zhihu answer comments request failed: ${m instanceof Error?m.message:String(m)}`,"Try again later or rerun with -v for more detail.")});if(!o||o.__httpError){const m=o?.__httpError;if(m===401||m===403)throw new T("www.zhihu.com","Failed to fetch Zhihu answer comments");if(m===404)throw new _("zhihu answer-comments",`No Zhihu answer comments resource was found for ${a}.`);throw new c(m?`Zhihu answer comments request failed (HTTP ${m})`:"Zhihu answer comments request failed","Try again later or rerun with -v for more detail")}if(o.__malformedJson)throw new c(`Zhihu answer comments returned malformed JSON: ${o.__malformedJson}`,"Try again later or rerun with -v for more detail");if(!Array.isArray(o.data)||!o.paging||typeof o.paging!=="object")throw new c("Zhihu answer comments returned a malformed payload","Try again later or rerun with -v for more detail");f.push(...o.data);const d=y(f,{answerId:a,questionId:l,topLevelLimit:r,repliesLimit:i});if(d.malformedComments>0)throw new c("Zhihu answer comments contained rows without comment ids");if(d.reachedTopLevelLimit||o.paging?.is_end){if(d.rows.length===0)throw new _("zhihu answer-comments",`No comments found for answer ${a}.`);return d.rows}const p=A(o.paging?.next,a);if(!p)throw new c("Zhihu answer comments pagination returned malformed next URL");if(h.has(p))throw new c("Zhihu answer comments pagination returned a repeated next URL");u=p}const s=y(f,{answerId:a,questionId:l,topLevelLimit:r,repliesLimit:i});if(s.malformedComments>0)throw new c("Zhihu answer comments contained rows without comment ids");if(s.rows.length===0)throw new _("zhihu answer-comments",`No comments found for answer ${a}.`);return s.rows}});export const __test__={stripHtml:E,parseAnswerTarget:b,normalizeCommentsApiUrl:A,buildRows:y};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as q,Strategy as A}from"@jackwener/opencli/registry";import{ArgumentError as l,AuthRequiredError as R,CommandExecutionError as s,EmptyResultError as S}from"@jackwener/opencli/errors";import{stripHtml as T}from"./text.js";function p(t){return T(t,{preserveBlocks:!0})}const z=/^\d+$/,x=/^answer:(\d+):(\d+)$/,f=/^\/question\/(\d+)\/answer\/(\d+)\/?$/,N=/^\/answer\/(\d+)\/?$/,v=/^\/question\/(\d+)\/?$/,U=/^\/api\/v4\/questions\/(\d+)\/?$/;function d(t){const a=String(t??"").trim();if(!a)return null;if(z.test(a))return{answerId:a,questionId:""};const n=a.match(x);if(n)return{questionId:n[1],answerId:n[2]};try{const r=new URL(a);if(r.protocol!=="https:"||r.username||r.password||r.port||r.hostname!=="www.zhihu.com"&&r.hostname!=="zhihu.com")return null;let i=r.pathname.match(f);if(i)return{questionId:i[1],answerId:i[2]};i=r.pathname.match(N);if(i)return{answerId:i[1],questionId:""}}catch{return null}return null}function Z(t){return d(t)?.answerId??null}function w(t){const a=String(t??"").trim();if(!a)return"";try{const n=new URL(a);if(n.protocol!=="https:"||n.hostname!=="www.zhihu.com"&&n.hostname!=="zhihu.com")return"";return n.pathname.match(f)?.[1]||n.pathname.match(v)?.[1]||n.pathname.match(U)?.[1]||""}catch{return""}}function _(t){return Number.isInteger(t)&&t>=0?t:0}function g(t){return typeof t==="number"&&Number.isFinite(t)&&t>0?new Date(t*1000).toISOString():""}q({site:"zhihu",name:"answer-detail",access:"read",description:"知乎单个回答完整内容(按 answer ID 获取)",domain:"www.zhihu.com",strategy:A.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Answer ID, full Zhihu answer URL, or typed target (answer:<qid>:<aid>)"},{name:"max-content",type:"int",default:0,help:"Optional cap on stripped content length in characters (0 = no truncation, return the full answer)"}],columns:["id","author","votes","comments","question_id","question_title","url","created_at","updated_at","content"],func:async(t,a)=>{const n=d(a.id);if(!n)throw new l("Answer ID must be a numeric id, a Zhihu answer URL, or answer:<qid>:<aid>","Example: ppcli zhihu answer-detail 1937205528846655537");const{answerId:r}=n,i=a["max-content"],u=i==null?0:Number(i);if(!Number.isInteger(u)||u<0)throw new l("--max-content must be a non-negative integer (0 = no cap, full content)","Example: --max-content 2000");try{await t.goto(`https://www.zhihu.com/answer/${r}`)}catch(o){throw new s(`Failed to open Zhihu answer ${r}: ${o instanceof Error?o.message:String(o)}`,"Open the answer URL in Chrome and retry after the page is reachable.")}const y=t.getCurrentUrl?w(await t.getCurrentUrl().catch(()=>"")):"",E=`https://www.zhihu.com/api/v4/answers/${r}?include=content,voteup_count,comment_count,author,created_time,updated_time,question`,e=await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const r = await fetch(${JSON.stringify(
|
|
3
|
+
const r = await fetch(${JSON.stringify(E)}, { credentials: 'include' });
|
|
4
4
|
if (!r.ok) return { __httpError: r.status };
|
|
5
5
|
try {
|
|
6
6
|
return await r.json();
|
|
@@ -8,4 +8,4 @@ import{cli as y,Strategy as N}from"@jackwener/opencli/registry";import{ArgumentE
|
|
|
8
8
|
return { __malformedJson: error instanceof Error ? error.message : String(error) };
|
|
9
9
|
}
|
|
10
10
|
})()
|
|
11
|
-
`).catch((
|
|
11
|
+
`).catch((o)=>{throw new s(`Zhihu answer detail request failed: ${o instanceof Error?o.message:String(o)}`,"Try again later or rerun with -v for more detail.")});if(!e||e.__httpError){const o=e?.__httpError;if(o===401||o===403)throw new R("www.zhihu.com","Failed to fetch Zhihu answer detail");if(o===404)throw new S("zhihu answer-detail",`No Zhihu answer was found for ${r}.`);throw new s(o?`Zhihu answer detail request failed (HTTP ${o})`:"Zhihu answer detail request failed","Try again later or rerun with -v for more detail")}if(e.__malformedJson)throw new s(`Zhihu answer detail returned malformed JSON: ${e.__malformedJson}`,"Try again later or rerun with -v for more detail");if(typeof e!=="object"||Array.isArray(e))throw new s("Zhihu answer detail returned a malformed payload","Try again later or rerun with -v for more detail");if(e.error||e.error_msg||e.message)throw new s(`Zhihu answer detail returned an error payload: ${e.error?.message||e.error_msg||e.message}`,"Try again later or rerun with -v for more detail");if(!Object.prototype.hasOwnProperty.call(e,"content"))throw new s("Zhihu answer detail payload did not include answer content","Try again later or rerun with -v for more detail");const c=e.question||{},h=n.questionId||y||w(c.url)||(c.id==null?"":String(c.id)),m=p(e.content||""),I=u>0&&m.length>u?m.substring(0,u):m;return[{id:r,author:e.author?.name||"anonymous",votes:_(e.voteup_count),comments:_(e.comment_count),question_id:h,question_title:c.title||"",url:h?`https://www.zhihu.com/question/${h}/answer/${r}`:`https://www.zhihu.com/answer/${r}`,created_at:g(e.created_time),updated_at:g(e.updated_time),content:I}]}});export const __test__={stripHtml:p,extractAnswerId:Z,parseAnswerTarget:d,extractQuestionIdFromAnswerUrl:w};
|
package/clis/zhihu/answer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CommandExecutionError as
|
|
1
|
+
import{CommandExecutionError as m}from"@jackwener/opencli/errors";import{cli as d,Strategy as h}from"@jackwener/opencli/registry";import{publishArticle as c}from"../_shared/article/publish.js";import{zhihuImageProfile as p}from"./image-profile.js";import{assertAllowedKinds as w,parseTarget as g}from"./target.js";import{buildResultRow as f,requireExecute as y,resolveCurrentUserIdentity as b,resolvePayload as q}from"./write-shared.js";function T(i){return{home:i,originRe:"https?://(www\\.)?zhihu\\.com",outputFormat:"html",preprocessConfig:{removeSpecialTags:!0,removeSpecialTagsWithParent:!0,processCodeBlocks:!0,convertSectionToDiv:!0,removeTrailingBr:!0,unwrapSingleChildContainers:!0,unwrapNestedFigures:!0,compactHtml:!0,removeEmptyLines:!0,removeEmptyDivs:!0,removeNestedEmptyContainers:!0},image:p,publish:async(r,u)=>{const s=r.content.replace(/<img([^>]+?)\/?>/gi,"<figure><img$1></figure>"),o=r.params&&r.params.questionId;if(!o)return{ok:!1,stage:"publish",message:"缺少 questionId"};const t=await fetch("https://www.zhihu.com/api/v4/questions/"+o+"/answers",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:s,reshipment_settings:"disallowed"})}),n=await t.text();let e=null;try{e=JSON.parse(n)}catch(l){}if(!t.ok)return{ok:!1,stage:"publish",status:t.status,message:e&&e.error&&e.error.message||n.slice(0,300),detail:e};if(!e||!e.id)return{ok:!1,stage:"publish",status:t.status,message:"回答接口没有返回回答 id:"+n.slice(0,300)};const a=String(e.id);return{ok:!0,draft:!1,id:a,url:e.url||"https://www.zhihu.com/question/"+o+"/answer/"+a}}}}d({site:"zhihu",name:"answer",access:"write",description:"Answer a Zhihu question. Body is Markdown by default (paragraphs become <p>); pass --html for raw HTML. Images (including local file paths) are auto-rehosted to Zhihu.",domain:"www.zhihu.com",strategy:h.COOKIE,browser:!0,args:[{name:"target",positional:!0,required:!0,help:"Zhihu question URL (e.g. https://www.zhihu.com/question/461491497) or typed target question:461491497; bare numeric id is rejected"},{name:"text",positional:!0,help:"Answer body (Markdown by default; pass --html for raw HTML)"},{name:"file",help:"Answer body file path (UTF-8, Markdown by default)"},{name:"html",type:"boolean",help:"Treat body as raw HTML instead of Markdown"},{name:"execute",type:"boolean",help:"Actually perform the write action"}],columns:["status","outcome","message","target_type","target","created_target","created_url","author_identity"],func:async(i,r)=>{if(!i)throw new m("Browser session required for zhihu answer");y(r);const u=String(r.target),s=w("answer",g(u)),o=await q(r),t=await c(i,{title:"",body:o,format:r.html?"html":"markdown",profile:T(s.url),publishParams:{questionId:s.id}}),n=await b(i),e=t.images.uploaded.length|0,a=t.images.failed.length|0;let l=`Answered question ${s.id}`;if(e||a)l+=` · images: ${e} rehosted${a?`, ${a} failed`:""}`;return f(l,s.kind,u,"created",{created_target:"answer:"+s.id+":"+t.id,created_url:t.url,author_identity:n})}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function transformTables(
|
|
1
|
+
export function transformTables(l){let e=l.replace(/<figure[^>]*>\s*(<table[\s\S]*?<\/table>)\s*<\/figure>/gi,"$1");e=e.replace(/<table[^>]*>([\s\S]*?)<\/table>/gi,(d,a)=>{const r=a.match(/<thead[^>]*>([\s\S]*?)<\/thead>/i),s=a.match(/<tbody[^>]*>([\s\S]*?)<\/tbody>/i);let c="",t="";if(r)c=r[1].replace(/<td([^>]*)>/gi,"<th$1>").replace(/<\/td>/gi,"</th>");if(s)t=s[1];else t=a.replace(/<thead[^>]*>[\s\S]*?<\/thead>/gi,"").replace(/<\/?tbody[^>]*>/gi,"");if(!r){const i=t.match(/<tr[^>]*>([\s\S]*?)<\/tr>/i);if(i){const o=i[1];if(/<th[^>]*>/i.test(o)&&!/<td[^>]*>/i.test(o)){c=i[0];t=t.replace(i[0],"")}}}return`<table data-draft-node="block" data-draft-type="table" data-size="normal" data-row-style="normal"><tbody>${c}${t}</tbody></table>`});return e}export function transformZhihuHtml(l){let e=l;e=transformTables(e);e=e.replace(/<img([^>]+)src="([^"]+)"([^>]*?)\/?>/gi,(d,a,r,s)=>`<figure><img${a}src="${r}"${s}></figure>`);e=e.replace(/<figure>\s*(<figure>[\s\S]*?<\/figure>)\s*<\/figure>/gi,"$1");e=e.replace(/<pre><code class="language-(\w+)">/gi,'<pre lang="$1"><code>');e=e.replace(/\s*data-(?!draft)[a-z-]+="[^"]*"/gi,"");e=e.replace(/\s*style="[^"]*"/gi,"");return e}export const __test__={transformTables,transformZhihuHtml};
|
package/clis/zhihu/article.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as y,CommandExecutionError as b}from"@jackwener/opencli/errors";import{cli as v,Strategy as w}from"@jackwener/opencli/registry";import{buildResultRow as x,requireExecute as z,resolvePayload as T}from"./write-shared.js";import{publishArticle as S}from"../_shared/article/publish.js";import{zhihuImageProfile as C}from"./image-profile.js";export const zhihuProfile={home:"https://zhuanlan.zhihu.com",outputFormat:"html",preprocessConfig:{removeSpecialTags:!0,removeSpecialTagsWithParent:!0,processCodeBlocks:!0,convertSectionToDiv:!0,removeTrailingBr:!0,unwrapSingleChildContainers:!0,unwrapNestedFigures:!0,compactHtml:!0,removeEmptyLines:!0,removeEmptyDivs:!0,removeNestedEmptyContainers:!0},image:C,publish:async(e,r)=>{let s=e.content;s=s.replace(/<img([^>]+?)\/?>/gi,"<figure><img$1></figure>");const i=e.params&&typeof e.params.cover==="string"?e.params.cover.trim():"";if(i&&i.indexOf("zhimg.com")===-1)return{ok:!1,stage:"cover",message:"题图必须是知乎图床(zhimg.com)地址,转存未生效:"+i.slice(0,120)};const l={"Content-Type":"application/json","x-requested-with":"fetch","x-xsrftoken":r.xsrf()},t="https://zhuanlan.zhihu.com/api/articles",n=await fetch(t+"/drafts",{method:"POST",credentials:"include",headers:l,body:JSON.stringify({title:e.title})}),c=await n.text();let o=null;try{o=JSON.parse(c)}catch(f){}if(!n.ok||!o||!o.id)return{ok:!1,stage:"create",status:n.status,message:c.slice(0,300)};const a=String(o.id),u={title:e.title,content:s,table_of_contents:!1,delta_time:30};if(i){u.titleImage=i;u.isTitleImageFullScreen=!1}const m=await fetch(t+"/"+a+"/draft",{method:"PATCH",credentials:"include",headers:l,body:JSON.stringify(u)});if(!m.ok){const f=await m.text();return{ok:!1,stage:"update",status:m.status,message:f.slice(0,300),id:a}}if(e.draftOnly)return{ok:!0,draft:!0,id:a,url:"https://zhuanlan.zhihu.com/p/"+a+"/edit"};const h=await fetch(t+"/"+a+"/publish",{method:"PUT",credentials:"include",headers:l,body:JSON.stringify({})}),g=await h.text();let d=null;try{d=JSON.parse(g)}catch(f){}if(!h.ok)return{ok:!1,stage:"publish",status:h.status,message:g.slice(0,300),id:a};return{ok:!0,draft:!1,id:a,url:d&&d.url||"https://zhuanlan.zhihu.com/p/"+a}}};v({site:"zhihu",name:"article",access:"write",description:"Publish a Zhihu article (文章/专栏). Body is Markdown by default; images (incl. local paths) and --cover are auto-rehosted to Zhihu.",domain:"zhuanlan.zhihu.com",strategy:w.COOKIE,browser:!0,args:[{name:"title",positional:!0,required:!0,help:"Article title"},{name:"text",positional:!0,help:"Article body (Markdown by default; pass --html for raw HTML)"},{name:"file",help:"Article body file path (UTF-8, Markdown by default)"},{name:"html",type:"boolean",help:"Treat body as raw HTML instead of Markdown"},{name:"cover",help:"Cover image (题图): local file path or image URL; auto-rehosted to Zhihu (zhimg.com)"},{name:"draft",type:"boolean",help:"Save as draft only; do not publish"},{name:"execute",type:"boolean",help:"Actually create/publish. Without it the command refuses to write."}],columns:["status","outcome","message","target_type","target","created_target","created_url"],func:async(e,r)=>{if(!e)throw new b("Browser session required for zhihu article");z(r);const s=String(r.title??"").trim();if(!s)throw new y("INVALID_INPUT","Article title cannot be empty");const i=await T(r),p=Boolean(r.draft),l=typeof r.cover==="string"?r.cover.trim():"",t=await S(e,{title:s,body:i,format:r.html?"html":"markdown",draftOnly:p,profile:zhihuProfile,publishParams:l?{cover:l}:null}),n=t.images.uploaded.length|0,c=t.images.failed.length|0;let o=t.draft?"Saved article draft":"Published article";if(n||c)o+=` · images: ${n} rehosted${c?`, ${c} failed`:""}`;return x(o,"article","",t.draft?"draft":"created",{created_target:"article:"+t.id,created_url:t.url})}});
|
package/clis/zhihu/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AuthRequiredError as
|
|
1
|
+
import{AuthRequiredError as r,CommandExecutionError as e}from"@jackwener/opencli/errors";import{registerSiteAuthCommands as w}from"../_shared/site-auth.js";async function n(i){return(await i.getCookies({url:"https://www.zhihu.com"})).some((o)=>o.name==="z_c0"&&o.value)}async function h(i){await i.goto("https://www.zhihu.com/");await i.wait(2);return i.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
try {
|
|
4
4
|
const r = await fetch('https://www.zhihu.com/api/v4/me?include=url_token', { credentials: 'include' });
|
|
@@ -8,4 +8,4 @@ import{AuthRequiredError as F,CommandExecutionError as H}from"@jackwener/opencli
|
|
|
8
8
|
return { __exception: String(e && e.message || e) };
|
|
9
9
|
}
|
|
10
10
|
})()
|
|
11
|
-
`)}async function
|
|
11
|
+
`)}async function u(i){if(!await n(i))throw new r("www.zhihu.com","Zhihu z_c0 cookie missing — anonymous");let t=await h(i);if(t&&(t.__httpError===401||t.__httpError===403)){await i.wait(2);t=await h(i)}if(t?.__exception)throw new e(`Zhihu whoami failed: ${t.__exception}`);if(!t||t.__httpError){const o=t?.__httpError;if(o===401||o===403)throw new r("www.zhihu.com",`Zhihu /api/v4/me returned HTTP ${o} — anonymous`);throw new e(`Zhihu identity probe failed (HTTP ${o??"unknown"})`)}if(!t.url_token)throw new r("www.zhihu.com","Zhihu /api/v4/me returned no url_token — anonymous session");return{url_token:String(t.url_token),name:String(t.name??""),uid:String(t.uid??t.id??"")}}w({site:"zhihu",domain:"www.zhihu.com",loginUrl:"https://www.zhihu.com/signin",columns:["url_token","name","uid"],quickCheck:n,verify:u,poll:async(i)=>{if(!await n(i))throw new r("www.zhihu.com","Waiting for Zhihu z_c0 cookie");return u(i)}});
|
package/clis/zhihu/collection.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as C,Strategy as R}from"@jackwener/opencli/registry";import{ArgumentError as z,AuthRequiredError as S,CommandExecutionError as v,EmptyResultError as M}from"@jackwener/opencli/errors";import{log as E}from"@jackwener/opencli/logger";import{stripHtml as f}from"./text.js";function N(r,n){const t=Number(r);if(!Number.isInteger(t)||t<=0)throw new z(`zhihu collection --${n} must be a positive integer`,"Example: ppcli zhihu collection 83283292 --limit 20");return t}function k(r,n){const t=Number(r);if(!Number.isInteger(t)||t<0)throw new z(`zhihu collection --${n} must be a non-negative integer`,"Example: ppcli zhihu collection 83283292 --offset 0");return t}async function U(r,n,t,s){const c=`https://www.zhihu.com/api/v4/collections/${n}/items?offset=${t}&limit=${s}`,i=await r.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const r = await fetch(${JSON.stringify(
|
|
3
|
+
const r = await fetch(${JSON.stringify(c)}, { credentials: 'include' });
|
|
4
4
|
if (!r.ok) return { __httpError: r.status };
|
|
5
5
|
return await r.json();
|
|
6
6
|
})()
|
|
7
|
-
`);if(!
|
|
7
|
+
`);if(!i||i.__httpError){const e=i?.__httpError;if(e===401||e===403)throw new S("www.zhihu.com","Failed to fetch collection data from Zhihu. Please ensure you are logged in.");throw new v(e?`Zhihu collection request failed (HTTP ${e})`:"Zhihu collection request failed","Try again later or rerun with -v for more detail")}return i}function I(r){const n=r?.content||{};return`${n.type||""}:${n.id||n.url||JSON.stringify(n).slice(0,80)}`}function q(r,n){const t=r.content||{},s=t.type||"";if(!["answer","article","pin"].includes(s))throw new v(`Zhihu collection returned unsupported content type: ${s||"missing"}`,"Collection items require a supported content.type so the row identity, title, and URL are not silently blank.");let c="",i="",e="",l="",a=0;if(s==="answer"){const o=t.question||{};c=o.title||"";i=f(t.content||"").substring(0,150);e=t.url||`https://www.zhihu.com/question/${o.id}/answer/${t.id}`;l=t.author?.name||"匿名用户";a=t.voteup_count||0}else if(s==="article"){c=t.title||"";i=f(t.content||"").substring(0,150);e=t.url||`https://zhuanlan.zhihu.com/p/${t.id}`;l=t.author?.name||"匿名用户";a=t.voteup_count||0}else if(s==="pin"){c="想法";i=f((t.content||[]).map((o)=>o.content||"").join(" ")).substring(0,150);e=t.url||`https://www.zhihu.com/pin/${t.id}`;l=t.author?.name||"匿名用户";a=t.reaction_count||0}if(!String(c||"").trim()||!String(e||"").trim()||e.includes("undefined"))throw new v("Zhihu collection returned a malformed item without title or URL identity","Collection item rows require type, title, and URL so malformed payloads do not become blank listing rows.");return{rank:n,type:s,title:f(c).substring(0,100),author:l,votes:a,excerpt:i,url:e}}C({site:"zhihu",name:"collection",access:"read",description:"知乎收藏夹内容列表(需要登录)",domain:"www.zhihu.com",strategy:R.COOKIE,browser:!0,args:[{name:"id",positional:!0,required:!0,help:"收藏夹 ID (数字,可从收藏夹 URL 中获取)"},{name:"offset",type:"int",default:0,help:"起始偏移量(用于分页)"},{name:"limit",type:"int",default:20,help:"每页数量(最大 20)"}],columns:["rank","type","title","author","votes","excerpt","url"],func:async(r,n)=>{const{id:t,offset:s=0,limit:c=20}=n,i=String(t);if(!/^\d+$/.test(i))throw new z("Collection ID must be numeric","Example: ppcli zhihu collection 83283292");const e=k(s,"offset"),l=N(c,"limit"),a=Math.min(l,20);await r.goto("https://www.zhihu.com");const o=[],_=new Set;let u=0,h=e;const L=Math.ceil(l/a)+2;for(let p=0;p<L&&o.length<l;p+=1){const d=Math.min(a,l-o.length),b=await U(r,i,h,d),w=Array.isArray(b.data)?b.data:[],g=b.paging||{};u=Number(g.totals||u||0);for(const y of w){const m=I(y);if(!_.has(m)){_.add(m);o.push(y)}if(o.length>=l)break}if(w.length===0||g.is_end||o.length>=l)break;if(typeof g.next==="string")try{const y=new URL(g.next),m=Number(y.searchParams.get("offset"));if(Number.isInteger(m)&&m>h){h=m;continue}}catch{}if(w.length<d)break;const x=h+w.length;if(x<=h)break;h=x;if(u&&h>=u)break}const O=Math.ceil(u/a),P=Math.floor(e/a)+1;if(u>0){E.info(`收藏夹共有 ${u} 条内容,共 ${O} 页`);E.info(`当前第 ${P} 页,显示第 ${e+1} - ${Math.min(e+o.length,u)} 条`)}if(o.length===0)throw new M("zhihu collection",`No items found for collection ${i}. The collection may be empty, private, or the offset may be out of range.`);return o.slice(0,l).map((p,d)=>q(p,e+d+1))}});export const __test__={stripHtml:f,validatePositiveInt:N,validateNonNegativeInt:k,itemKey:I,mapCollectionItem:q};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as x,Strategy as N}from"@jackwener/opencli/registry";import{ArgumentError as P,AuthRequiredError as Z,CommandExecutionError as y,EmptyResultError as I}from"@jackwener/opencli/errors";import{log as O}from"@jackwener/opencli/logger";function k(e,c){const i=Number(e);if(!Number.isInteger(i)||i<=0)throw new P(`zhihu collections --${c} must be a positive integer`,"Example: ppcli zhihu collections --limit 20");return i}async function b(e,c,i){const t=await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const r = await fetch(${JSON.stringify(
|
|
3
|
+
const r = await fetch(${JSON.stringify(c)}, { credentials: 'include' });
|
|
4
4
|
if (!r.ok) return { __httpError: r.status };
|
|
5
5
|
return await r.json();
|
|
6
6
|
})()
|
|
7
|
-
`);if(!
|
|
7
|
+
`);if(!t||t.__httpError){const l=t?.__httpError;if(l===401||l===403)throw new Z("www.zhihu.com",`${i} from Zhihu failed. Please ensure you are logged in.`);throw new y(l?`${i} from Zhihu failed (HTTP ${l})`:`${i} from Zhihu failed`,"Try again later or rerun with -v for more detail")}return t}function E(e){return String(e?.id||e?.url||e?.title||"")}x({site:"zhihu",name:"collections",access:"read",description:"知乎收藏夹列表(需要登录)",domain:"www.zhihu.com",strategy:N.COOKIE,browser:!0,args:[{name:"limit",type:"int",default:20,help:"每页数量(最大 20)"}],columns:["rank","title","item_count","description","collection_id"],func:async(e,c)=>{const{limit:i=20}=c,t=k(i,"limit");await e.goto("https://www.zhihu.com");const w=(await b(e,"https://www.zhihu.com/api/v4/me?include=url_token","Zhihu user info request")).url_token;if(!w)throw new y("Failed to get user url_token from Zhihu","Please ensure you are logged in.");const o=[],g=new Set;let s=0,r=0;const p=Math.min(t,20),v=Math.ceil(t/p)+2;for(let n=0;n<v&&o.length<t;n+=1){const u=Math.min(p,t-o.length),z=`https://www.zhihu.com/api/v4/people/${w}/collections?include=data%5B*%5D.updated_time&offset=${r}&limit=${u}`,d=await b(e,z,"Zhihu favorite collections request"),h=Array.isArray(d.data)?d.data:[],f=d.paging||{};s=Number(f.totals||s||0);for(const m of h){const a=E(m);if(a&&!g.has(a)){g.add(a);o.push(m)}if(o.length>=t)break}if(h.length===0||f.is_end||o.length>=t)break;if(typeof f.next==="string")try{const m=new URL(f.next),a=Number(m.searchParams.get("offset"));if(Number.isInteger(a)&&a>r){r=a;continue}}catch{}if(h.length<u)break;const _=r+h.length;if(_<=r)break;r=_;if(s&&r>=s)break}if(s>0)O.info(`共有 ${s} 个收藏夹`);if(o.length===0)throw new I("zhihu collections","No favorite collections were returned for the logged-in user.");return o.slice(0,t).map((n,u)=>({rank:u+1,title:n.title||"未命名",item_count:n.item_count??n.answer_count??0,description:n.description||"",collection_id:String(n.id||"")}))}});export const __test__={validatePositiveInt:k,collectionKey:E};
|
package/clis/zhihu/download.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as o,Strategy as n}from"@jackwener/opencli/registry";import{downloadArticle as r}from"@jackwener/opencli/download/article-download";o({site:"zhihu",name:"download",access:"read",description:"导出知乎文章为 Markdown 格式",domain:"zhuanlan.zhihu.com",strategy:n.COOKIE,args:[{name:"url",required:!0,help:"Article URL (zhuanlan.zhihu.com/p/xxx)"},{name:"output",default:"./zhihu-articles",help:"Output directory"},{name:"download-images",type:"boolean",default:!1,help:"Download images locally"}],columns:["title","author","publish_time","status","size"],func:async(e,l)=>{const i=l.url;await e.goto(i);await e.wait(3);const t=await e.evaluate(`
|
|
2
2
|
(() => {
|
|
3
3
|
const result = {
|
|
4
4
|
title: '',
|
|
@@ -36,4 +36,4 @@ import{cli as q,Strategy as v}from"@jackwener/opencli/registry";import{downloadA
|
|
|
36
36
|
|
|
37
37
|
return result;
|
|
38
38
|
})()
|
|
39
|
-
`);return
|
|
39
|
+
`);return r({title:t?.title||"",author:t?.author,publishTime:t?.publishTime,sourceUrl:i,contentHtml:t?.contentHtml||"",imageUrls:t?.imageUrls},{output:l.output,downloadImages:l["download-images"],imageHeaders:{Referer:"https://zhuanlan.zhihu.com/"}})}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const zhihuImageProfile={skip:["zhimg.com"],uploadFn:async(
|
|
2
|
-
`),
|
|
1
|
+
export const zhihuImageProfile={skip:["zhimg.com"],uploadFn:async(n,c)=>{if(n.indexOf("data:")!==0){const e=await fetch("https://zhuanlan.zhihu.com/api/uploaded_images",{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded","x-requested-with":"fetch","x-xsrftoken":c.xsrf()},body:new URLSearchParams({url:n,source:"article"})}),p=await e.text();let t=null;try{t=JSON.parse(p)}catch(y){}if(!e.ok||!t||!t.src)throw Error("URL 转存失败: HTTP "+e.status+" "+p.slice(0,150));return{url:t.src}}const i=c.dataUriToBlob(n),f=await i.arrayBuffer(),g=c.md5(f),r=await fetch("https://api.zhihu.com/images",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-requested-with":"fetch"},body:JSON.stringify({image_hash:g,source:"article"})}),h=await r.text();let o=null;try{o=JSON.parse(h)}catch(e){}if(!r.ok||!o||!o.upload_file)throw Error("获取上传凭证失败: HTTP "+r.status+" "+h.slice(0,150));const a=o.upload_file;if(a.state===1){for(let e=0;e<10;e++){const t=await(await fetch("https://api.zhihu.com/images/"+a.image_id,{credentials:"include",headers:{"x-requested-with":"fetch"}})).json();if(t&&(t.status==="completed"||t.original_hash))return{url:"https://pic4.zhimg.com/"+t.original_hash};await new Promise((y)=>setTimeout(y,1000))}throw Error("图片处理超时(image_id="+a.image_id+")")}const s=o.upload_token;if(!s||!s.access_id||!s.access_key||!s.access_token)throw Error("上传凭证响应无效: "+h.slice(0,150));const m=i.type||"application/octet-stream",d=new Date().toUTCString(),w={"x-oss-date":d,"x-oss-security-token":s.access_token,"x-oss-user-agent":"aliyun-sdk-js/6.8.0"},k=Object.keys(w).sort().map((e)=>e+":"+w[e]).join(`
|
|
2
|
+
`),x=`PUT
|
|
3
3
|
|
|
4
|
-
`+
|
|
5
|
-
`+
|
|
6
|
-
`+
|
|
7
|
-
/zhihu-pics/`+
|
|
4
|
+
`+m+`
|
|
5
|
+
`+d+`
|
|
6
|
+
`+k+`
|
|
7
|
+
/zhihu-pics/`+a.object_key,T=new TextEncoder().encode(s.access_key),_=await crypto.subtle.importKey("raw",T,{name:"HMAC",hash:"SHA-1"},!1,["sign"]),S=await crypto.subtle.sign("HMAC",_,new TextEncoder().encode(x)),b=btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(S)))),l=await fetch("https://zhihu-pics-upload.zhimg.com/"+a.object_key,{method:"PUT",headers:{"Content-Type":m,Authorization:"OSS "+s.access_id+":"+b,"x-oss-date":d,"x-oss-security-token":s.access_token,"x-oss-user-agent":"aliyun-sdk-js/6.8.0"},body:i});if(!l.ok){const e=await l.text();throw Error("OSS 上传失败: HTTP "+l.status+" "+e.slice(0,150))}let u=a.object_key;if(i.type==="image/gif")u=u+".gif";return{url:"https://pic4.zhimg.com/"+u}}};
|
package/clis/zhihu/paginate.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ArgumentError as
|
|
1
|
+
import{ArgumentError as c,AuthRequiredError as d,CommandExecutionError as o,EmptyResultError as f}from"@jackwener/opencli/errors";export const MAX_LIMIT=1000;export function validateLimit(e,t=20){const n=e??t;let r;if(typeof n==="number")r=n;else{const i=String(n).trim();if(!/^\d+$/.test(i))throw new c(`--limit must be a positive integer no greater than ${MAX_LIMIT}`,"Use a normal-sized decimal integer limit to avoid slow requests or Zhihu risk controls");r=Number(i)}if(!Number.isInteger(r)||r<=0||r>MAX_LIMIT)throw new c(`--limit must be a positive integer no greater than ${MAX_LIMIT}`,"Use a normal-sized decimal integer limit to avoid slow requests or Zhihu risk controls");return r}export function unwrapEvaluateResult(e){if(e&&typeof e==="object"&&"data"in e&&"session"in e)return e.data;return e}export function requireZhihuListPayload(e,t,n){const r=unwrapEvaluateResult(e);if(!r||typeof r!=="object"||Array.isArray(r))throw new o(`Zhihu ${t} returned malformed payload`,`URL: ${n}`);if(r.__httpError){const i=r.__httpError;if(i===401||i===403)throw new d("www.zhihu.com",`Failed to fetch Zhihu ${t}`);if(i===404)throw new f(`zhihu ${t}`,"Check the target identifier");throw new o(`Zhihu ${t} request failed${i?` (HTTP ${i})`:""}`,"Try again later or rerun with -v")}if(r.__fetchError)throw new o(`Zhihu ${t} request failed`,String(r.__fetchError));if(!Array.isArray(r.data))throw new o(`Zhihu ${t} returned malformed data list`,`URL: ${n}`);if(!r.paging||typeof r.paging!=="object")throw new o(`Zhihu ${t} returned malformed paging data`,`URL: ${n}`);return r}function m(e){if(typeof e!=="string"||!e)return"";try{const t=new URL(e);if(t.protocol!=="https:"&&t.protocol!=="http:")return"";t.protocol="https:";if(t.hostname==="api.zhihu.com"&&t.pathname.startsWith("/members/"))return`https://www.zhihu.com/api/v4${t.pathname}${t.search}`;if(t.hostname==="www.zhihu.com"&&t.pathname.startsWith("/api/v4/members/"))return t.toString()}catch{return""}return""}function w(e,t){try{return new URL(e).pathname===new URL(t).pathname}catch{return!1}}export async function fetchZhihuList(e,t,n,r){const i=[],s=new Set;let h=t;while(h&&i.length<n&&!s.has(h)){s.add(h);const u=requireZhihuListPayload(await e.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
3
|
try {
|
|
4
|
-
const r = await fetch(${JSON.stringify(
|
|
4
|
+
const r = await fetch(${JSON.stringify(h)}, { credentials: 'include' });
|
|
5
5
|
if (!r.ok) return { __httpError: r.status };
|
|
6
6
|
return await r.json();
|
|
7
7
|
} catch (err) {
|
|
8
8
|
return { __fetchError: err?.message || String(err) };
|
|
9
9
|
}
|
|
10
10
|
})()
|
|
11
|
-
`),
|
|
11
|
+
`),r,h);for(const p of u.data){i.push(p);if(i.length>=n)break}if(i.length>=n)break;if(u.paging?.is_end)break;const a=m(u.paging?.next);if(!a||!w(a,t))throw new o(`Zhihu ${r} pagination returned malformed next URL`);if(s.has(a))throw new o(`Zhihu ${r} pagination returned a repeated next URL`);h=a}if(i.length===0)throw new f(`zhihu ${r}`,"No rows were returned for the requested Zhihu user.");return i}export const __test__={normalizeZhihuApiUrl:m,sameZhihuApiPath:w};
|
package/clis/zhihu/pin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{CliError as
|
|
2
|
-
`).map((
|
|
3
|
-
var html = ${JSON.stringify(
|
|
1
|
+
import{CliError as n,CommandExecutionError as u}from"@jackwener/opencli/errors";import{cli as c,Strategy as d}from"@jackwener/opencli/registry";import{buildResultRow as l,requireExecute as p,resolveCurrentUserIdentity as h,resolvePayload as m}from"./write-shared.js";c({site:"zhihu",name:"pin",access:"write",description:"Publish a Zhihu pin (想法/short post)",domain:"www.zhihu.com",strategy:d.COOKIE,browser:!0,args:[{name:"text",positional:!0,help:"Pin text content"},{name:"file",help:"Pin text file path (UTF-8)"},{name:"execute",type:"boolean",help:"Actually publish the pin. Without it the command refuses to write."}],columns:["status","outcome","message","target_type","target","created_target","created_url","author_identity"],func:async(t,a)=>{if(!t)throw new u("Browser session required for zhihu pin");p(a);const i=await m(a);await t.goto("https://www.zhihu.com");await t.wait(3);let r="";try{r=await h(t)}catch{}const s=i.split(`
|
|
2
|
+
`).map((o)=>`<p>${w(o)}</p>`).join(""),e=await t.evaluate(`(async () => {
|
|
3
|
+
var html = ${JSON.stringify(s)};
|
|
4
4
|
var xsrf = (document.cookie.match(/_xsrf=([^;]+)/) || [])[1] || '';
|
|
5
5
|
var body = new URLSearchParams();
|
|
6
6
|
body.set('content', JSON.stringify([{ type: 'text', content: html }]));
|
|
@@ -21,4 +21,4 @@ import{CliError as J,CommandExecutionError as K}from"@jackwener/opencli/errors";
|
|
|
21
21
|
if (!resp.ok) return { ok: false, status: resp.status, message: (data && data.error && data.error.message) || text.slice(0, 300) };
|
|
22
22
|
if (!data || !data.id) return { ok: false, status: resp.status, message: 'Pin API response did not include a created pin id: ' + text.slice(0, 300) };
|
|
23
23
|
return { ok: true, id: String(data.id), url: data.url || ('https://www.zhihu.com/pin/' + data.id) };
|
|
24
|
-
})()`);if(!
|
|
24
|
+
})()`);if(!e?.ok)throw new n("COMMAND_EXEC",e?.message||"Failed to publish pin");return l("Published pin","pin","","created",{created_target:"pin:"+e.id,created_url:e.url,author_identity:r})}});function w(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
package/clis/zhihu/question.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as g,Strategy as I}from"@jackwener/opencli/registry";import{AuthRequiredError as _,CliError as h}from"@jackwener/opencli/errors";import{stripHtml as q}from"./text.js";function y(t){if(typeof t!=="string")return"";try{const e=new URL(t);if(e.hostname!=="www.zhihu.com"&&e.hostname!=="zhihu.com")return"";return e.pathname.match(/^\/question\/\d+\/answer\/(\d+)\/?$/)?.[1]||e.pathname.match(/^\/api\/v4\/answers\/(\d+)\/?$/)?.[1]||e.pathname.match(/^\/answer\/(\d+)\/?$/)?.[1]||""}catch{return""}}function f(t){const e=y(t.url);if(e)return e;if(typeof t.id==="string"&&/^\d+$/.test(t.id))return t.id;if(typeof t.id==="number"&&Number.isSafeInteger(t.id)&&t.id>0)return String(t.id);return""}function E(t){const e=f(t);if(e)return`id:${e}`;return`fallback:${t.author?.name||"anonymous"}:${t.content||""}`}const m=1000;g({site:"zhihu",name:"question",access:"read",description:"知乎问题详情和回答",domain:"www.zhihu.com",strategy:I.COOKIE,args:[{name:"id",required:!0,positional:!0,help:"Question ID (numeric)"},{name:"limit",type:"int",default:5,help:"Number of answers (max 1000; use normal-sized requests)"},{name:"sort",default:"default",choices:["default","created"],help:"Answer order: default or created"}],columns:["rank","id","author","votes","url","content"],func:async(t,e)=>{const{id:l,limit:p=5}=e,i=String(l);if(!/^\d+$/.test(i))throw new h("INVALID_INPUT","Question ID must be numeric","Example: ppcli zhihu question 123456789");const s=Number(p);if(!Number.isInteger(s)||s<=0||s>m)throw new h("INVALID_INPUT",`Limit must be a positive integer no greater than ${m}`,"Use a normal-sized limit to avoid slow requests or Zhihu risk controls");const u=String(e.sort||"default");if(u!=="default"&&u!=="created")throw new h("INVALID_INPUT","Sort must be one of: default, created","Example: ppcli zhihu question 123456789 --sort created");await t.goto(u==="created"?`https://www.zhihu.com/question/${i}/answers/updated`:`https://www.zhihu.com/question/${i}`);let a=`https://www.zhihu.com/api/v4/questions/${i}/answers?limit=${20}&offset=0&sort_by=${u}&include=data[*].content,url,voteup_count,comment_count,author`;const c=[],d=new Set,w=new Set;while(a&&c.length<s&&!w.has(a)){w.add(a);const r=await t.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const r = await fetch(${JSON.stringify(
|
|
3
|
+
const r = await fetch(${JSON.stringify(a)}, { credentials: 'include' });
|
|
4
4
|
if (!r.ok) return { __httpError: r.status };
|
|
5
5
|
return await r.json();
|
|
6
6
|
})()
|
|
7
|
-
`);if(!
|
|
7
|
+
`);if(!r||r.__httpError){const n=r?.__httpError;if(n===401||n===403)throw new _("www.zhihu.com","Failed to fetch question data from Zhihu");throw new h("FETCH_ERROR",n?`Zhihu question answers request failed (HTTP ${n})`:"Zhihu question answers request failed","Try again later or rerun with -v for more detail")}for(const n of r.data||[]){const o=E(n);if(d.has(o))continue;d.add(o);c.push(n);if(c.length>=s)break}if(r.paging?.is_end)break;a=typeof r.paging?.next==="string"?r.paging.next:""}return c.map((r,n)=>{const o=f(r);return{rank:n+1,id:o,author:r.author?.name||"anonymous",votes:r.voteup_count||0,url:o?`https://www.zhihu.com/question/${i}/answer/${o}`:"",content:q(r.content||"").substring(0,200)}})}});
|
package/clis/zhihu/recommend.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as w,Strategy as p}from"@jackwener/opencli/registry";import{AuthRequiredError as f,CliError as m}from"@jackwener/opencli/errors";function g(s){const t=s.target||{},e=t.id==null?"":String(t.id);if(t.type==="answer"){const n=t.question?.id==null?"":String(t.question.id);return n&&e?`https://www.zhihu.com/question/${n}/answer/${e}`:""}if(t.type==="article")return e?`https://zhuanlan.zhihu.com/p/${e}`:"";if(t.type==="question")return e?`https://www.zhihu.com/question/${e}`:"";return""}function y(s){const t=s.target||{};if(t.type==="answer")return t.question?.title||"";return t.title||t.question?.title||""}const d=1000;w({site:"zhihu",name:"recommend",access:"read",description:"知乎首页推荐",domain:"www.zhihu.com",strategy:p.COOKIE,args:[{name:"limit",type:"int",default:20,help:"Number of items to return (max 1000; use normal-sized requests)"}],columns:["rank","type","title","author","votes","url"],func:async(s,t)=>{const e=Number(t.limit??20);if(!Number.isInteger(e)||e<=0||e>d)throw new m("INVALID_INPUT",`Limit must be a positive integer no greater than ${d}`,"Use a normal-sized limit to avoid slow requests or Zhihu risk controls");await s.goto("https://www.zhihu.com");let n="https://www.zhihu.com/api/v3/feed/topstory/recommend?limit=10&desktop=true";const u=[],l=new Set,h=new Set;while(n&&u.length<e&&!h.has(n)){h.add(n);const i=await s.evaluate(`
|
|
2
2
|
(async () => {
|
|
3
|
-
const r = await fetch(${JSON.stringify(
|
|
3
|
+
const r = await fetch(${JSON.stringify(n)}, { credentials: 'include' });
|
|
4
4
|
if (!r.ok) return { __httpError: r.status };
|
|
5
5
|
return await r.json();
|
|
6
6
|
})()
|
|
7
|
-
`);if(!
|
|
7
|
+
`);if(!i||i.__httpError){const r=i?.__httpError;if(r===401||r===403)throw new f("www.zhihu.com","Failed to fetch Zhihu recommendations");throw new m("FETCH_ERROR",r?`Zhihu recommendations request failed (HTTP ${r})`:"Zhihu recommendations request failed","Try again later or rerun with -v for more detail")}for(const r of i.data||[]){const o=r.target||{},c=o.id;let a=null;if(c!=null)a=`${o.type??""}:${c}`;else if(r.id!=null)a=`__feed:${r.id}`;if(a!=null){if(l.has(a))continue;l.add(a)}u.push(r);if(u.length>=e)break}if(i.paging?.is_end)break;n=typeof i.paging?.next==="string"?i.paging.next:""}return u.map((i,r)=>{const o=i.target||{};return{rank:r+1,type:o.type||i.type||"",title:y(i),author:o.author?.name||"",votes:o.voteup_count??o.reaction?.statistics?.like_count??0,url:g(i)}})}});
|
package/clis/zhihu/search.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{cli as
|
|
1
|
+
import{cli as j,Strategy as U}from"@jackwener/opencli/registry";import{ArgumentError as p,AuthRequiredError as k,CommandExecutionError as a,EmptyResultError as I}from"@jackwener/opencli/errors";import{stripHtml as g}from"./text.js";function q(e){const t=e.object||{};if(t.id!=null)return`${t.type||""}:${t.id}`;return null}function _(e){const t=e.id==null?"":String(e.id);if(e.type==="answer"){const r=e.question?.id==null?"":String(e.question.id);return r&&t?`https://www.zhihu.com/question/${r}/answer/${t}`:""}if(e.type==="article")return t?`https://zhuanlan.zhihu.com/p/${t}`:"";if(e.type==="question")return t?`https://www.zhihu.com/question/${t}`:"";return""}function z(e){if(typeof e!=="string"||!e)return"";try{const t=new URL(e);if(t.hostname==="api.zhihu.com"&&t.pathname==="/search_v3")return`https://www.zhihu.com/api/v4/search_v3${t.search}`;if(t.hostname==="www.zhihu.com"&&t.pathname==="/api/v4/search_v3")return t.toString()}catch{return""}return""}const E=1000,L=20,w=["all","answer","article","question"];function S(e){const t=Number(e??10);if(!Number.isInteger(t)||t<=0||t>E)throw new p(`zhihu search --limit must be a positive integer no greater than ${E}`,"Use a normal-sized limit to avoid slow requests or Zhihu risk controls");return t}function b(e){const t=String(e||"").trim();if(!t)throw new p("zhihu search query must not be empty","Example: ppcli zhihu search codex");return t}function v(e){const t=String(e||"all");if(!w.includes(t))throw new p(`zhihu search --type must be one of: ${w.join(", ")}`,"Example: ppcli zhihu search codex --type answer");return t}function l(e){if(e&&typeof e==="object"&&"data"in e&&"session"in e)return e.data;return e}function x(e,t){const r=l(e);if(!r||typeof r!=="object"||Array.isArray(r))throw new a("Zhihu search returned malformed payload");if(r.__httpError){const n=r.__httpError;if(n===401||n===403)throw new k("www.zhihu.com","Failed to fetch search results from Zhihu");throw new a(`Zhihu search request failed${n?` (HTTP ${n})`:""}`,"Try again later or rerun with -v for more detail")}if(r.__fetchError)throw new a("Zhihu search request failed",String(r.__fetchError));if(!Array.isArray(r.data))throw new a("Zhihu search returned malformed data list",`URL: ${t}`);if(!r.paging||typeof r.paging!=="object")throw new a("Zhihu search returned malformed paging data",`URL: ${t}`);return r}function R(e){return`
|
|
2
2
|
(async () => {
|
|
3
3
|
try {
|
|
4
|
-
const r = await fetch(${JSON.stringify(
|
|
4
|
+
const r = await fetch(${JSON.stringify(e)}, { credentials: 'include' });
|
|
5
5
|
if (!r.ok) return { __httpError: r.status };
|
|
6
6
|
return await r.json();
|
|
7
7
|
} catch (err) {
|
|
8
8
|
return { __fetchError: err?.message || String(err) };
|
|
9
9
|
}
|
|
10
10
|
})()
|
|
11
|
-
`}async function
|
|
11
|
+
`}async function Z(e,t){let r=l(await e.evaluate(R(t)));if(r&&typeof r==="object"&&!Array.isArray(r)&&r.__fetchError){await e.goto("https://www.zhihu.com");r=l(await e.evaluate(R(t)))}return x(r,t)}function A(e){if(!e||typeof e!=="object"||e.type!=="search_result"||!e.object||typeof e.object!=="object")return null;const t=e.object;if(t.type!=="answer"&&t.type!=="article"&&t.type!=="question")return null;const r=q(e),n=_(t),i=t.question||{},o=g(t.title||i.name||i.title||"");if(!r||!n||!o)throw new a("Zhihu search returned malformed result row identity");return{item:e,key:r,row:{title:o,type:t.type,author:t.author?.name||"",votes:t.voteup_count||0,url:n}}}j({site:"zhihu",name:"search",access:"read",description:"知乎搜索",domain:"www.zhihu.com",strategy:U.COOKIE,args:[{name:"query",required:!0,positional:!0,help:"Search query"},{name:"limit",type:"int",default:10,help:"Number of results (max 1000; use normal-sized requests)"},{name:"type",default:"all",choices:w,help:"Result type: all, answer, article, or question"}],columns:["rank","title","type","author","votes","url"],func:async(e,t)=>{const r=b(t.query),n=S(t.limit),i=v(t.type);await e.goto("https://www.zhihu.com");let o=`https://www.zhihu.com/api/v4/search_v3?q=${encodeURIComponent(r)}&t=general&offset=0&limit=${L}`;const s=[],m=new Set,f=new Set;while(o&&s.length<n&&!f.has(o)){f.add(o);const u=await Z(e,o);for(const d of u.data){const y=d?.object?.type;if(i!=="all"&&y&&y!==i)continue;const c=A(d);if(!c)continue;if(i!=="all"&&c.row.type!==i)continue;if(m.has(c.key))continue;m.add(c.key);s.push(c.row);if(s.length>=n)break}if(s.length>=n)break;if(u.paging?.is_end)break;const h=z(u.paging?.next);if(!h)throw new a("Zhihu search pagination returned malformed next URL");if(f.has(h))throw new a("Zhihu search pagination returned a repeated next URL");o=h}if(s.length===0)throw new I("zhihu search",`No ${i==="all"?"":`${i} `}results found for "${r}"`);return s.map((u,h)=>{return{rank:h+1,...u}})}});export const __test__={stripHtml:g,itemKey:q,itemUrl:_,normalizeSearchUrl:z,parseLimit:S,requireQuery:b,requireType:v,unwrapEvaluateResult:l,requireSearchPayload:x,fetchSearchPage:Z,normalizeResultItem:A};
|
package/clis/zhihu/stats.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{cli as
|
|
2
|
-
const LIMIT = ${
|
|
1
|
+
import{cli as m,Strategy as d}from"@jackwener/opencli/registry";import{AuthRequiredError as h,CommandExecutionError as g,EmptyResultError as f}from"@jackwener/opencli/errors";function y(e){if(!e)return"";const r=new Date(e*1000),s=(c)=>String(c).padStart(2,"0");return`${r.getFullYear()}-${s(r.getMonth()+1)}-${s(r.getDate())} ${s(r.getHours())}:${s(r.getMinutes())}`}function v(e,r,s){if(!r)return"";if(e==="article")return`https://zhuanlan.zhihu.com/p/${r}`;if(e==="answer")return s?`https://www.zhihu.com/question/${s}/answer/${r}`:`https://www.zhihu.com/answer/${r}`;if(e==="pin")return`https://www.zhihu.com/pin/${r}`;if(e==="zvideo")return`https://www.zhihu.com/zvideo/${r}`;if(e==="question")return`https://www.zhihu.com/question/${r}`;return""}function w(e){if(typeof e!=="string"||!e||e.includes("NaN"))return"";return e}m({site:"zhihu",name:"stats",access:"read",description:"知乎内容数据(每篇阅读/赞同/收藏/评论等全量运营指标)",domain:"www.zhihu.com",strategy:d.COOKIE,browser:!0,navigateBefore:!1,args:[{name:"limit",type:"number",default:20,help:"返回条数"}],columns:["id","type","title","url","published_at","views","likes","comments","collects","shares","shows","favors","reposts","new_followers","finish_read_rate","interact_rate","mark","extra"],func:async(e,r)=>{const s=Math.max(1,Number(r.limit)||20);await e.goto("https://www.zhihu.com/creator/manage/creation/all");await e.wait(2);const c=await e.evaluate(`(async () => {
|
|
2
|
+
const LIMIT = ${s};
|
|
3
3
|
// 大整数 id 加引号保精度(知乎内容 id 19 位,超出 JS Number 安全范围)
|
|
4
4
|
const safeParse = (text) => JSON.parse(
|
|
5
5
|
text.replace(/("(?:id|question_id|url_token)"\\s*:\\s*)(\\d{15,})/g, '$1"$2"')
|
|
@@ -38,4 +38,4 @@ import{cli as Z,Strategy as _}from"@jackwener/opencli/registry";import{AuthRequi
|
|
|
38
38
|
await new Promise((r) => setTimeout(r, 120));
|
|
39
39
|
}
|
|
40
40
|
return { rows, totals };
|
|
41
|
-
})()`),
|
|
41
|
+
})()`),u=c&&typeof c==="object"&&"data"in c&&"session"in c?c.data:c;if(!u||u.error){const n=u&&u.error;if(n==="HTTP 401"||n==="HTTP 403")throw new h("www.zhihu.com",`知乎创作中心接口返回 ${n},请先在 Chrome 中登录知乎`);throw new g(`知乎内容列表获取失败(${n||"响应为空"}),请确认已登录 www.zhihu.com 且创作中心可访问`)}const l=Array.isArray(u.rows)?u.rows:[];if(l.length===0)throw new f("zhihu stats","未获取到任何内容。请确认已登录知乎且账号发布过内容(回答/文章/想法)。");return l.map((n)=>{const i=n.data||{},o=n.reaction||{},t=n.aggr||null,p=t&&t.advanced||{},_=t&&t.content_mark?t.content_mark.is_collapsed?"被折叠":t.content_mark.is_suggest?"获推荐":"":"",a={};if(t){if(t.pageshow_uv)a.详情页访客uv=t.pageshow_uv;if(t.play)a.播放量=t.play;if(t.reaction)a.想法互动数=t.reaction;if(t.like_and_reaction)a.喜欢加互动=t.like_and_reaction;if(t.follower_conversion_rate)a.粉丝转化率=t.follower_conversion_rate}if(o.reviewing_comment_count)a.审核中评论数=o.reviewing_comment_count;if(i.question_id)a.问题id=String(i.question_id);if(i.answered_question_token)a.关联问题token=String(i.answered_question_token);return{id:String(i.id??""),type:n.type??"",title:i.title??"",url:v(n.type,String(i.id??""),i.question_id?String(i.question_id):""),published_at:y(i.created_time),views:t?t.pv??o.read_count??"":o.read_count??"",likes:o.vote_up_count??(t?t.upvote:"")??"",comments:o.comment_count??(t?t.comment:"")??"",collects:o.collect_count??(t?t.collect:"")??"",shares:t?t.share??"":"",shows:t?t.show??"":"",favors:o.like_count??(t?t.like:"")??"",reposts:t&&t.re_pin!=null?t.re_pin:o.repin_count??"",new_followers:t?t.new_follow_uv??"":"",finish_read_rate:w(p.finish_read_percent),interact_rate:w(p.positive_interact_percent),mark:_,extra:Object.keys(a).length?JSON.stringify(a):""}})}});
|
package/clis/zhihu/user-arg.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CliError as
|
|
1
|
+
import{CliError as i}from"@jackwener/opencli/errors";const h=/^[A-Za-z0-9_-]+$/,s=/^user:([A-Za-z0-9_-]+)$/,u=/^\/people\/([A-Za-z0-9_-]+)\/?$/;export function parseZhihuUser(n){const e=String(n??"").trim();if(!e)throw new i("INVALID_INPUT","A Zhihu user is required","Example: ppcli zhihu user wen-jie-16-47");const r=e.match(s);if(r)return r[1];if(h.test(e))return e;try{const t=new URL(e);if(t.protocol==="https:"&&t.hostname==="www.zhihu.com"){const o=t.pathname.match(u);if(o)return o[1]}}catch{}throw new i("INVALID_INPUT",`Invalid Zhihu user: ${e}`,"Use a url_token (wen-jie-16-47) or a people URL (https://www.zhihu.com/people/wen-jie-16-47)")}
|