Skip to content

feat(youtube): add feed, history, watch-later, subscriptions, playlist, like, unlike, subscribe, unsubscribe#1029

Merged
jackwener merged 3 commits intojackwener:mainfrom
sunbird89629:feat/youtube-new-commands
Apr 15, 2026
Merged

feat(youtube): add feed, history, watch-later, subscriptions, playlist, like, unlike, subscribe, unsubscribe#1029
jackwener merged 3 commits intojackwener:mainfrom
sunbird89629:feat/youtube-new-commands

Conversation

@sunbird89629
Copy link
Copy Markdown
Contributor

Description

Add 9 new YouTube commands covering personalized feeds, history, playlists, and write operations.

Related issue:

Type of Change

  • ✨ New feature

New Commands

Command Description Data Source
youtube feed Homepage recommended videos ytInitialData on youtube.com
youtube history Watch history DOM scraping on /feed/history
youtube watch-later Watch Later queue ytInitialData on /playlist?list=WL
youtube subscriptions Subscribed channels list ytInitialData on /feed/channels
youtube playlist Playlist video list InnerTube browse API (VL prefix)
youtube like Like a video POST /youtubei/v1/like/like
youtube unlike Remove like from a video POST /youtubei/v1/like/removelike
youtube subscribe Subscribe to a channel POST /youtubei/v1/subscription/subscribe
youtube unsubscribe Unsubscribe from a channel POST /youtubei/v1/subscription/unsubscribe

Write commands use SAPISIDHASH auth computed via crypto.subtle.digest('SHA-1', ...) inside page.evaluate(). @handle inputs are auto-resolved to channel IDs via the InnerTube resolve_url endpoint.

Shared helpers extracted to utils.js: FETCH_BROWSE_FN, extractPlaylistVideos, RESOLVE_CHANNEL_HANDLE_FN.

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation

  • Updated docs/adapters/browser/youtube.md
  • Updated docs/adapters/index.md table
  • Updated README.zh-CN.md
  • Used positional args for the command's primary subject
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

$ node dist/src/main.js youtube feed --limit 3
- channel: 王志安
  duration: '41:26'
  rank: 1
  title: 乌有之乡,乡关何处?
  url: https://www.youtube.com/watch?v=J9a9j0LaDrs
  views: 53万次观看

$ node dist/src/main.js youtube subscriptions --limit 3
- rank: 1
  handle: '@TheValley101'
  name: 硅谷101
  subscribers: 41.3万位订阅者
  url: https://www.youtube.com/@TheValley101

$ node dist/src/main.js youtube like "https://www.youtube.com/watch?v=BOUlHcu2zrE"
- status: success
  message: 'Liked: BOUlHcu2zrE'

$ node dist/src/main.js youtube subscribe "@WebDevSimplified"
- status: success
  message: 'Subscribed to: UCFbNIlppjAuEX4znoulh0Cw'

@jackwener jackwener merged commit 44147e5 into jackwener:main Apr 15, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants