Check streamer is online before watching

This commit is contained in:
inigoortega 2020-04-03 13:10:44 +02:00
parent 091c3632f2
commit 656a9b0cbf
4 changed files with 19 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env sh
file="$(find "$SCRIPTS" "$TSCRIPTS" "$XHELPERSCRIPTS/" -regex ".*\.\(ba\)?sh\$" \
file="$(find "$SCRIPTS" "$TSCRIPTS" -regex ".*\.\(ba\)?sh\$" \
-type f | sed "s|^$HOME/||" | fzf -i)"
[ -z "$file" ] || $EDITOR "$HOME/$file"

View File

@ -1,8 +1,8 @@
#!/usr/bin/env sh
files=$(find "$SCRIPTS/" "$TSCRIPTS/" "$XHELPERSCRIPTS/" -regex ".*\.\(ba\)?sh\$" -type f | sed "s|^$HOME/||")
files="${files}\n$(find "$TSCRIPTS/" "$XHELPERSCRIPTS/" -regex ".*\.\(ba\)?sh\$" -type l | sed "s|^$HOME/||")"
files=$(find "$SCRIPTS/" "$TSCRIPTS/" -regex ".*\.\(ba\)?sh\$" -type f | sed "s|^$HOME/||")
files="${files}\n$(find "$TSCRIPTS/" -regex ".*\.\(ba\)?sh\$" -type l | sed "s|^$HOME/||")"
# printf "%b\n" "${files}"

View File

@ -2,5 +2,11 @@
watch="$(cat $FAV_STREAMERS | rofi -dmenu -matching fuzzy)"
[ -n "$watch" ] && dash $TSCRIPTS/watch-video-select-format.sh \
"https://www.twitch.tv/$watch"
[ -n "$watch" ] && {
if youtube-dl --get-id "https://www.twitch.tv/$watch"; then
dash $TSCRIPTS/watch-video-select-format.sh \
"https://www.twitch.tv/$watch"
else
notify-send "Not Found Streamer:" "$watch"
fi
}

View File

@ -26,4 +26,11 @@ else
fi
[ -n "$watch" ] && dash $TSCRIPTS/watch-video-select-format.sh "https://www.twitch.tv/$watch"
[ -n "$watch" ] && {
if youtube-dl --get-id "https://www.twitch.tv/$watch"; then
dash $TSCRIPTS/watch-video-select-format.sh \
"https://www.twitch.tv/$watch"
else
notify-send "Not Found Streamer:" "$watch"
fi
}