[mythtv-users] Hdhome run prime CCI scanner
Eric B
bernhart2002 at gmail.com
Wed Sep 14 03:06:39 UTC 2011
Hello All, I just got my hdhome run prime last week and finally got it all
set up. I end up writing a very ugly bash script to down load the lineup and
scan each channel for CCI status and thumb nail the channel. It will then
make a simple html report with the info, and since doing a little google
search didn't turn up anything like this I figure I'd share it.
it needs the following programs to run
hdhomerun_config
firefox
ffmpeg
xml_grep
here's the usage
cci_scan <ip address of the prime>
anyhow its a ugly script so take it for what it is...
regards
Eric
#!/bin/bash
if [ $1 = $2 ]; then
echo "Usage"
echo "cci_scan <hdhome run ip>"
exit 0
fi
htf=cci.html
file="vchan.txt"
wget $1/lineup.xml
xml_grep GuideNumber lineup.xml --text_only > $file
rm lineup.xml
echo "<html>" > $htf
echo "<body>" >> $htf
echo "<h1> CCI Scan `date` </h1>" >> $htf
x=0
lns=`wc -l $file`
y=`expr "$lns" : '\([0-9]*\)'`
while [ "$x" -lt "$y" ]
do
let x=x+1
a=`head -n $x $file | tail -n 1`
echo "<hr />" >> $htf
echo "<p><b>Channel" $a "</b></p>" >> $htf
echo $a
hdhomerun_config $1 set /tuner2/vchannel $a
sleep 3
rp=`hdhomerun_config $1 get /tuner2/vstatus`
echo "<p>" >> $htf
sleep 0.2
hdhomerun_config $1 save 2 test.mpg > /dev/null 2>&1 &
sleep 4
killall hdhomerun_config > /dev/null 2>&1
ffmpeg -i test.mpg -vframes 1 -an $a.jpg > /dev/null 2>&1
echo "<a href="$a".jpg>" >> $htf
echo "<img src="$a".jpg width=100 height=100 /></a> " >> $htf
echo $rp "</p>" >> $htf
done
echo "</body>">> $htf
echo "</html>" >> $htf
rm $file
rm test.mpg
firefox $htf
exit 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20110913/693fe98d/attachment.html
More information about the mythtv-users
mailing list