feat: add play video AppleScript command#167
Open
enkinvsh wants to merge 1 commit intosozercan:mainfrom
Open
Conversation
Add 'play video' AppleScript command that plays a specific YouTube video by its video ID via playWithRadio, which properly sets up the queue and avoids WebQueueSync conflicts. Adds markUserInteracted() to PlayerService to bypass the first-time interaction gate (mini player popup) when commands come from AppleScript automation. Usage: tell application "Kaset" to play video "dQw4w9WgXcQ" The command creates a Song, marks the session as user-interacted, and delegates to playWithRadio(song:) which handles queue setup, WebView navigation, and radio queue fetching.
1f7908f to
98284ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
play videoAppleScript command that plays a specific YouTube video by its video ID. This enables programmatic playback control from automation tools, scripts, and bots.Usage
Why
Kaset's existing AppleScript dictionary covers transport controls (play/pause/next/prev, volume, shuffle, etc.) and player info queries, but there's no way to start playing a specific song programmatically. The URL scheme (
kaset://play?v=VIDEO_ID) works from GUI contexts but not from LaunchAgents, daemons, or SSH sessions — which is where most automation runs.This command fills that gap by adding a direct AppleScript interface to
PlayerService.play(videoId:).Changes
Kaset.sdef: Addedplay videocommand definition with a text direct parameter for the video IDScriptCommands.swift: AddedPlayVideoCommandclass following the exact same pattern asPlayCommand,SetVolumeCommand, and other existing commandsUse case
I'm building a Telegram bot that controls YouTube Music via Kaset on a Mac Mini server. Transport controls (play/pause/next/prev) work perfectly via AppleScript, but playing a specific song requires this command since the URL scheme doesn't work from background processes (LaunchAgent).