[Howto] Receive channels from multiple lineups? Want to Support OTA+Cable? Instructions to build XMLTV files with combined lineups

I know many folks have a use case using multiple lineups. I personally have both Cable and OTA, and wanted all the channels from both setups to show up.

Another option is now that HDHomeRun has released their Premium service, you’ll need to do something like this in order to use it with Plex and still get OTA.

BUGS:

“Plex requires some sort of episode numbering in order to identify TV shows, this could either be the original-air-date (as IceTV has) or it could be some sort of episode / season numbering”

  • ‘Unable to load channel mappings’ error in Plex DVR Setup
    I seem to get this when PMS is busy, specifically when adding the 2nd device. I usually wait and let it process entirely, before adding another device.

  • ‘Invalid or missing xml’ error in Plex DVR Setup
    I’ve noticed PMS is weirdly path picky on the XML file. I’ve resorted to using /tmp and make sure the file has no spaces/etc. This can also be a URL.

  • Processing takes quite awhile
    The examples below utilize a .chl file, which allows you to have an inclusion/exclusion list to minimize processing needed for channels you don’t have.

  • Tons of shows don’t have images
    This is guide data provider dependent. If they include the URL for images in the XML, then Plex will pick it up.

NEEDED:
mc2xml - http://mc2xml.hosterbox.net/ - Supports multiple platforms.
Account with a supported EPG Provider - I am using Schedules Direct

Example commands:
mc2xml -D sfota.dat -C sfota.chl -o sfota.xml -J USER:PASS -g 94103 -c USA --sdjs-images
mc2xml -D sfcable.dat -C sfcable.chl -I sfota.xml -o sfcableota.xml -J USER:PASS -g 94103 -c USA --sdjs-images

Explanation:
-D is the dat file, you need to define this since you’re combining lineups
-C is the chl file, this is to have an inclusion OR exclusion list. See the webpage for example. I have channel ranges listed of the exact channels I have access too
-o is the XMLTV output file
-J is the logins needed for Schedules Direct
-g is my zipcode
-c is my country
–sdjs-images is to get cover/etc images for each program listing
-I is the flag to add another file. The output will be a combined XMLTV formatted file that Plex will accept.

You can repeat these for multiple lineups, SD supports up to 4.

Once you’ve ran these commands, you should have a fairly large (50-300mb+) file which has 14+ days of program data. You need to copy it to an easily accessible location (I use /tmp in Linux) or HTTP accessible.

PLEX SETUP:
Unfortunately, you will need to delete your DVR for this, but don’t fear, because Plex will remember all your scheduled recordings.
Go into Live DVR Setup and delete DVR in the upper right hand corner.
Then click ‘Set Up Plex DVR’. Pick your device and click Continue. IF needed do a channel scan, then Continue.
At the next screen, where you normally put in a zip code, look at the Orange text that says ‘Have an XMLTV guide on your server? Click here to use that instead’.
Add the path for your file and if it’s located after you click Continue it will switch to ‘Loading Channel Mappings’.

Every channel should be mapped, it should look like this:
image

And then click Continue and it’ll start processing. Once it finishes you should be good to go!

Besides the bug listed above where anything without episode numbers becomes a movie, functionality should not be different.

You’ll want to script this to run once a day or every few days, outputting the XMLTV file at the exact same location as you copied it, so Plex can continually update the guide data using that file.

I have not tested this with HDHomeRun Premium, nor any guide data provider beyond Schedules Direct, but it should work with them. Report back if it does for you!

UPDATE:
You can also use a fork of tv_grab_zz_sdjson_sqlite. This is what I’ve switched too.

1 Like

I can’t wait to try this out!

If you know which programs are movies, you can mark all programmes that aren’t movies with a made up original air date (e.g. The current date)

It’s hundreds though. Essentially any program that isn’t a series. And they add more everyday.

And mark how? In the xmltv? Everytime it’s ran?

All you need is a line in the xmltv file that has an episode number (or date), however unless you make a script it would be especially time consuming

Yeah, and it would be location specific and a ton of things to modify…

I might go through other EPG providers and see if any of them handle it better.

