Capture Frame and Upload Image #10
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: Capture Frame and Upload Image | |
on: | |
schedule: | |
- cron: "*/30 * * * *" | |
workflow_dispatch: # This allows manual triggering of the workflow | |
jobs: | |
capture_frame: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install yt-dlp | |
run: sudo apt-get install python3-pip && pip install -U pip hatchling wheel && pip install --force-reinstall "yt-dlp[default] @ https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz" | |
- name: Capture Frame | |
run: ffmpeg -i "$(yt-dlp -g https://www.youtube.com/watch?v=moQtMet7F7w | head -n 1)" -vframes 1 capture.jpg | |
- name: Commit and Push changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Your Name" | |
git add capture.jpg | |
git commit -m "Captured frame" | |
git push |