AndroidHDMI-for-Channels (ah4c) - FireTV LiveTV capture

Does it matter if there are channels in the FireTV guide that are not configured in the m3u?
I didn't hide all the other channels that I eventually want.

Don't forget the visible channels in your guide need to exactly match the M3U. Which means, if you're only using the channels I defined you'd need to hide all other channels, and re-run the create M3Us. Right now I'd guess you have channels (and maybe other sources) that don't match your current M3U.

After you get the initial device-specific M3Us created, if additional channels appear or disappear from the guide it's not as big a deal as you've already captured the correct IDs for the channels you've defined.

Discovering the FireStick IDs can be done manually as well, but this way works as long as everything is lined up properly.

Yes. Read my last.

So they need to be in the same order?

No, because FireTV sorts alphabetically, and I sort the device-specific M3U alphabetically as well. You should be able to compare them to confirm if you like.

@Anvil_DVR

If you want to confirm the IDs manually, you can exec into the container using the Portainer "Quick Action" button for that purpose, and enter:

adb logcat | grep GuideManager

That will continue to run until you Ctrl-C it. Leave it running and step through the guide. You should see lines like this after each guide move:

09-19 20:00:54.567 14043 14043 I GuideManager: Updating mini details for station livetv://stationgroup/item?groupType=STATION_SOURCE&groupId=com.amazon.avod%2F.tvif.AIVTvInputService!!livetv://station/item?9

The number at the very end is what you're after, so you can compare that to what you're getting from the automated process. Not a requirement, but do it if you're feeling inclined.

I matched up the FireTV channels with the m3u.
21 channels each. the first 6 channels work.
It looks like there are some duplicate ID's in the device m3u.

I'd suggest trying the manual step through I outlined above and see if you can figure out where we have an issue. Also, at this point, you can adjust (manually edit) the device-specific M3U with the correct numbers -- and let me know how many are wrong.

I'm already doing two passes through the list, one to extract and a second to confirm, but perhaps more is needed to account for different environments.

I tried this and got nothing.
seeing as 2 weeks ago I never heard of portainer, good chance its just me...

I will pick this up tomorrow.....

Thanks for the help.

That's what it looks like until you start moving through the guide -- then you should start seeing output. And, just to confirm I'm talking about stepping through the FireTV's guide, not the Channels DVR guide. :slight_smile:

Copy that.

I'm a big fan of the channel selection on my Directv Stream and have loaded the channels into the Amazon live guide.

I plan to buy an HDMI encoder soon but have a few questions.

Can multiple channels be recorded at once with a single FireTV and HDMI encoder, or do I need additional sets of both devices if I want to record multiple channels at once?

1 Like

You'll need a multi-port encoder and as many FireSticks as you want virtual tuners. Ethernet for the sticks is a good idea, and you can even do PoE with the right adapter.

I have a reasonably "battle-hardened" set of scripts that uses the DTV app as a source, so you'll want to use those. What we're doing here with the LiveTV guide is more "early days".

Perfect.

Edit: I ran this this morning.
It seems like they were off by 1 following the banner in the guide.
I manually changed (corrected) all the numbers in the device m3u and its working now.

Will pick this up later today when I get home.

That's a good clue, I thought I had that covered, but apparently not. I'll review the logic for handling those banners/ads.

@Anvil_DVR

Amazingly, I have 5 FireStick 4K Max devices and not one of them is showing a banner/ad in the guide anymore. One was, until recently, but it's gone now -- maybe that was the only one where I still had Internet Ads set to "on" in Preferences? I turned it off a few days ago, so maybe it takes time for the guide data containing those ads to work its way through.

Anyway, I'll probably need to rely on logs from you, as you add additional channels to the mix. Portainer-Container logs are quite useful, you just need to either download them or set the number of lines to 10000 and auto-refresh to "off" to be able to scroll back. Logs are accessed via a "Quick Actions" button, just like for exec'ing into a container.

I added more premium channels this AM for testing, and the device-specific M3U was created properly. Here's an updated livetv.m3u that includes HBO, Showtime and Paramount+ -- though I hid all the "junk" Paramount+ channels (just couldn't bring myself to bother with those).