1 Like

So, I tried others mc2xml supported, to no luck.

I did however find something thats super interesting:

This is a fork of the XMLTV grabber for Schedules Direct that adds artwork, which is the reason why I stopped using it, and most importantly, its open source, so we might be able to find someone who can add in the Originally Aired date to all the episodes, if possible.

Thanks for sharing this. Unfortunately I’ll have to give it a try as I’m an early adopter of HDHR Premium Channels and they mixed east and west coast channels so I can’t just use my local cable company’s listings for OTA and premium channels.

It sure would be great if Plex devs added this functionality in natively instead of having to jump through hoops and having the added expense for SD guide data.

Agreed. I don’t know how to fix the east/west problem, since I don’t have HDHR Premium, but SD does allow 2 months for $6 and up to 4 lineups, so with enough hassle you should eventually be able to figure it out. I’ll reach out to SD and ask for the ‘best lineups’ for both east/west and post if I get a response.

Hopefully by the time 2 months ends, Plex will have it fixed on their end. :slight_smile:

So spoke with an HDHR rep and they said any west coast lineup should be fine, but didn’t have a good suggestion for an east coast one. Good luck and report back your results!

So SiliconDust folks have informed me that Schedules Direct has added HDHomeRun Premium Lineups for East and West in their JSON product. So if you use the grabber above (or mc2xml) you can add both of those lineups and your OTA lineup, and get back a XMLTV file that you can import in that will work with HDHR Premium. Keep in mind, it’s not in the DD service, so you won’t see them show up in their webUI, only in the JSON API.

1 Like

no matter what I do I keep getting the error about unable to load channel maps. It works fine with a single file download (OTA or HdPremium) but the instant I combine them, it fails.

Any ideas? My media server isn’t busy, as I’m the user. I’m just adding the xml file to a new DVR after deleting it.

my first command line (sans password) defaulting to the xmltv.xml output

./mc2xml -D localota.dat -J user:pass -g 27587 -c USA --sdjs-images

My second command line sans password

./mc2xml -D hdpremium.dat -I xmltv.xml -o /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/DVR/hdhomerun.xml -J user:pass -c USA -g 27587 --sdjs-images

Loading … : mc2xml © <mc2xml@gmail.com> (v1.6)

Reminder … : Unauthorized redistribution prohibited.

Reminder … : If this software is useful, please donate!

Reading … : hdpremium.dat

Connecting … : schedulesdirect.org

Account status: Expires 2018-11-08T23:23:55Z

Account status: 2/4 lineups

Preparing … : 45 stations, 1 thread

Downloading . : schedules (1) .

Preparing … : 14618 programs, 4 threads

Downloading . : programs (8) …

Preparing … : 2205 images, 4 threads

Downloading . : images (5) …

Downloaded … : 5134142 bytes in 10s

Parsing … : HDHomeRun Premium TV - East (National)

Start time … : 2018-09-08T00:00:00 UTC

End time … : 2018-09-29T13:00:00 UTC

Writing … : /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/DVR/hdhomerun.xml

Reading … : xmltv.xml

Writing … : hdpremium.dat

Completed … : 239492126 bytes in 12s, 45 channels, 25210 programs scheduled.

Change the filename to something different and if that helps? I had problems when I used xmltv.xml, but was fine with the examples shown.

I tried it the other way first, xmltv was my second try. I even tried changing the order so the ‘lower’ channel numbers went first. i’ll keep poking at it, just annoying. Would like more detailed errors and can’t find anything in the logs. if it’s too big, or whatever, would be nice to know.

really weird. I had it replace an xml file that worked from another program, hit refresh guide and it works. :man_shrugging: ok then.

I was also receiving the ‘unable to load channel maps’ error. My fix was to remove the ‘–sdjs-images’ parameter on the ota lineup.
** This syntax now works for me **
mc2xml -D sfota.dat -o sfota.xml -J USER:PASS -g 85296 -c USA
mc2xml -D sfcable.dat -I sfota.xml -o sfcableota.xml -J USER:PASS -g 85296 -c USA --sdjs-images

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.