Fix CI #174
This file contains 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
name: TestOnMacOs | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
schedule: | |
- cron: "37 10 * * 3" | |
jobs: | |
TestScript: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Get latest ytdl_hook.lua | |
run: | | |
wget https://github.com/mpv-player/mpv/raw/master/player/lua/ytdl_hook.lua | |
- name: Install mpv | |
run: | | |
brew install coreutils | |
brew install ffmpeg luajit mujs uchardet vapoursynth libplacebo | |
brew install --ignore-dependencies mpv | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | |
- name: Test mpv | |
run: | | |
mpv | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install yt-dlp from pip | |
run: | | |
pip install --upgrade yt-dlp | |
which yt-dlp | |
- name: Test yt-dlp | |
run: | | |
yt-dlp --version | |
- name: ⏯️ Run mpv with youtube-upnext userscript | |
timeout-minutes: 2 | |
run: | | |
ytloc=$(which yt-dlp) | |
echo ytloc: $ytloc | |
timeout 10 mpv --no-video --no-audio --end=00:00:00 --ytdl=no --script-opts="ytdl_hook-ytdl_path=$ytloc,youtube-upnext-auto_add=no,youtube-upnext-fetch_on_start=yes,youtube-upnext-use_json_lua=yes" --scripts=ytdl_hook.lua:youtube-upnext.lua --msg-level=youtube_upnext=trace "https://www.youtube.com/watch?v=VpOLXXBcAl0" || true | |
output=$(timeout 10 mpv --no-video --no-audio --end=00:00:00 --ytdl=no --script-opts="ytdl_hook-ytdl_path=$ytloc,youtube-upnext-auto_add=no,youtube-upnext-fetch_on_start=yes,youtube-upnext-use_json_lua=yes" --scripts=ytdl_hook.lua:youtube-upnext.lua --msg-level=youtube_upnext=trace "https://www.youtube.com/watch?v=VpOLXXBcAl0" || true 2>&1) | |
echo $output | |
if [[ $output == *"downloaded and decoded json successfully"* ]]; then | |
exit 0 | |
else | |
echo "Not found: downloaded and decoded json successfully" | |
exit 1 | |
fi |