Skip to content

feat: playlists command for bulk playlist operations#25

Merged
jdwit merged 2 commits into
mainfrom
feat/playlists-command
Jun 9, 2026
Merged

feat: playlists command for bulk playlist operations#25
jdwit merged 2 commits into
mainfrom
feat/playlists-command

Conversation

@jdwit

@jdwit jdwit commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds ytstudio playlists sub-app with 9 commands: list, show, create, update, delete, items, add, remove, reorder.
  • Targets the playlist surface YouTube Studio handles poorly at scale (bulk add by search, view-based reorder).
  • All writes are dry-run by default; --execute applies. Quota counters and partial-progress reporting on every bulk loop.

Highlights

  • Power-user one-liners:
    • ytstudio playlists add PL... --from-search "shorts compilation" -n 20 --execute
    • ytstudio playlists reorder PL... --by views --execute
  • Update re-specifies current snippet fields to avoid the silent-nuke trap.
  • Uploads playlists (UU...) are refused early for any mutating command.
  • Specific errors mapped: manualSortRequired, playlistContainsMaximumNumberOfVideos, videoNotFound, quotaExceeded.

Test plan

  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pytest -q (238 passed)
  • Smoke against a real channel: list, show, create, add by search, reorder, delete.

Out of scope

  • YAML manifest sync (playlists sync FILE.yaml); follow-up PR.

Adds ytstudio playlists list/show/create/update/delete/items/add/remove/reorder
covering the playlist surface YouTube Studio handles poorly at scale.

Power moves: bulk-add by search query, reorder by views.
All writes are dry-run by default; --execute applies.
- add --position increments per insert so multi-video adds keep CLI order
- combining --video and --from-search now respects --limit
- uploads guard resolves the canonical channel uploads id via channels.list
  instead of the brittle UU-prefix heuristic
- reorder skips writes that would be no-ops after prior shifts
- bulk loops route through a small helper that turns RefreshError into a
  friendly "session expired" exit instead of an unhandled exception
- CSV output for list and items uses csv.writer so embedded commas,
  quotes, and newlines survive round-trips
- docs: new docs/playlists.md guide, added to the Guides nav
@jdwit jdwit merged commit 43627fd into main Jun 9, 2026
7 checks passed
@jdwit jdwit deleted the feat/playlists-command branch June 9, 2026 20:09
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.

1 participant