Tubi for Channels docker

Because I'm now addicted :slight_smile:

I've now created a Tubi for channels docker

docker run -d --restart unless-stopped --network=host -e TUBI_PORT=[your_port_number_here] --name  tubi-for-channels ghcr.io/jgomez177/tubi-for-channels
https://github.com/jgomez177/tubi-for-channels/pkgs/container/tubi-for-channels
8 Likes

Excellent! I'll give it a spin tomorrow.

1 Like

I'm getting an error that says the resource is restricted.

Made the code public... forgot to make the package public...try now

1 Like

Excited to try this out. Tubi has some great content

1 Like

I just tried the docker and it works good.
I did notice that it took a bit to bring up Fox 11 news and Kartoon Channel.
Tubi has some great stuff for watching liveand on demand.

1 Like

I just gave this a try and I get

XML file not found

when i try to navigate to the epg url in my browser

Not sure if the container logs are useful but I will include below just in case

 http server started on [::]:8888

[INFO] Reading channel id list cache

[INFO] Retriving EPG Data

[INFO] Initialize channel_list

[INFO] Number of streams available: 258

[2024-02-22 04:56:16,893] ERROR in app: Exception on /tubi/playlist.m3u [GET]

Traceback (most recent call last):

  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 816, in generate

    yield from self.raw.stream(chunk_size, decode_content=True)

  File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 1040, in stream

    yield from self.read_chunked(amt, decode_content=decode_content)

  File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 1184, in read_chunked

    self._update_chunk_length()

  File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 1119, in _update_chunk_length

    raise ProtocolError("Response ended prematurely") from None

urllib3.exceptions.ProtocolError: Response ended prematurely