If you want any of those channels, you'll probably need to get call signs and Gracenote IDs using the built-in Channels DVR method I described previously. Also, @chDVRuser created a script to extract those that you might find useful:

#EXTM3U

#EXTINF:-1 channel-id="5MAXHD" tvc-guide-stationid="59961",5StarMAX East
http://{{ .IPADDRESS }}/play/tuner/5MAXHD

#EXTINF:-1 channel-id="ACMAXHD" tvc-guide-stationid="59948",ActionMAX HD East
http://{{ .IPADDRESS }}/play/tuner/ACMAXHD

#EXTINF:-1 channel-id="MAXHD" tvc-guide-stationid="34933",Cinemax HD East
http://{{ .IPADDRESS }}/play/tuner/MAXHD

#EXTINF:-1 channel-id="MAXHDP" tvc-guide-stationid="35975",Cinemax HD West
http://{{ .IPADDRESS }}/play/tuner/MAXHDP

#EXTINF:-1 channel-id="SZEAHD" tvc-guide-stationid="72015",Encore Action HD East
http://{{ .IPADDRESS }}/play/tuner/SZEAHD

#EXTINF:-1 channel-id="STZENHD" tvc-guide-stationid="36225",Encore HD East
http://{{ .IPADDRESS }}/play/tuner/STZENHD

#EXTINF:-1 channel-id="HBOHD" tvc-guide-stationid="19548",HBO
http://{{ .IPADDRESS }}/play/tuner/HBOHD

#EXTINF:-1 channel-id="HBO2HD" tvc-guide-stationid="59368",HBO 2
http://{{ .IPADDRESS }}/play/tuner/HBO2HD

#EXTINF:-1 channel-id="HBOCHD" tvc-guide-stationid="59839",HBO Comedy
http://{{ .IPADDRESS }}/play/tuner/HBOCHD

#EXTINF:-1 channel-id="HBOFHD" tvc-guide-stationid="59357",HBO Family
http://{{ .IPADDRESS }}/play/tuner/HBOFHD

#EXTINF:-1 channel-id="HBOSGHD" tvc-guide-stationid="59363",HBO Signature
http://{{ .IPADDRESS }}/play/tuner/HBOSGHD

#EXTINF:-1 channel-id="HBOHDP" tvc-guide-stationid="19566",HBO West
http://{{ .IPADDRESS }}/play/tuner/HBOHDP

#EXTINF:-1 channel-id="HBOZHD" tvc-guide-stationid="59845",HBO Zone
http://{{ .IPADDRESS }}/play/tuner/HBOZHD

#EXTINF:-1 channel-id="MGMHD" tvc-guide-stationid="65669",MGM+
http://{{ .IPADDRESS }}/play/tuner/MGMHD

#EXTINF:-1 channel-id="MGMDRHD" tvc-guide-stationid="103828",MGM+ DRIVE-IN
http://{{ .IPADDRESS }}/play/tuner/MGMDRHD

#EXTINF:-1 channel-id="MGMHTH" tvc-guide-stationid="67929",MGM+ HITS
http://{{ .IPADDRESS }}/play/tuner/MGMHTH

#EXTINF:-1 channel-id="MGMMRHD" tvc-guide-stationid="74073",MGM+ MARQUEE
http://{{ .IPADDRESS }}/play/tuner/MGMMRHD

#EXTINF:-1 channel-id="MOMAXHD" tvc-guide-stationid="59373",MoreMAX HD East
http://{{ .IPADDRESS }}/play/tuner/MOMAXHD

#EXTINF:-1 channel-id="MOVIEHD" tvc-guide-stationid="59963",MovieMAX HD East
http://{{ .IPADDRESS }}/play/tuner/MOVIEHD

#EXTINF:-1 channel-id="OUTMAXHD" tvc-guide-stationid="59952",OuterMAX HD East
http://{{ .IPADDRESS }}/play/tuner/OUTMAXHD

#EXTINF:-1 channel-id="SHOWHD" tvc-guide-stationid="21868",Showtime
http://{{ .IPADDRESS }}/play/tuner/SHOWHD

