1 | #! /bin/sh
|
---|
2 | # gets xmltv stuff from net and removes the Uusinta.* to get re-run
|
---|
3 | # marking working. There is 7 days offset, since finnish epg data is
|
---|
4 | # for 7 days and epg is more accurate in timings.
|
---|
5 |
|
---|
6 | FETCH_PROGRAMS=0
|
---|
7 | FILL_DB=0
|
---|
8 |
|
---|
9 | for PARAM
|
---|
10 | do
|
---|
11 | case "$PARAM" in
|
---|
12 | --feed)
|
---|
13 | FEED_DB=1
|
---|
14 | ;;
|
---|
15 | --nofeed)
|
---|
16 | FEED_DB=0
|
---|
17 | ;;
|
---|
18 | --fetch)
|
---|
19 | FETCH_PROGRAMS=1
|
---|
20 | ;;
|
---|
21 | --nofetch)
|
---|
22 | FETCH_PROGRAMS=0
|
---|
23 | ;;
|
---|
24 | *)
|
---|
25 | echo "Invalid parameters!"
|
---|
26 | exit 1;
|
---|
27 | ;;
|
---|
28 | esac
|
---|
29 | done
|
---|
30 |
|
---|
31 | mkdir /tmp/channels
|
---|
32 |
|
---|
33 | if [ "${FETCH_PROGRAMS}" = 1 ]
|
---|
34 | then
|
---|
35 | /usr/bin/tv_grab_fi --quiet --config-file /stuff/videot/mythtv/.mythtv/HTV-telkku.xmltv --offset 7 --output /tmp/channels/xmltv_channels.tmp
|
---|
36 | if [ "$?" != 0 ]
|
---|
37 | then
|
---|
38 | echo "Program list grabbing failed!"
|
---|
39 | exit 1;
|
---|
40 | fi
|
---|
41 | fi
|
---|
42 |
|
---|
43 | sed -e '/\<desc lang=.*\>/,/\<\/desc\>/s/\ Uusinta[a-zA-Z ]*\.//' \
|
---|
44 | -e '/\<desc lang=.*\>/,/\<\/desc\>/s/\([uU]\)$//' \
|
---|
45 | -e '/\<desc lang=.*\>/,/\<\/desc\>/s/\ [a-zA-Z ]*\ sarja\.//' \
|
---|
46 | /tmp/channels/xmltv_channels.tmp > /tmp/channels/xmltv_channels.tmp2
|
---|
47 |
|
---|
48 | if [ "${FEED_DB}" = 1 ]
|
---|
49 | then
|
---|
50 | mythfilldatabase --file 1 /tmp/channels/xmltv_channels.tmp2 --update
|
---|
51 | fi
|
---|