Skip to content

Instantly share code, notes, and snippets.

@book000
Last active December 29, 2022 07:08
Show Gist options
  • Save book000/95e8bc42566bcde174e1e885502a75d3 to your computer and use it in GitHub Desktop.
Save book000/95e8bc42566bcde174e1e885502a75d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "Error: 2つの引数が必要です。1つ目にscreenの名前、2つ目にURLを指定してください。"
exit 1
fi
SCREEN_NAME=$1
shift
# shellcheck disable=SC2068
screen -dmS "${SCREEN_NAME}" /usr/bin/yt-dlp -o "/mnt/hdd/yt-dlp-live/%(title)s.%(ext)s" --hls-use-mpegts --wait-for-video 10 $@
echo "[INFO] Start recording ${SCREEN_NAME}!"
echo "[INFO] Command: screen -xr ${SCREEN_NAME}"
echo "[INFO] Download dir: /mnt/hdd/yt-dlp-live/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment