Skip to content

Instantly share code, notes, and snippets.

@kiall
Last active September 19, 2020 18:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiall/b65b8e1c234bccb4283d40da276ad1c4 to your computer and use it in GitHub Desktop.
Save kiall/b65b8e1c234bccb4283d40da276ad1c4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Place in /usr/bin/tv_grab_wg++ and sudo chmod +x /usr/bin/tv_grab_wg++
xmltv_file_location=~/wg++/guide.xml
dflag=
vflag=
cflag=
qflag=
if (( $# < 1 ))
then
cat "$xmltv_file_location"
exit 0
fi
for arg
do
delim=""
case "$arg" in
#translate --gnu-long-options to -g (short options)
--description) args="${args}-d ";;
--version) args="${args}-v ";;
--capabilities) args="${args}-c ";;
--quiet) args="${args}-q ";;
#pass through anything else
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done
#Reset the positional parameters to the short options
eval set -- $args
while getopts "dvcq" option
do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
q) qflag=1;;
\?) printf "unknown option: -%s\n" $OPTARG
printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
exit 2
;;
esac >&2
done
if [ "$dflag" ]
then
printf "$0 is a wrapper grabber around WebGrab+Plus\n"
fi
if [ "$vflag" ]
then
printf "0.2\n"
fi
if [ "$cflag" ]
then
printf "baseline\n"
fi
if [ "$qflag" ]
then
printf ""
fi
exit 0
<!--?xml version="1.0"?-->
<settings>
<!-- for detailed info about the settings see http://webgrabplus.com/node/30 -->
<filename>/home/hts/wg++/guide.xml</filename>
<mode></mode>
<postprocess grab="y" run="n">mdb</postprocess>
<proxy>automatic</proxy>
<user-agent>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0</user-agent>
<logging>on</logging>
<retry time-out="5">4</retry>
<skip>noskip</skip>
<timespan>7</timespan>
<update>f</update>
<!-- Start Saorview -->
<channel update="i" site="horizon.tv.ie" site_id="753737255275" xmltv_id="RTE One HD">RTE One HD</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255272" xmltv_id="RTE2 HD">RTE2 HD</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255359" xmltv_id="TV3 HD">TV3 HD</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255278" xmltv_id="TG4 HD">TG4 HD</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255332" xmltv_id="3e">3e</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255257" xmltv_id="UTV Ireland HD">UTV Ireland HD</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255266" xmltv_id="RTEjr">RTEjr</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255209" xmltv_id="RTE One +1">RTE One +1</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255354" xmltv_id="RTE News Now">RTE News Now</channel>
<channel update="i" site="horizon.tv.ie" site_id="753737255385" xmltv_id="Oireachtas TV">Oireachtas TV</channel>
<!-- Missing SAORVIEW Information -->
<!-- Start FreeSat -->
<channel update="i" site="tvguide.co.uk" site_id="74" xmltv_id="BBC1 London">BBC1 London</channel>
<channel update="i" site="tvguide.co.uk" site_id="387" xmltv_id="BBC2 HD">BBC2 HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="172" xmltv_id="ITV London">ITV London</channel>
<channel update="i" site="tvguide.co.uk" site_id="121" xmltv_id="Channel 4">Channel 4</channel>
<channel update="i" site="tvguide.co.uk" site_id="657" xmltv_id="Channel 5 HD">Channel 5 HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="683" xmltv_id="BBC1 HD">BBC1 HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="893" xmltv_id="BBC4 HD">BBC4 HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="93" xmltv_id="BBC2 London">BBC2 London</channel>
<channel update="i" site="tvguide.co.uk" site_id="508" xmltv_id="BBC Alba">BBC Alba</channel>
<!-- <channel update="i" site="tvguide.co.uk" site_id="849" xmltv_id="BBC4">BBC4</channel> -->
<channel update="i" site="tvguide.co.uk" site_id="109" xmltv_id="BBC4">BBC4</channel>
<channel update="i" site="tvguide.co.uk" site_id="642" xmltv_id="ITV HD">ITV HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="697" xmltv_id="ITV London +1">ITV London +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="180" xmltv_id="ITV2">ITV2</channel>
<channel update="i" site="tvguide.co.uk" site_id="376" xmltv_id="ITV2 +1">ITV2 +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="360" xmltv_id="ITV3">ITV3</channel>
<channel update="i" site="tvguide.co.uk" site_id="474" xmltv_id="ITV3+1">ITV3+1</channel>
<channel update="i" site="tvguide.co.uk" site_id="367" xmltv_id="ITV4">ITV4</channel>
<channel update="i" site="tvguide.co.uk" site_id="926" xmltv_id="ITVBe">ITVBe</channel>
<channel update="i" site="tvguide.co.uk" site_id="234" xmltv_id="S4C">S4C</channel>
<channel update="i" site="tvguide.co.uk" site_id="428" xmltv_id="Channel 4 + 1">Channel 4 + 1</channel>
<channel update="i" site="tvguide.co.uk" site_id="139" xmltv_id="E4">E4</channel>
<channel update="i" site="tvguide.co.uk" site_id="371" xmltv_id="E4 +1">E4 +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="361" xmltv_id="More4">More4</channel>
<channel update="i" site="tvguide.co.uk" site_id="429" xmltv_id="More4 +1">More4 +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="476" xmltv_id="Channel 4 HD">Channel 4 HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="752" xmltv_id="4seven">4seven</channel>
<channel update="i" site="tvguide.co.uk" site_id="729" xmltv_id="Channel 5 +1">Channel 5 +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="375" xmltv_id="5USA">5USA</channel>
<channel update="i" site="tvguide.co.uk" site_id="572" xmltv_id="5USA +1">5USA +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="374" xmltv_id="5STAR">5STAR</channel>
<channel update="i" site="tvguide.co.uk" site_id="901" xmltv_id="5* +1">5* +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="571" xmltv_id="My5">My5</channel>
<channel update="i" site="tvguide.co.uk" site_id="493" xmltv_id="CBS Drama">CBS Drama</channel>
<channel update="i" site="tvguide.co.uk" site_id="385" xmltv_id="CBS Reality">CBS Reality</channel>
<channel update="i" site="tvguide.co.uk" site_id="424" xmltv_id="CBS Reality +1">CBS Reality +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="498" xmltv_id="CBS Action">CBS Action</channel>
<channel update="i" site="tvguide.co.uk" site_id="425" xmltv_id="Horror Channel">Horror Channel</channel>
<channel update="i" site="tvguide.co.uk" site_id="504" xmltv_id="Horror Channel +1">Horror Channel +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="110" xmltv_id="BET">BET</channel>
<channel update="i" site="tvguide.co.uk" site_id="964" xmltv_id="Spike">Spike</channel>
<channel update="i" site="tvguide.co.uk" site_id="633" xmltv_id="TrueEntertainment">TrueEntertainment</channel>
<channel update="i" site="tvguide.co.uk" site_id="998" xmltv_id="True Crime">True Crime</channel>
<channel update="i" site="tvguide.co.uk" site_id="369" xmltv_id="Pick">Pick</channel>
<channel update="i" site="tvguide.co.uk" site_id="667" xmltv_id="Pick+1">Pick+1</channel>
<channel update="i" site="tvguide.co.uk" site_id="596" xmltv_id="Food Network">Food Network</channel>
<channel update="i" site="tvguide.co.uk" site_id="595" xmltv_id="Food Network +1">Food Network +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="289" xmltv_id="Travel Channel">Travel Channel</channel>
<channel update="i" site="tvguide.co.uk" site_id="565" xmltv_id="Travel Channel +1">Travel Channel +1</channel>
<!-- Missing True Crime +1 -->
<channel update="i" site="tvguide.co.uk" site_id="907" xmltv_id="True Entertainment +1">True Entertainment +1</channel>
<channel update="i" site="tvguide.co.uk" site_id="923" xmltv_id="truTV">truTV</channel>
<channel update="i" site="tvguide.co.uk" site_id="530" xmltv_id="ITV4 + 1">ITV4 + 1</channel>
<channel update="i" site="tvguide.co.uk" site_id="751" xmltv_id="PBS America">PBS America</channel>
<channel update="i" site="tvguide.co.uk" site_id="991" xmltv_id="YourTV">YourTV</channel>
<channel update="i" site="tvguide.co.uk" site_id="871" xmltv_id="Drama">Drama</channel>
<channel update="i" site="tvguide.co.uk" site_id="320" xmltv_id="YESTERDAY">YESTERDAY</channel>
<channel update="i" site="tvguide.co.uk" site_id="422" xmltv_id="Really">Really</channel>
<channel update="i" site="tvguide.co.uk" site_id="1013" xmltv_id="Blaze">Blaze</channel>
<channel update="i" site="tvguide.co.uk" site_id="894" xmltv_id="BBC News HD">BBC News HD</channel>
<channel update="i" site="tvguide.co.uk" site_id="67" xmltv_id="BBC Parliament">BBC Parliament</channel>
<channel update="i" site="tvguide.co.uk" site_id="257" xmltv_id="Sky News">Sky News</channel>
<!-- Haven't added the remaining channels, I don't watch them -->
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment