cabernetwork / cabernet

Cabernet allows control of IPTV streams. Plugins supports DaddyLive, Pluto TV, XUMO, M3U/XMLTV.XML files (SamsungTV, STIRR, DistroTV, Plex TV)
https://cabernetwork.github.io
MIT License
154 stars 22 forks source link

Beginners setup, Having some trouble setting up my config.ini #78

Closed Nostradamus1973 closed 1 year ago

Nostradamus1973 commented 1 year ago

Good morning Everyone,

Unfortunately, I wasn't paying attention and I had posted this yesterday in a closed thread, this is(mostly) what I wrote:

I've been working with @cookieisland to get things rolling in Docker and he's been awesome, but, now I've gotten stuck on my config.ini file and it was conveyed to me that @rocky4546 is the best to try and figure out the mess I've gotten myself into. lol

Before I drop my config details on here, allow me to explain what's been happening with Jellyfin 10.8.9, the problems I'm experiencing are parts of my guide look good, except the numbering seems to resemble the meta data(I think for Xumo), if that makes sense. On other parts of my guide the icons are gone and others the channel name is there and the rest is void, and some have very generic EPG info like channel name only, if that makes sense.

config.ini:


[hdhomerun]
hdhr_id = 105029CB

[display]
theme = blueradiance
display_level = 3-Advanced

[tvguide]
enabled = True

[epg]
genre = normal
epg_prettyprint = True

[daddylive_default]
label = DaddyLive Instance
enabled = True
channel-import_groups = False
player-enable_url_filter = False
epg-prefix = 3000
channel-start_ch_num = 1

[tvguide_daddylive]
label = TVGuide DaddyLive
enabled = True

[daddylive]
enabled = True
epg-plugin = ALL

[m3u_default]
enabled = True
label = m3u_default

[m3u_PlexTV]
enabled = True
label = m3u_PlexTV
channel-m3u_file = https://i.mjh.nz/Plex/us.m3u8
epg-xmltv_file = https://i.mjh.nz/Plex/us.xml

[m3u_SamsungTV]
enabled = True
label = m3u_SamsungTV
player-tuner_count = 20
channel-m3u_file = https://i.mjh.nz/SamsungTVPlus/us.m3u8
epg-xmltv_file = https://i.mjh.nz/SamsungTVPlus/us.xml
epg-prefix = 4000

[plutotv_default]
enabled = True
label = plutotv_default
epg-plugin = ALL
channel-thumbnail = colorLogoPNG
epg-enabled = True
epg-prefix = 4500
channel-start_ch_num = 1

[tvguide_plutotv]
label = TVGuide PlutoTV
enabled = True

[plutotv]
enabled = True
epg-plugin = ALL

[xumo_default]
enabled = True
label = xumo_default
epg-plugin = ALL
epg-prefix = 5000
channel-start_ch_num = 1

[xumo]
channellistid = 10006
enabled = True
epg-plugin = ALL

[tvguide_xumo]
label = TVGuide Xumo
enabled = True

[m3u_samsungtv]
enabled = 1
channel-start_ch_num = 1

[m3u_plextv]
enabled = 1
epg-xmltv_file_type = xml
epg-prefix = 3500
channel-start_ch_num = 1

[tvguide_default]
label = TVGuide Instance
enabled = True

There you go, I know it looks VERY rough, but, I was trying a few different things in an effort to get things running properly.

Thank you :)

rocky4546 commented 1 year ago

Your config.ini looks like a pretty big mess. Cabernet allows you to configure how you want to, but it looks like you have chosen multiple configure types on top of each other. Also, you have shown a user error that I need to block. The section names in the config.ini must be all lower case and instance name has no special characters. You have upper case letters, dashes and underscores in the names.

