語学講座CS2 (2025年度)

ストリーミングで公開されているNHKラジオ語学講座(らじる★らじる(聴き逃し)配信)の録音を自動化するためのデスクトップアプリです。語学講座の録音にはffmpegを利用します。OSDN.net で公開されていた「CaptureStream」の派生版であり、同ソースコードを基盤としています。正式に開発を引き継いでいるものではありません。録音した語学講座のファイルは著作権法で許されている範囲内でご利用ください。

View the Project on GitHub

語学講座CS2

スケジュール録音の設定方法(macOS版:launchd)  

TOP目次ドキュメント]

     

launchdを使ったmacOS向けスケジュール録音の設定方法です。

「launchd」はmacOSネイティブのタスクスケジューラーで、Appleはcrontabの代替として使用を推奨しています。

     


📁 1. 実行したいアプリやスクリプトを準備

例:CaptureStream2をGUIなしで起動する

/Applications/CaptureStream2.app/Contents/MacOS/CaptureStream2 -nogui

📝 2. 設定ファイル(*.plist)を作成

以下の内容を com.example.capturestream2.plist という名前で保存します。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.example.capturestream2</string>

    <key>ProgramArguments</key>
    <array>
      <string>/Applications/CaptureStream2.app/Contents/MacOS/CaptureStream2</string>
      <string>-nogui</string>
    </array>

    <key>RunAtLoad</key>
    <true/>

    <key>StartInterval</key>
    <integer>3600</integer> <!-- 例: 1時間ごとに実行 -->
  </dict>
</plist>

🧠 補足:


📂 3. 設定ファイルを配置

mkdir -p ~/Library/LaunchAgents
cp com.example.capturestream2.plist ~/Library/LaunchAgents/

🔐 4. 権限を確認・修正(必要に応じて)

chmod 644 ~/Library/LaunchAgents/com.example.capturestream2.plist

🚀 5. launchdに登録して起動

launchctl load ~/Library/LaunchAgents/com.example.capturestream2.plist

📌 登録済みか確認:

launchctl list | grep capturestream2

🛑 6. 停止・削除したい場合

launchctl unload ~/Library/LaunchAgents/com.example.capturestream2.plist

     

     

TOP目次ドキュメント]