The default configuration of tvheadend with respect to the epg guides in CoreELEC is somewhat limited. You can use the Over-the_air EPG grabbers and it will work fine if we have several tuners, no antenna motor, and our satellite provider provides data for one or more days. When this does not happen it is better to periodically download the epg guide every day from a trusted website and integrate it into tvheadend.
CoreELEC includes a single EPG Internal Grabber to download a single EPG guide. If we need to download more guides this solution does not work.
The simplest method to implement several epg guides is to create as many EPG Internal Grabbers as epg guides we need.
How to create an EPG Internal Grabber in tvheadend within CoreELEC?
1.- The file will be named as /storage/.kodi/addons/service.tvheadend42/bin/tv_grab_xxxxxx
where xxxxxx will be the name that identifies the epg guide (example: rytecDE_SportMovies).
2.- The file, as will be a script file, will have 755 execution permissions.
3.- The file will have the following content
1. #!/bin/sh
2. XMLTV_TYPE="WEB"
3. XMLTV_LOCATION_FILE=""
4. XMLTV_LOCATION_WEB="http://web_link_download_for_epg_guide"
5. dflag=
6. vflag=
7. cflag=
8. if [ $# -lt 1 ]; then
9. if [ "$XMLTV_TYPE" = "FILE" ]; then
10. cat "$XMLTV_LOCATION_FILE"
11. exit 0
12. elif [ "$XMLTV_TYPE" = "WEB" ]; then
13. wget -qO - "$XMLTV_LOCATION_WEB" | xzcat
14. exit 0
15. fi
16. fi
17. for arg; do
18. delim=""
19. case "$arg" in
20. #translate --gnu-long-options to -g (short options)
21. --description) args="${args}-d " ;;
22. --version) args="${args}-v " ;;
23. --capabilities) args="${args}-c " ;;
24. #pass through anything else
25. *) [[ "${arg:0:1}" == "-" ]] || delim = "\""
26. args="${args}${delim}${arg}${delim} " ;;
27. esac
28. done
29. #Reset the positional parameters to the short options
30. eval set -- $args
31. while getopts "dvc" option; do
32. case $option in
33. d) dflag=1;;
34. v) vflag=1;;
35. c) cflag=1;;
36. \?) echo "unknown option: -%s\n" $OPTARG
37. echo "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
38. exit 2
39. ;;
40. esac >&2
41. done
42. if [ "$dflag" ]; then
43. echo "tv_grab_xxxxxx"
44. fi
45. if [ "$vflag" ]; then
46. echo "0.1\n"
47. fi
48. if [ "$cflag" ]; then
49. echo "baseline\n"
50. fi
where we will modify the following:
line 4: we will indicate the link of the epg download file line 13: we will use âxzcatâ command for epg files in âxzâ format, and âzcatâ command for files in âgzâ format, and âcatâ for uncompressed files line 43: we will replace âtv_grab_xxxxxxâ by the name of our file
4.- Restart CoreELEC.
5.- Activate the new EPG Internal Grabber on tvheadend
#!/bin/sh
XMLTV_TYPE="WEB"
XMLTV_LOCATION_FILE=""
XMLTV_LOCATION_WEB="http://au.freepg.tv/xmltv/oztivo/NSW.Sydney.gz?UID=07A6567C&K=AFD8208EC38FA71C327227560D6E442B"
dflag=
vflag=
cflag=
if [ $# -lt 1 ]; then
if [ "$XMLTV_TYPE" = "FILE"]; then
cat "$XMLTV_LOCATION_FILE"
exit 0
elif [ "$XMLTV_TYPE" = "WEB"]; then
wget -qO - "$XMLTV_LOCATION_WEB" | zcat
exit 0
fi
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 " ;;
#pass through anything else
*) [[ "${arg:0:1}" == "-" ]] || delim = "\""
args="${args}${delim}${arg}${delim}" ;;
exac
done
#Reset the positional parameters to the short options
eval set -- $args
while getopts "dvc" option; do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
\?) echo "unknown option: -%s\n" $OPTARG
echo "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
exit 2
;;
esac >&2
done
if [ "$ dflag" ]; then
echo "tv_grab_sydney"
fi
if [ "$ vflag" ]; then
echo "0.1\n"
fi
if [ "$ cflag" ]; then
echo "baseline\n"
fi
Thanks for trying the script. I have corrected my transcription errors because I use the Google translator.
This tv_grab_sidney should work (if I have not made more mistakes)
#!/bin/sh
XMLTV_TYPE="WEB"
XMLTV_LOCATION_FILE=""
XMLTV_LOCATION_WEB="http://au.freepg.tv/xmltv/oztivo/NSW.Sydney.gz?UID=07A6567C&K=AFD8208EC38FA71C327227560D6E442B"
dflag=
vflag=
cflag=
if [ $# -lt 1 ]; then
if [ "$XMLTV_TYPE" = "FILE" ]; then
cat "$XMLTV_LOCATION_FILE"
exit 0
elif [ "$XMLTV_TYPE" = "WEB" ]; then
wget -qO - "$XMLTV_LOCATION_WEB" | zcat
exit 0
fi
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 ";;
#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 "dvc" option; do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
\?) echo "unknown option: -%s\n" $OPTARG
echo "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
exit 2
;;
esac >&2
done
if [ "$dflag" ]; then
echo "tv_grab_sidney"
fi
if [ "$vflag" ]; then
echo "0.1\n"
fi
if [ "$cflag" ]; then
echo "baseline\n"
fi
@cubimol - I live in an area that can get reception from 3 different areas, each with different epgâs, so is there a way to merge all these into one epg?
This is what this topic solves. Create several tv_grab EPG guides !, one for each area (sidney_area1, sidney_area2, sidney_area3, âŚ). The alternative of creating a single tv_grab guide that adds other guides is much more complicated.
I use 6 tv_grab guides to see the EPG of two countries. Obviously, some TV channels are duplicated because some guides overlap. From tvheadend channels you just have to select the origin of the guide that interests us.
Find out first what kind of compression the EPG file you downloaded has. If you see the notice of âcorrupted dataâ is that the decompressor has not recognized the compression format. âxzcatâ works perfectly with âxzâ files, and âzcatâ works perfectly with âgzâ files.
To find out where xzcat is, use the command: which xzcat, to know where zcat is, use the command: which zcat.
Blockquote
#!/bin/sh
XMLTV_TYPE=âWEBâ
XMLTV_LOCATION_FILE=ââ
XMLTV_LOCATION_WEB=âDomain Auction | Buy & Sell Distinctive Domains - GoDaddyâ
dflag=
vflag=
cflag=
if [ $# -lt 1 ]; then
if [ â$XMLTV_TYPEâ = âFILEâ ]; then
cat â$XMLTV_LOCATION_FILEâ
exit 0
elif [ â$XMLTV_TYPEâ = âWEBâ ]; then
wget -qO - â$XMLTV_LOCATION_WEBâ | cat
exit 0
fi
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 â;; #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 âdvcâ option; do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
?) echo âunknown option: -%s\nâ $OPTARG
echo âUsage: %s: [âdescription] [âversion] [âcapabilities] \nâ $(basename $0)
exit 2
;;
esac >&2
done
if [ â$dflagâ ]; then
echo âtv_grabber_ukâ
fi
if [ â$vflagâ ]; then
echo â0.1\nâ
fi
if [ â$cflagâ ]; then
echo âbaseline\nâ
fi
So this is my exact script. It runs and outputs text to the terminal, but it doesnât seem to be writing out the text to the file
/storage/.kodi/addons/service.tvheadend42/tv_grabber_uk
Clues ?
UPDATE: I know understand, it doesnât create an xml file - it pipes the output to TVheadend directly.
Tip: As every time that tvheadend42 is updated, all our personal internal grabbers created according to this guide will be deleted, save them in the folder /storage/.config/scripts and add the following line to the file /storage/.config/autostart.sh to solve this:
⌠cp /storage/.config/scripts/tv_grab* /storage/.kodi/addons/service.tvheadend42/bin
âŚ
thank you @cubimol for this tutorial.
I would like to use a second EPG-Grabber for some IPTV channels I recently added.
I use DVB-S and some IPTV channels in Germany. (EPG for DVB-Channels work fine due OTA-EPG)
Now i need a provider of XML-EPG data for my German IPTV Channels.
Does somebody has an idea where to get this information from?
There are many places to get EPG guides. You can Google ârytec epg germanyâ, you can also search on github, forums for enigma2 devices, IPTV provider websites, âŚ
I donât understand what are you trying to do exactly. Why donât you enable external xmltv grabber in TVH settings and load xmltv via socket with one single command?
If you know any better alternative tell us. The solution that I propose allows to easily add multiple internal epg grabbers to the tvheadend server, I, for example, use seven new internal epg grabbers for different countries and TV networks, this cannot be done with the external tvheadend grabber. Also when I wrote this topic the external grabber was very limited and did not always work with all kinds of epg download links, I think now this has been solved but I am not sure.
PS.- When I started thinking about this, my first alternative was to use a single external grabber and load the different epg guides at different times. Finally I found it more efficient and elegant to create as many internal grabbers as epg guides and let the tvheadend server take care of everything.