#EXTINF:-1 channel-id="SHOWHDP" tvc-guide-stationid="22532",Showtime West
http://{{ .IPADDRESS }}/play/tuner/SHOWHDP

#EXTINF:-1 channel-id="STRZCIH" tvc-guide-stationid="67236",Starz Cinema HD East
http://{{ .IPADDRESS }}/play/tuner/STRZCIH

#EXTINF:-1 channel-id="STZCHD" tvc-guide-stationid="57569",Starz Comedy HD East
http://{{ .IPADDRESS }}/play/tuner/STZCHD

#EXTINF:-1 channel-id="STZEHD" tvc-guide-stationid="57573",Starz Edge HD East
http://{{ .IPADDRESS }}/play/tuner/STZEHD

#EXTINF:-1 channel-id="STZHD" tvc-guide-stationid="34941",Starz HD East
http://{{ .IPADDRESS }}/play/tuner/STZHD

#EXTINF:-1 channel-id="STZHDP" tvc-guide-stationid="34949",Starz HD West
http://{{ .IPADDRESS }}/play/tuner/STZHDP

#EXTINF:-1 channel-id="STRZIBH" tvc-guide-stationid="67235",Starz inBlack HD East
http://{{ .IPADDRESS }}/play/tuner/STRZIBH

#EXTINF:-1 channel-id="STZKHD" tvc-guide-stationid="57581",Starz Kids & Family HD East
http://{{ .IPADDRESS }}/play/tuner/STZKHD

#EXTINF:-1 channel-id="THMAXHD" tvc-guide-stationid="59954",ThrillerMAX East
http://{{ .IPADDRESS }}/play/tuner/THMAXHD

BTW, you can also run the createm3us.sh script manually device-by-device, rather than by restarting the container.

Exec into the container and run: ./scripts/firetv/livetv/createm3us.sh followed by a space and then the device name you want to generate the specific M3U for including the port number. In my case that would be: ./scripts/firetv/livetv/createm3us.sh firestick-desk1:5555, but I know you use IP addresses to identify devices on your LAN.

1 Like

I will look into those later today time permitting. I ordered another uray box and I found another firetv 4k max. Looks like I will have a bank of Chromecast, and a bank of Firetv depending on what I want to do.

So I added all the channels you listed.
It messed up the channel ID's big time, I think they were all wrong.
I manually corrected them and its working.

This is in the Log:

  • redEcho 'Device specific M3U creation may have been unsuccessful as the starting and ending channel IDs do not match.'
    Device specific M3U creation may have been unsuccessful as the starting and ending channel IDs do not match.
    Recheck that your LiveTV channel guide matches your livetv.m3u, hide unwanted sources and channels in the guide.
  • echo -e '\e[31m Device specific M3U creation may have been unsuccessful as the starting and ending channel IDs do not match. \e[0m'
  • redEcho 'Recheck that your LiveTV channel guide matches your livetv.m3u, hide unwanted sources and channels in the guide.'
  • echo -e '\e[31m Recheck that your LiveTV channel guide matches your livetv.m3u, hide unwanted sources and channels in the guide. \e[0m'

Only they do match.....
The entire log is too big to post here.

Apologies for you being the guinea pig, as far as user testing goes -- I appreciate it though!

The only way that ALL the IDs could be wrong is if the "scan" isn't starting at the top of the LiveTV guide. So far, I've been waking the device and then sending two LIVE_TV keypresses. I'm thinking this works for me because I always put the device to sleep, after I make any changes to it.

It's possible all that's needed here is a HOME keypress after the WAKEUP, as the WAKEUP does nothing if the device is already awake, and the LIVE_TV button may not work from all locations in the FireTV menu system. HOME should always work though, so I'll add that to sequence, which will be:

  • WAKEUP
  • HOME
  • LIVE_TV
  • LIVE_TV

The logs might help, but I guess there's no way to upload a file to this forum. Things would have been a lot easier if these IDs were universal -- but maybe they're not by design. We could always drop trying to generate this device-specific file automatically, and have it be the manual process. But, since it's been working for me, I think it's just a matter of figuring out what the two of us are doing differently.

No problem. Glad I can help.
This is a cool project!