During handling of the above exception, another exception occurred:

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 82, in playlist

    stations, err = providers[provider].channels()

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/app/tubi.py", line 150, in channels

    error = self.read_epg()

            ^^^^^^^^^^^^^^^

  File "/app/tubi.py", line 136, in read_epg

    response = session.get(f'https://tubitv.com/oz/epg/programming', params=params)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 602, in get

    return self.request("GET", url, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request

    resp = self.send(prep, **send_kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 747, in send

    r.content

  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 899, in content

    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 818, in generate

    raise ChunkedEncodingError(e)

requests.exceptions.ChunkedEncodingError: Response ended prematurely

[INFO] Updating channel id list

[INFO] Number of streams available: 258

[INFO] Retriving EPG Data

[INFO] Channels: Available EPG data: 258

[INFO] Channels: Number of streams available: 258

[INFO] Updating channel id list

[INFO] Number of streams available: 258

[INFO] Returning cached EPG Data

[INFO] Channels: Available EPG data: 258

[INFO] Channels: Number of streams available: 258

[INFO] Updating channel id list

[INFO] Number of streams available: 258

[INFO] Returning cached EPG Data

[INFO] Channels: Available EPG data: 258

[INFO] Channels: Number of streams available: 258

[INFO] Updating channel id list

[INFO] Number of streams available: 258

[INFO] Returning cached EPG Data

[INFO] Channels: Available EPG data: 258

[INFO] Channels: Number of streams available: 258

[INFO] Updating channel id list

[INFO] Number of streams available: 258

[INFO] Returning cached EPG Data

[INFO] Channels: Available EPG data: 258

[INFO] Channels: Number of streams available: 258

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Updating channel id list

[INFO] Number of streams available: 258

[INFO] Returning cached EPG Data

[INFO] Channels: Available EPG data: 258

[INFO] Channels: Number of streams available: 258

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

[INFO] Returning cached EPG File

Looks like the first time it tried to read the EPG data it had an issue with the URL. But subsequent attempts appear to have succeeded.
Did you try again to pull the XML again ?

I had to restart the Container, and then it created the EPG XML. When I initially created the Container, it was the same as @slampman and the file did not get built.

However, even afterwards, some of the stations contained no guide data (checked in the XML file to confirm and I didn't find any for a few of these stations I checked):

image

Also, in the Gracenote Stations, I don't believe America's Test Kitchen is using the right TMSID:

image

image

image

TMZ and Top Gear also have generic placeholder data, but the TMSIDs look right to me, so not sure what's happening there. Top Gear does have a couple of other options, though.

Otherwise, working beautifully so far in some limited testing!

1 Like

Well thanks to a bad indent in my code it wasn't reading in the manual changes I was applying to the tmsid data being pulled in. This should fix America's Test Kitchen, TMZ and Top Gear and TV One Crime & Justice (as the tmsid data pulled directly from Tubi is incorrect and was to have been corrected with the tubi_tmsid.csv file)

As for stations like Boston 25, CBC, and others that don't have EPG data, that's what it is - they don't have EPG data...Even confirmed on the Tubi web site. They just don't have any. Not very many are that way (mostly News stations)

1 Like

This spin-up worked very nicely for me -- thanks @joagomez! I did need to restart the container to get the XML data, but I didn't end up using it, as I went with the playlist containing Gracenote Station IDs.

Here's the Portainer-Stack I went with, along with the Custom Channels setup:

version: '3.9'
services:
  tubi-for-channels:
    image: ghcr.io/jgomez177/tubi-for-channels:${TAG}
    container_name: tubi-for-channels
    ports:
      - ${HOST_PORT}:${TUBI_PORT}
    environment:
      - TUBI_PORT=${TUBI_PORT}
    restart: unless-stopped

And, the environment variables for use in that section of the stack:

TAG=latest
HOST_PORT=7778
TUBI_PORT=7777

Custom Channels setup:


Everything's been tuning really quickly in my limited testing, and other than a few local news channels and NFL Redzone, all the guide data appears to be there. Looks like a winner!

2 Likes

I appreciate you always posting the Portainer stacks. Between those and your Olivetin Docker, it really makes it dead simple to set things up.

1 Like

For CBC News Explore, try using CBCNEWS (122185)
For Top Gear use TOPGEAR (126329)
For TMZ use TMZFAST (149408)
For Boston 25 News, use WFXTSTR (127887), the other Cox owned local news stations also have Gracenote entries: KIROSTR (127886), WPXISTR (127885), WHIOSTR (127884), WJAXSTR (127883), WSOCSTR (127882), WFTVSTR (127880), WSBSTR (127879)

They also have listings for the FOX O&O news streams:
KMSPFST (150383), KTBCFST (150384), WITIFST(150385), KRIVFST (150386), KSAZFST (150387), WTTGFST (150388), KCPQFST (150389), WNYWFST (150390), WTVTFST (150391), KTTVFST (150392), WJBKFST (150393), KDFWFST (150394), WAGAFST (150395), KTVUFST (150396), WOFLFST (150397), WFLDFST (150466), WTXFFST (150467)

Unfortunately they don't have listings for the Scripps owned streaming news stations like WTVR, Tegna's "plus" streams, or Hearst's "Very Local" streams.

Many show specific FAST channels are customized for each provider. They do have entries for some of Tubi's custom edits with callsigns that start with "XTB", but it's mostly limited to the ones programmed by FilmRise.

They don't have a listing for Tubi's edit of Test Kitchen, just the ones for Xumo and Freevee/Prime

THIS IS AWESOME

and using it is crashing out my channels lol

The Tubi docker is working great.

I just set this up but I am not getting any guide data.

using ...

http://192.168.50.93:7778/tubi/playlist.m3u
and
http://192.168.50.93:7778/tubi/epg.xml

image

Restart your container once and the XML data should start showing up. Alternatively, use the playlist with Gracenote Station IDs and you shouldn't need the XML data.

Thanks that worked.

1 Like

This sounds to be a recurring issue with folks and the order of operations.
Will update the initialization of the XML file similar to what I did in the plex container.