Tuesday, February 19, 2019

Fixing Plex Guide Data For Use with HDHomeRun Premium TV

I think I got this figured out... but I'm still testing.  So this is use as your own risk.

I'm using zap2xml for guide data.

I started out by following this guide here Link

That was a huge help to get started.  I then went to https://tvlistings.zap2it.com/ and created my first account.  To keep things simple I just made it username+east@gmail.com.  I went in and added all the east coast/national channels to match my local cable provider.

Here is the list of East/West Coast Feeds -> Link

I opened another browser and created a 2nd account and called it username+west@gmail.com.  I went in and then added all the west coast channels.  I ended up using Comcast out of San Francisco (94016) since the numbers matches closely to my cable provider.

Now this part will different depending on what OS your going to do this on.  For me it was CentOS 7.5.

First install the packages you need:


yum install perl perl-HTTP-Cookies.noarch perl-libwww-perl.noarch perl-Time-Piece perl-JSON perl-JSON-XS perl-CPAN perl-LWP-Protocol-https -y


Create your directory where you will store everything: 
mkdir /epg

Download zap2xml perl script (Link)

cp zap2xml.pl /epg/

chmod 755 /epg/zap2xml.pl 
cd /epg/

Now we are going to build our configuration files:

touch east.zap2xmlrc west.zap2xmlrc

/epg/east.zap2xmlrc
start=0
days=14
ncdays=0
ncsdays=2
retries=2
user=username+east@gmail.com
pass=password
cache=/epg/east1
lang=en
outfile=/epg/east.xmltv

outformat=xmltv

/epg/west.zap2xmlrc
start=0
days=14
ncdays=0
ncsdays=2
retries=2
user=username+west@gmail.com
pass=password
cache=/epg/west1
lang=en
outfile=/epg/west.xmltv

outformat=xmltv

Now we will create the cron script that will continue to pull in new data:

touch zap2xml.sh

/epg/zap2xml.sh
#!/bin/bash
rm -f /epg/west.xmltv
rm -f /epg/east.xmltv
perl /epg/zap2xml.pl -C /root/epg/west.zap2xmlrc -L -b -T -F
perl /epg/zap2xml.pl -C /root/epg/east.zap2xmlrc -J /root/epg/west.xmltv -L -b -T -F

/usr/bin/cp -f /root/epg/east.xmltv "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/"

Change the permissions so we can launch it:

chmod 755 zap2xml.sh
./zap2xml.sh

Troubleshooting:

It suggested using the https perl module but it wasn't really a suggestion, it's required.

Also found another issue where I kept changing guide data, trying to find the right zip/channel number on the west coast and more and more channels would have the same data for 8 days straight.  To fix this I cleared the cache folders (/epg/west1 and /epg/east1).


So far so good and I will keep updating this as I test this further.


2 comments:

  1. Thanks for sharing this information its really nice. It is essential to start using a reliable service that can scale to cope with your complete entertainment needs. By utilizing xmltv viewer, users can access a rich electronic program guide (EPG) that provides detailed TV listings, making it easier to navigate and discover content on any mobile devices.

    ReplyDelete
  2. I found this blog when I hop over to this website while searching for a playlist management options, and I must say, your post is like a game-changer! Traditional playlist formats like M3U or ASX can be quite limiting and inflexible. However, learning about EPG and its versatility has left me intrigued.

    ReplyDelete

ShareThis