Skip to content

adamtan945/YTMusic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version Swift Platform License 繁體中文 Changelog

YTMusic

A lightweight native macOS app that wraps YouTube Music with background playback support. Built with Swift + WKWebView — no Electron, no Chromium, minimal resource usage.

Features

  • Background Playback — closing the window doesn't stop the music
  • Google Sign-in — login within the app, session persists across launches
  • Menu Bar Controls — album art, track info, progress, volume, repeat/shuffle, up next queue
  • System Notifications — song change notifications via macOS
  • Media Keys — keyboard media keys work via WebView MediaSession
  • Dock Integration — click Dock icon to restore window

Requirements

  • macOS 13 (Ventura) or later

Install

Download the latest DMG from Releases, open it, and drag YTMusic to Applications.

Uninstall

bash scripts/uninstall.sh

Or manually remove:

rm -rf /Applications/YTMusic.app
rm -rf ~/Library/WebKit/com.kaa5945.ytmusic
rm -rf ~/Library/Caches/com.kaa5945.ytmusic
rm -rf ~/Library/Preferences/com.kaa5945.ytmusic.plist

Build from Source

Requires Swift 5.9+ (Command Line Tools).

# Build and create .app bundle
bash scripts/bundle.sh

# Copy to Applications
cp -R build/YTMusic.app /Applications/

Project Structure

Sources/
├── App/
│   ├── main.swift              # Entry point (NSApplication)
│   └── AppDelegate.swift       # Window lifecycle, background playback
├── Views/
│   ├── ContentView.swift       # Main SwiftUI view
│   └── WebView.swift           # WKWebView wrapper + Google login
├── Services/
│   ├── MenuBarService.swift    # Menu bar icon + controls
│   ├── NowPlayingService.swift # Song change notifications
│   └── MediaKeyService.swift   # Media key placeholder
└── Helpers/
    └── JavaScriptBridge.swift  # JS ↔ Swift communication
SmokeTests/
└── main.swift                  # WKWebView bridge smoke tests

License

MIT

About

Lightweight native macOS YouTube Music app with background playback. Swift + WKWebView.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors