Plex Live TV Channels M3U?

I upgraded back to 1.08 after going back to 1.06... however, with 1.08 my NAS never downloads guide information. It just stays blank. It only seems to work when I'm on 1.06.

Would need logs to diagnose

1 Like

Here you go - I have data appearing in my guide only from 8pm-11pm now. Nothing for now through 8pm.

Initialize XML File,
Run channels to load self.channel_list,
New token for local generated at 2024-03-19 18:55.51 +0000,
Day One Initialization of EPG data,
Retrieving local EPG data for 2024-03-19 through 2024-03-19,
Continuing to retrive local EPG data....Elapsed time: 66.45 seconds. 150 Channels parsed,
Continuing to retrive local EPG data....Elapsed time: 138.74 seconds. 300 Channels parsed. Please wait,
Continuing to retrive local EPG data....Elapsed time: 205.40 seconds. 450 Channels parsed,
Retrieving local EPG data complete. Elapsed time: 240.22 seconds. 538 Channels parsed.,
⇨ http server started on [::]:5555,
Retrieving local EPG data for 2024-03-20 through 2024-03-20,
Continuing to retrive local EPG data....Elapsed time: 36.02 seconds. 150 Channels parsed,
(None, 'HTTP failure 429: {"Error":{"error":"Too Many Requests","message":"Rate limit exceeded!","statusCode":429}}'),
Retrieving local EPG data for 2024-03-20 through 2024-03-20,
Continuing to retrive local EPG data....Elapsed time: 21.02 seconds. 150 Channels parsed,
Continuing to retrive local EPG data....Elapsed time: 54.06 seconds. 300 Channels parsed. Please wait,
Continuing to retrive local EPG data....Elapsed time: 90.34 seconds. 450 Channels parsed,
Retrieving local EPG data complete. Elapsed time: 106.66 seconds. 538 Channels parsed.,

1 Like

I'm seeing the same issue as @radioboy in v1.08a. v1.08 seems to be working for me, though, as did v1.06. Logs didn't really say much other than the usual retrieving local EPG data. Basically, the XML only had a very tiny amount of guide data, even though it took all the usual times to retrieve.

Docker run for reference:

docker run -d --restart unless-stopped -p 7971:7777 --name plex-for-channels -e PLEX_CODE=local ghcr.io/jgomez177/plex-for-channels:latest
1 Like

The only difference between 1.08a and 1.08 was a correction on an error handling case where I didn't have the correct arguments so should be no difference in the EPG data if pulled without an error, however will investigate

Think I found the issue (incorrect indentation was introduced in 1.08a)
Should be corrected

1 Like

Thank you @joagomez for this solution....totally resolved the majority of my plex issues. I do have two questions regarding guide data and automatic channels.

  1. Guide data - I find for the most part the guide data matches what is playing on the plex app, except for a few channels - but I'm guessing that's a plex thing more than a Channels/Gracenote thing ??. Whatever Channels guide info shows for a channel(s) is seemingly in sync with plex.tv - but what is showing on the Plex app might be different.

  2. Automatic channels - The automatic channels feature doesn't see to work with the Docker solution. I can switch back to non-Docker - "i.mjh.nz - problem" configuration and automatic channels pop in.

The Docker M3U doesn't seem to matter - /plex/local/playlist.m3u or /mjh_compatible/plex/local/playlist.m3u (currently using) or either of the Gracenote include/exclude - none of these work with automatic channels.

2 Likes

Can you provide examples?

With regard to item 1.
All EPG data for the XML is pulled directly from the API calls, not Channels or Gracenote, so would normally be the same as what is presented in the web browser. The only time there may be a difference is if Plex updated their data after being pulled within the docker. To counter that I have the docker update on a given interval (currently set to 4 hours) to ensure the data is relatively current

With regard to item 2.
I do not see an issue with automatic channels. However this may be how you have your automatic channels set up and what Plex identifies as the category

To confirm I just tested several Automatic collections using the Following:
Music, Movies, Sports, and I created for "History + Science"
All worked as expected. For example the EPG data

  <programme channel="5e20b730f2f8d5003d739db7-64106a1075be345a863fe0d7" start="20240325161500 +0000" stop="20240325170700 +0000">
    <title>Fifth Gear</title>
    <sub-title>Fifth Gear</sub-title>
    <episode-num system="onscreen">S26E06</episode-num>
    <desc>The team investigate car culture in Romania, testing extreme off-road vehicles in its countryside and ski resorts and meeting a classic car restorer in Bucharest.</desc>
    <icon src="https://metadata-static.plex.tv/7/gracenote/76af0884763033d445dff30abc917e29.jpg" />
    <date>20150806</date>
    <category>Auto</category>
    <category>Consumer</category>
    <category>Documentary</category>
    <category>Lifestyle</category>
    <category>History + Science</category>
  </programme>

Matched the 'History + Science' automatic channel

Keep in mind these are the categories presented by the Plex API so may not be what you are expecting

Thank you...I have re-tested and I do see automatic channels working - seems to make a difference which M3U is referenced from the Docker:

Automatic channels work:
/mjh_compatible/plex/local/playlist.m3u
/plex/epg/local/epg-local.xml

No automatic channels:
/plex/local/playlist.m3u - no automatic channels
/plex/epg/local/epg-local.xml

Thank you for your help!!!!

Again, I cannot reproduce the issue you are having and there is not a difference in how channels would work with one playlist over another.

All automatic channels I have created using Genre, Keyword and Content Type work mostly as I would expect them to and finding matches to the automatic channels. That said I did find a discrepancy when doing my testing...

Example 1:


Example 2:


These examples clearly list different items because of the data in the XML provided.

Looking at one entry on HBCUGO this entry appears in Example 1 but not Example 2

  <programme channel="5e20b730f2f8d5003d739db7-631a212e82b744e0309aa56e" start="20240403140000 +0000" stop="20240403160000 +0000">
    <title>Women's College Basketball</title>
    <sub-title>Kentucky State at Tuskegee</sub-title>
    <episode-num system="onscreen">2024-01-13</episode-num>
    <desc>From James Center Arena in Tuskegee, Ala.</desc>
    <icon src="https://metadata-static.plex.tv/d/gracenote/d3db815d774734aa647036d425f71e66.jpg" />
    <date>20240113</date>
    <category>Basketball</category>
    <category>Sports event</category>
    <category>Sports</category>
  </programme>

I can only assume that the second example didn't match as it looks at the first listed category which is Baskeball in the example above (and I can get it to match when I use genre of Basketball, but not Sports event, or Sports). However this logic to check all is in the Content Type. (@tmm1 is my understanding correct here and can this be adjusted to match any category listed in a programme?)

Please provide an example of the automatic channel you are using along with example of what is "working" and what isn't

1 Like

Weird issue tonight @joagomez ... a big chunk of Plex guide data in the middle of my channels has stopped loading and won't load even when trying to refresh the info... any ideas? Here's what it looks like:

What do the docker logs say?

Just guessing here as the time is about 0:00 UTC time that you are missing data for the channels is that there was an error loading the data for 4-16 UTC (Plex uses UTC) and did not complete. I would assume that would completed on the next pull of data. I may need to put an option to force a repull from Plex as well to complete when this happens

1 Like

That seems to be maybe what happened... the next pull of data, and it's all back to normal with full guide info.

I think I have a Gracenote ID for one of the Plex channels that isn't in the Docker's Gracenote=include list. Hopefully this is the right place to post it.

FamilyTime seems to match 1:1 with Gracenote ID 127467

I hope this helps!

I'm running the latest version of @jaogomez's plex-for-channels docker (v1.09), and lost all my channels this morning...

I restarted the container, and tailed the docker log.. received this when trying to access the m3u:

[2024-05-22 20:34:47,445] ERROR in app: Exception on /plex/local/playlist.m3u [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 1463, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 872, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/pywsgi.py", line 105, in playlist
    tmsid_stations = list(filter(lambda d: d.get('tmsid'), stations))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Is this a configuation issue on my end, or has something changed on the backend of Plex? Is anybody else having a problem?

Thanks in advance...

I was not having this problem but decided to rebuild my container just in case. and again no problems so seems like an issue with your container??

This does indicate I forgot an error check condition as it appears your container is having a problem pulling the station data, thus the NoneType

1 Like

I removed the container and the image and reinstalled it, and the issue persisted. Might I have an issue with my config?

This is what I did to reinstall it:

docker stop plex-for-channels
docker remove plex-for-channels
img=`docker images | grep plex-for-channels | tr -s ' ' | cut -d ' ' -f 3'
docker rmi -f $img
docker run -d --restart unless-stopped -p 8177:7777 -e PLEX_CODE=us_west --name plex-for-channels ghcr.io/jgomez177/plex-for-channels

I also deleted my source configuration in channels and recreated it under a different source name to see if there was something corrupt in the configuration within channels causing this. Same behavior, and because there was no .m3u provided back to channels, it will not add the source.

i updated the docker to add more error handling. This may give more insight into the issue

2 Likes

while error handling is good, in this case there's less information to be had... now, the docker log shows nothing and Channels will not add the channel, but pops up the following error:

##### invalid source url: Get "http://100.76.165.112:8177/plex/us_west/playlist.m3u": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

So, there is a change in behavior, but it doesn't look like it provides much assistance.

I'm no Docker expert, but have decades of (9+ year old) IT experience... is there anything I can do to assist you in debugging?

1 Like