To start, we need to determine how you want to handle channel numbers. You can use the start_ch_num or the epg-prefix, but not both. You, of course, CAN use both, but the results may be confusing. Here is the definition. start_ch_num, when changed, will renumber the channel numbers from the number given incrementing the channel number for each channel in the list. This is nice for providers like pluto that have channels that are spaced apart. plutotv has a range from 0 to 3450, but only contains 376 channels, so it might not be a good use of channel numbers to renumber them using start_ch_num. Using start_ch_num will renumber the channels from x to x+376. The issue is when a new channel appears, it will add it to the list with the channel number from pluto, so you could see duplicates. epg-prefix offsets the channel number, so if you have a epg-prefix of 4500, then the channels will go from 4500 to 4500+3450. If a new channel comes in, then it will not have a conflict since the start_ch_num was not used. Also, the status on the home page is based on the channel number in the channel editor, so it you use epg-prefix, the number on the status page will not match what is in jellyfin. If you use the start-ch-num, then the channel numbers will match.

Let me know which way you wish to proceed on the channel numbering.

rocky4546 commented 1 year ago

Both start at a certain number ( you said "this(start_ch_num) will start with 1"). The difference is epg-prefix just adds that number to the current channel number. start_ch_num RENUMBERS the channels starting at the number provided (basically compressing the channel number list). epg-prefix occurs between cabernet and the client while start_ch_num occurs within cabernet.

As stated above for pluto: "Using start_ch_num will renumber the channels from x to x+376. " while "if you have a epg-prefix of 4500, then the channels will go from 4500 to 4500+3450", which is a much larger range of channels used. You are correct. epg-prefix will just do an adjustment on the fly, so as channel numbers change or added from the provider, they will auto change to the client, unlike the start_ch_num. I find using high numbers like you are using means (when using start_ch_num), new channels end up at the start of the channel list, so it is obvious which ones are new.

Let us assume you are going with start_ch_num as you have indicated. The next step is to disable all instances except one. We will add one plugin at a time until all plugins are enabled and configured correctly.

So next question... which plugin/instance is the first one you wish to configure? Once you have decided that. Go to the data mgmt >Delete Instance and delete all instances for the plugin you are going to setup. Also, edit the config.ini and remove all lines associated with the plugin. Add back in only the two lines required to start working with the plugin. If the plugin is pluto, then add [plutotv_default] Label = PlutoTV Instance

Restart the app and double check that data mgmt has no listings for the plugin.
IMPORTANT: I assume you are using the HDHomerun interface to jellyfin and not the m3u interface.

rocky4546 commented 1 year ago

Make sure to cleanup the database with Data Mgmt so that only the plugin you are working on is listed. New feature is that when you install most plugins and restart the app, it will add a single instance for that plugin to config.ini.

Based on the above statements, I assume TVGuide is not listed in the Data Mgmt list? If so, lets configure Daddylive

1) There should be no instances of TVGuide listed under the EPG Providers. 2) TVGuide plugin should be installed as listed in the Plugins area 3) DaddyLive Setting = Change the EPG Plugin to Use: ALL 4) Daddylive Instance = leave Starting Ch Number alone for now. It only works once we have channels 5) Daddylive Instance = Enable it 5) Daddylive Instance = EPG days to load: 2

Restart the app. It should configure and turn on tvguide automatically and start creating the channel list and the EPG. Let it run.

Actually, it may not do anything until you restart twice...

Nostradamus1973 commented 1 year ago

Okay, it won't let me proceed after I tried: DaddyLive Setting = Change the EPG Plugin to Use: ALL It says: Updated [daddylive][epg-plugin] to ALL [daddylive][epg-plugin] EPG instances are not installed, aborting change

But, I'm going to try and move foward till I restart, if the changes won't apply because of the aborting then I'll install TVGuide...

Edit: I had to install TVGuide, after the restart, now the epg-plugin is set to ALL, and did these before restart: Daddylive Instance = leave Starting Ch Number alone for now. It only works once we have channels Daddylive Instance = Enable it Daddylive Instance = EPG days to load: 2

Nostradamus1973 commented 1 year ago

Channels are populating and showing up in channel editor. I just got a natural rush of dopamine, this has been a bit of a roller coaster ride for me over the last few days. LOL! Okay, what's next?

rocky4546 commented 1 year ago

Just be aware that if the tvguide plugin is installed, Cabernet will auto-enable it for daddylive. As stated above, it does require a few restarts to get the instance up and running, but it will do it without user intervention.

