Skip to content

Instantly share code, notes, and snippets.

@viktorlindgren
Last active January 1, 2018 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viktorlindgren/26c9199dfeac6bac1b0c25588331df57 to your computer and use it in GitHub Desktop.
Save viktorlindgren/26c9199dfeac6bac1b0c25588331df57 to your computer and use it in GitHub Desktop.
svt-serier
#!/bin/bash
cd "$(dirname "$0")" # Script path
mkdir -p SvtPlay && cd SvtPlay
WeekDay=$(date +'%A')
Hour=$(date +'%H')
function dl {
name=$1
if [[ "$WeekDay" != "$2" ]] || (( $3 != 10#$Hour )); then
return;
fi
base="https://www.svtplay.se"
episodeLink=$(wget -q "$base/$name/rss.xml" -O - | grep -m 1 -Po '(?<=link>).*?video.*?[^<]+')
svtplay-dl $episodeLink
}
dl poldark Saturday 21
dl follow-the-money Monday 21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment