Skip to content

feat(youtube): add search filters — --type shorts/video/channel, --upload, --sort#616

Merged
jackwener merged 3 commits intojackwener:mainfrom
jackleeio:feat/youtube-search-filters
Mar 31, 2026
Merged

feat(youtube): add search filters — --type shorts/video/channel, --upload, --sort#616
jackwener merged 3 commits intojackwener:mainfrom
jackleeio:feat/youtube-search-filters

Conversation

@jackleeio
Copy link
Copy Markdown
Contributor

Summary

  • Add --type filter: shorts, video, channel, playlist
  • Add --upload filter: hour, today, week, month, year
  • Add --sort: relevance, date, views, rating
  • Uses YouTube's native sp= protobuf params (e.g. Shorts = EgIQCQ, type ID 9)
  • Parses reelItemRenderer for Shorts results alongside videoRenderer
  • Shorts results use /shorts/ URL format

Usage

opencli youtube search "AI" --type shorts --limit 10
opencli youtube search "tech" --upload week --sort views

Test plan

  • --type shorts returns only Shorts with /shorts/ URLs
  • --type video returns regular videos
  • No filter returns mixed results (existing behavior unchanged)
  • --upload week returns recent videos

jackleeio and others added 3 commits April 1, 2026 01:28
Uses YouTube's native sp= filter params. Shorts = type 9 (sp=EgIQCQ).
Also parses reelItemRenderer for Shorts results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows when video was uploaded (e.g. "8h ago", "4d ago", "3mo ago").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s URL rewrite

- YouTube only supports one sp= parameter; using multiple causes
  unpredictable behavior. Pick the most specific filter with priority:
  type > upload > sort.
- Remove the post-processing Shorts URL rewrite — the reelItemRenderer
  branch already generates /shorts/ URLs directly.
@jackwener jackwener force-pushed the feat/youtube-search-filters branch from 511f48e to a819c98 Compare March 31, 2026 17:29
@jackwener jackwener merged commit ee0c2b6 into jackwener:main Mar 31, 2026
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