Project

General

Profile

RE: EPG for NA OTA/zap2it » tvheadend_EPG.sh

EPG zap2it setup - Edward Crosby, 2017-03-24 13:29

 
1
#!/bin/bash
2

    
3
# As of 03/24, this script is still in draft and has not been fully tested.
4
#
5
# Script to setup EPG in TVHeadend using tvlistings.zap2it.com
6
#
7
# Required files in your home directory:
8
# zap2xml.pl - http://zap2xml.awardspace.info/
9
# zap2xmlrc - https://github.com/rocky4546/script.xmltv.tvheadend
10
# tv_grab_file - https://github.com/rocky4546/script.xmltv.tvheadend
11
# category-filter.pl - https://github.com/rocky4546/script.xmltv.tvheadend
12
#
13
clear
14
echo
15
echo "*** 1. This script assumes you have created a free account on zap2it and are running Ubuntu ***"
16
echo "*** 2. Also, the following files are required and in your home directory: zap2xml.pl, zap2xmlrc, category-filter.pl & tv_grab_file ***"
17
echo "*** 3. xmltv-util is also required ***"
18
echo "*** See the comments of this script for links to needed files ***"
19
echo
20
sleep 4
21
echo "*** If the above has not been met hit Ctrl+c to execute this script ***"
22
echo
23
sleep 5
24
sudo apt update && sudo apt install -y xmltv-util
25
clear
26
# Make the xmltv directory
27
mkdir $HOME/xmltv 2> /dev/null
28
# Move the perl script
29
mv zap2xml.pl $HOME/xmltv/
30
#  Make the perl script executible
31
chmod 775 $HOME/xmltv/zap2xml.pl
32
# Make a copy as a hidden file in the home directory
33
cp $HOME/zap2xmlrc $HOME/.zap2xmlrc
34
# The following questions gather zap2it account information and add to the hidden file
35
read -p "Please enter your zap2it email: " emailresponse
36
sed -i "s/<email>/$emailresponse/g" $HOME/.zap2xmlrc
37
echo
38
read -p "Please enter your zap2it password: " passwordresponse
39
sed -i "s/<password in the clear>/$passwordresponse/g" $HOME/.zap2xmlrc
40
echo
41
read -p "Enter your local account username: " userresponse
42
sed -i "s/<user>/$userresponse/g" $HOME/.zap2xmlrc
43
echo
44
# Create xmltv.xml file from the perl script
45
cd $HOME/xmltv
46
/usr/bin/perl zap2xml.pl -D -S -3
47
# Rename the file
48
mv xmltv_default.xml xmltv.xml
49
# Change the output setting in the hidden file to the new file
50
sed -i 's/xmltv_default.xml/xmltv.xml/g' $HOME/.zap2xmlrc
51
# Move the tv_grab_file to /usr/bin and change permissions
52
sudo mv $HOME/tv_grab_file /usr/bin
53
sudo chmod 755 /usr/bin/tv_grab_file
54
sudo chown root:root /usr/bin/tv_grab_file
55
echo
56
clear
57
echo "*** At the end of this script follow the directions of making a softlink in the hts account ***"
58
echo "*** and setting up the EPG Grabber in the TVHeadend web console ***"
59
sleep 5
(2-2/2)