Last active
December 25, 2020 13:02
-
-
Save changyeon/5d751385cd0ac1cd107bd199761dc5e3 to your computer and use it in GitHub Desktop.
streamlink script for crontab
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
#!/bin/bash | |
TARGET_DIR=/home/changyeon/nfs/HDD-1TB/twitch | |
QUALITY=best | |
NOW=$(date +"%Y%m%d_%H%M%S") | |
STREAM=$1 | |
if [ -f /tmp/$STREAM ]; then | |
exit 0 | |
fi | |
touch /tmp/$STREAM | |
streamlink https://www.twitch.tv/$STREAM $QUALITY -o $TARGET_DIR/$STREAM"_"$NOW.mp4 --twitch-disable-ads --twitch-disable-hosting --twitch-disable-reruns | |
rm /tmp/$STREAM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
* * * * * /usr/local/bin/streamlink_live [channel_id]