Now that you have channels, lets move the channels to the right numbers. This is a little complex, so follow this... Start_ch_num only engages when it changes. Once it changes, Cabernet will go through and update the channel numbers in the display field of the editor to the new channel numbers. Say you want them to start at 100. You change the number in the setting to 100 in daddylive, then go to the editor and you would see all the channels have changed. Changing them to 200, will do the same thing. Say you have a new channel that shows up and you want it to auto-renumber. Setting it to 200 again and hitting save will do nothing. To get it to execute, you need to change it, say, to 201 and then back to 200. That will then cause it to renumber the channel list again.

At this point, daddylive should be up and running. Go to JellyFin and see if everything is good...

Nostradamus1973 commented 1 year ago

Yes, I changed the starting number to 100, saved it, then went to the editor and the channels are now counting up from 100. With Jellyfin, I went to use the HDHomerun interface and couldn't get any of the HDHomerun links to work. Is there some specific way to get the links to work? Or, should I just stick with the m3u for the time being?

rocky4546 commented 1 year ago

When you add a HDHomerun link, you add it without the end part. With jellyfin, you can add by plugin or for all. I add with all myself in emby. So to add all, use http://ipaddress:6077/ for a plugin use http://ipaddress:6077/Daddylive/ Then you get to the xmltv.xml part, I use a file-based pull with a cron job, but for now, you can use the xmltv.xml url directly.

Sometimes these media servers don't like the last "/", but try some things and it should work.

Nostradamus1973 commented 1 year ago

Yes, that worked, it accepted the HDHR link, and I loaded the xmltv.xml I restarted Jellyfin and I don't see the channels or guide yet, so, I'm going to restart Cabernet and then Jellyfin again and refresh the guide data

Nostradamus1973 commented 1 year ago

Okay, restarting Cabernet and then Jellyfin did the trick. The guide is loading, however, only half of the channels have guide info, I didn't edit them down yet, but, Jellyfin can be difficult when it comes to accepting new guide info(something emby does much better), so, the rest may load at a later time. The numbers look great, they correspond to the ones in the channel editor. What's next?

rocky4546 commented 1 year ago

That is correct. Only about 70 channels will have guide data. the other channels are not listed in the tvguide site, so nope, they have nothing. You can keep all those non-us channels, but lets say you want to have the us channels.

Go to the Channel Editor > Thumbnail column and enter the word blank in the filter. this should filter to all those channels without a thumbnail. then click the top checkbox in the first column twice to remove the check box on all remaining channels and click Save Changes. this will give you the list of us channels that have guide data.

Nostradamus1973 commented 1 year ago

Okay, I just did that, that was really cool being able to do that so easily, I had to keep looking to make sure it was working. lol I just saved the changes, What's next?

rocky4546 commented 1 year ago

Before we move on... It would be appropriate to not increase the TVGuide data from 2 days to 14 all at one time, unless you want lots of attention from the provider... The recommendation is to increase the days slowly by adding 2 days every 24 hours. I have mine set at 10 days, but you can get it to whatever level you want.

So, the next plugin will be much easier. Shall we try the xumo and pluto or are we skipping those?

rocky4546 commented 1 year ago

add the next two lines in the config.ini for xumo_default and plutotv_default with their labels like we did with daddylive. Since we don't have dependencies with other plugins, when you reboot, the instance should appear (disabled) and ready to configure. In this case, I would recommend keeping everything with defaults for now. Enable both instances and restart. It should all come up and once you have the channel list, you will need to decide where to start the next set of channel numbers.

rocky4546 commented 1 year ago

Plutotv is special in that it filters out the commercials. This is because the "discontinuity" errors that are caused by them. In short the commercials are on a different timeline causing significant errors. To handle this, Cabernet removes the commercials. BUT... this causes many people pain since watching live will mean a black screen during commercials. If you record plutotv shows, the time will be shortened by the commercials and play as if they were never there.

If you go to the Cabernet home page, it will have a status of "Filtered" when this is happening on a tuner.

Nostradamus1973 commented 1 year ago

Okay, I added those 2 lines and got the xumo and pluto plugins to finally show up. It would probably be safe to start the next plugin after 400, that way there's slight overhead and less change of change affecting things, I think. LOL Pluto is next in line, so, I will start that at 500 and 900 for xumo. Would that work okay?

Nostradamus1973 commented 1 year ago

Okay, I changed the starting number of Pluto to 600 and 1000 for Xumo, now everything seems to look correct, albeit the guide is missing. Looks like we're back on track, I'm going to wait for you before I move onto the next step because this may act as a nice tutorial for other would-be Cabernet users.

Nostradamus1973 commented 1 year ago

I should probably list my config.ini at this point, maybe that will help other Cabernet users down the road and hopefully paint a better picture of what is going on with my EPG

[display]
theme = blueradiance
display_level = 3-Advanced

[tvguide]
enabled = True

[epg]
genre = normal
epg_prettyprint = True

[daddylive_default]
label = DaddyLive Instance
enabled = True
channel-start_ch_num = 100

[daddylive]
enabled = True
epg-plugin = ALL

[tvguide_default]
label = TVGuide Instance
enabled = True

[xumo_default]
label = XumoLive Instance
enabled = True
channel-start_ch_num = 1000

[plutotv_default]
label = PlutoTV Instance
enabled = True
channel-start_ch_num = 600

[xumo]
enabled = True
channellistid = 10006

[plutotv]
enabled = True

Thx again

rocky4546 commented 1 year ago

I found that JellyFin and Emby are doing something similar to Plex. It is using the URL as the channel number instead of the channel number, so some of the issues you are seeing is missed correlation between channel lists and EPG. You can see it by going to Jellyfin under settings for Live Tv, selecting Cahnnel Tab. Then edit one of the plutotv channels. You should see a very long uid shown instead of the channel number for the guide data channel.

To have a better correlation, I have a new version 0.9.12.07 that should help. Once upgraded, go to the Client Settings under EPG and change "Use Channel # for Channel ID" to true. No restart needed. All I did was go into Emby and request a guide refresh. Check the same thing in JellyFin again and this time the channel number should appear correctly.

Nostradamus1973 commented 1 year ago

After pulling/recreating the image I hadta reinstall the plugins, no biggie there. I did a systemctl restart of Jellyfin because the guide wasn't populating, that didn't seem to fix anything, which prompted me to restart Cabernet, one thing I did notice is that I am unable to refresh the EPG's and corresponding channels under scheduled tasks within Cabernet.

Could that be part of the problem too?

On a good note, the channel numbering looks perfect. :)

Nostradamus1973 commented 1 year ago

I take some of that back, I am able to refresh The Daddy Live EPG, but, not pluto or xumo, and as far as the channels, I can't refresh any of them(DaddyLive, pluto, xumo). I do have a some of the guide showing up for Daddy live, and nothing for pluto or xumo. Historically I've noticed Jellyfin can be difficult accepting new guide info, there are mentions of this caching issue online, however, after a restart or two, it will finally accept the new guide data.

Edit: I went into data managment(in Cabernet) and had it repull the channel and EPG and that fixed it. YEY! The guide is loading and channel numbering and etc look great!

Nostradamus1973 commented 1 year ago

Okay, now that it all looks great. What's next? M3U-plugin?

BTW, thanks, this is very educational for me and tackling these things one at a time is definitely best as you suggested, I'm actually enjoying myself on this tutorial you're giving.

rocky4546 commented 1 year ago

Looks like you are getting use to using Cabernet. Now for M3U. Unlike the unique plugins, M3U plugin is setup, generically. It is up to the user to determine the best settings, while the unique plugins have their default settings set to the best. Although, Cabernet internalproxy is very powerful, I have found streamlink to be a good app for novices. Streamlink uses the URL it is sent to determine which of many plugins it uses to connect to the provider. So, in a sense, it auto-sets the configuration of streamlink based on the URL.

Streamlink is not installed as part of Cabernet, so you should do that. It needs to be the latest version (5.x) to work. There is some info on the forum on how to install it, but I believe using python pip works. Once you have it installed, you need to check if it works with cabernet. Try setting daddylive to streamlink and then trying a channel. Watch the logs to see if there is any issue and the video plays.

The most recent Dockerfile_tvh_crypt.alpine file has it auto-install, so you may have it installed in your docker already...

Also, be aware that Channel and EPG updates have a minimum timer to keep users from spamming the request and killing the provider. The way to kick it is the way you did. Go to Data Mgmt and reset the appropriate channel or epg. Then request the update.

cookieisland commented 1 year ago

After pulling/recreating the image I hadta reinstall the plugins, no biggie there.

The reason you had to reinstall the plugins is because your docker-compose.yaml only maps the cabernet data directory which is /app/data. Therefore every time you pull a new docker image you will have to reinstall the plugins because the new docker image will have an empty /app/plugins_ext directory which is where the plugins are stored. At minimum I recommend also mapping a directory on your host to /app/plugins_ext and then you will not have to reinstall the plugins after every docker pull. Better yet I recomemend you map the entire cabernet directory to /app (which includes both /app/data and /app/plugins_ext) because that will avoid a problem where you will run out of disk space in the future (it will take quite some time but you will ultimately run out of disk space).

If you decide to map /app the important thing will be you need to make sure save/move your current docker /app/data directory and make it the data directory of your new docker /app directory. Otherwise you will lose all the configurations you have done to cabernet with all of rocky4546's help.

Nostradamus1973 commented 1 year ago

Thx @rocky4546 and @cookieisland for getting back to me.

I'm running version 0.9.12.07, so, would that mean streamlink is installed? I don't see it in Ubuntu, but, given that the docker is self contained, I'm probably missing it.

@cookieisland Once I have this config.ini running smoothly, I'm down to wipe it and do it your way; I usually take advice from seasoned user's/creator's, I just wanted to make sure this was going to make my life easier, which, it looks like it definitely will, that-being-said, there are so many OTHER things it does well, which has me all-in on it. I think a good week of use and I'll probably start fresh your way.

So, if Streamlink is installed. What's next?

rocky4546 commented 1 year ago

As stated above, test it by setting daddylive stream type to streamlink and try playing a channel while looking at the log file.

Nostradamus1973 commented 1 year ago

I'm sorry, I got ahead of myself, I hadta enable the logs to verify that Streamlink is working:

2023-04-12 18:45:12,158-INFO:streamlink_proxy Serving

What's next?

rocky4546 commented 1 year ago

We will have a few things to setup AFTER getting the M3U up and running, like schedule updates of the channels and EPG, but before that, change daddylive back to internalproxy and setup our first m3u instance in the config.ini. Restart the app and then configure the instance. Try setting:

  1. The stream to streamlink
  2. Enter the url for the m3u8 file (either compressed or not
  3. Leave the file type to autodetect. (it works like MS Windows by using the trailer of the filename)
  4. Change the "Non-VOD Segments to Start" to a higher number if you want more buffering. It is normally about 5 seconds per segment. If you enter 100, then it will send as many as the provider lists up to 100. Normally, this is a number between 2 and 6 segments from the provider.
  5. Enable PTS/DTS Resync is normally enabled, but you can try disabled first and if you don't get time issues (like a 30 min recording is listed as 10 hours long), then it would be better turned off. It basically tries to resyncs the timestamps using ffmpeg.
  6. Enter the URL for the xmltv.xml file

Once all that is done, enable and restart.

Now you can go through the same procedure you did before checking the channel editor, moving the channel numbers, confirming you have EPG data and pushing the info to the client.

Also, you can try to set the stream type to m3uredirect. This causes cabernet to send the m3u8 data to jellyfin and assume it will connect directly to the provider. Cabernet does nothing in this case. Some media servers cannot handle the direct stream, but you can try it. Some like the m3uredirect for m3u instances.

Oops, forgot a few other items.

If the m3u file contains tons of channels, you may want to filter out some during import. This is done with the M3U Filter. It has a tool tip that explains how to use it.

Emby and Jellyfin do not import groups, but if you had a media server or DVR that did, then entering a group name for this M3U instance would be a good idea. The tag would then be used by the DVR to group the set of channels to this instance. Import Channel Groups does not seem to be very effective for me, but some like to group all news channels across instances.

Decode M3U8 URL is for URL Filtering. If you find that the M3U channels are adding ads to the stream outside of the stream (like from google), this setting will help identify the text in the log needed to filter out those ads.

Nostradamus1973 commented 1 year ago

Okay, I've been playing around with some settings after adding the m3u's for plex and samsung, I even tried the m3uredirect without much luck, but think I will revisit that setting at a later point. I do have one more question before I gotta head out for the night. Now that I have the two m3u's(plex/samsung) loaded under one master m3u in the channel editor, I can't seem to save any of the channels when I try to tick to enabe/disable, so, it's loading the entire channel set's for plex and samsungtvplus at the moment. Could this be a bug? The channels I edited prior to the update I can no longer change either. Or, could I have messed up the config.ini? Are the plex and samsung supposed to be separated in the channel editor? Thx

Nostradamus1973 commented 1 year ago

Right on, the upgrade worked and that fixed the problem. Edit: BTW, Thank you, I was rushing and forgot the most important part, my gratitude. :) I'm gonna edit those channels quickly. Is there a next level on this tutorial? Or, am I good to explore for the time being?

rocky4546 commented 1 year ago

Still wondering which files you used. Basically wondering how many channels you tried to import into the M3U plugin.

Next on the list is the scheduler. It is currently empty (except for startup). Since each m3u and xmltv.xml file has a different required update rate, you need to determine how often to update the data from the URL provided.

I use two factors when deciding the EPG update rate. One is the amount of data provided. If you get 4 hours of EPG, you would need to pull the data at a short interval (like once an hour). If you get 1-2 weeks of data, then pulling daily may be more appropriate. Then, there is the update rate of the provider. If he updates it at 1:53am every day, then you would want to pull it some time after that point. If he updates it every hour, then that may be important.

For the channels, I normally believe updating once a day seems good in most cases. Just determine when to do it. If you are updating the EPG daily, then doing the channel updates prior to the EPG updates would be the right thing to do.

Nostradamus1973 commented 1 year ago

I think I understand, I had a similar situation with a script that ported ustv-go, they(ustvgo) scrambled the channels twice an hour so, the script would update twice and hour and I would do the same on my end with the guide twice an hour and then more 4 times an hour. So, instead of one, I have to take into consideration 4+, and instead of using Jellyfin, I'll be using Cabernet. So, if Cabernet does all the heavy lifting, then cabernet & Jellyfin would only need to update for whichever m3u has the shortest lifespan. I think. lol I gotta run out to eat, but, I'll be back in roughly 2 hours. Thx again

rocky4546 commented 1 year ago

And something you may want to do... once you get days of daddylive EPG and all the M3U instances imported, you may find that it takes a very long time to push the entire xmltv.xml file to Jellyfin. Due to this, Jellyfin may timeout. If this happens, you can setup a cronjob between Cabernet and Jellyfin to pull the xmltv.xml file every so often. I then find the media server can pull the xmltv.xml file in seconds. Biggest issue is all the timing of how often and when to pull what. Since I have multiple media servers like TVHeadend and Emby, I use the cronjob to pull the xmltv.xml file once and then tell all the media servers to get that file from the system.

Also, if you turn prettyprint off in the Client EPG settings, it will go much faster.

Nostradamus1973 commented 1 year ago

Okay, good to know about the cronjob, I have a pretty fast connection, so, that might help mitigate the problem, but, I know it's also dependent on who's serving up the info, so, I will keep an eye on the logs of JF. Is there a timetable(on the web) I can access that will tell me how often the providers are changing things up and how long each retains the guide? Or, is this the sort of thing that requires finesse and must be done relative to the feedback(info/lacking-info) of each provider?

rocky4546 commented 1 year ago

All are different. The site https://i.mjh.nz/ has timestamps that let you know when an update has occurred.

Nostradamus1973 commented 1 year ago

Ahhh, thanks for that tip. I'm having an absolute blast playing with Cabernet right now, that I lost track of time. lol Okay, I will take a look at those timestamps and see what I can surmise from them. Thank you @rocky4546, you and @cookieisland have done a great job conveying these steps, ideas, and concepts so I could understand them. I have to head out again, but, I should be on in the AM to look up those times. If I get stuck in the next day or two I'll pop back in here; I'm going to run it a week(maybe sooner) if things continue going smoothly I'm going to set it up like @cookieisland suggested and make it a permanent addition.