Shouldn't be, I have those "ads" too, and I'm accounting for those in the script.
Looks right to me, and actually matches your first attempt, with the exception of the first record. If you updated the ah4c:prime image, hopefully you're seeing some better results now.
EDIT: From here forward, you should have CREATE_M3US set to false. No reason to recreate this file on every container launch, unless you actually need to generate a new device-specific M3U for whatever reason.
Something I just thought of, that might be tripping you up, is that you need to do a "Reload M3U" from the Channels DVR settings page for this specific source, every time you make a change to the "master" (livetv.m3u) and want to test. This is a Channels DVR requirement.
No, its not working.
Seems to always pick the wrong channel.
5 star max and actionmax works, the rest mess up.
Yes I do this....
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.
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. 
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?
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.

