Project

General

Profile

IPTV Mux Update

Added by Tony Leach about 2 years ago

My IPTV supplier will not allow access to streams except through their supplied app (Firestick) however I prefer to use TVheadend and Kodi so I can add access the streams to create a single user interface.

Some time ago I spent many hours finding the ts stream URLS and creating individual muxes similar to the format below:

http://&lt;server address>/<Username>/<password>/bbc1.ts
http://&lt;server address>/<Username>/<password>/bbc2.ts (etc)

My supplier has now changed my password so I am faced with the prospect of manually editing all of the muxes that I have created which is obviously something I am keen to avoid.

Is it possible to avoid this? I am assuming the mux information is stored at the following location /hts/.hts/tvheadend/input/iptv/network/1611..../muxes but the files seems to be encrypted so I am unable to write a script to modify the information directly which would probably be the easiest way to change the password across multiple files.

Does anyone know how to access these files or point me in a better direction?

Thanks


Replies (4)

RE: IPTV Mux Update - Added by Jonas Lang about 2 years ago

It doesn’t look like there is according to this https://tvheadend.org/boards/4/topics/28434

RE: IPTV Mux Update - Added by Tony Leach about 2 years ago

So I have managed to find a way to make this somewhat less labour intrusions using a python script hosted at the following Github location:
https://github.com/tvheadend/tvheadend/blob/master/lib/api/python/tvh-json.py

Initially the script would throw an error but I was able to modify line 155 from:

jdata = json.loads(jdata.decode('utf-8'))
to
jdata = json.loads(jdata)

to export the muxes from TVheadend use the following command:

TVH_USER=<replace with TVheadend username> TVH_PASS=<replace with password> python3 tvh-json.py exportcls iptv_mux> outputfile
E.G TVH_USER=me TVH_PASS=mypassword python3 tvh-json.py exportcls iptv_mux> output.json

I then did a simple copy and replace and then imported back into tvheadend using the following command

TVH_USER=<replace with TVheadend username> TVH_PASS=<replace with password> python3 test.py import < outputfile
TVH_USER=me TVH_PASS=mypassword python3 tvh-json.py import <output.son

Obviously this requires that Python3 be installed. Thanks to perexg for providing the script

RE: IPTV Mux Update - Added by joe blow about 2 years ago

might be easier to use:
https://github.com/bebo-dot-dev/m3u-epg-editor
then feed that into tvh, just change your user/password in the .json file, in addition your able to trim the file to only what you want

RE: IPTV Mux Update - Added by Jamie Nazaroff about 1 year ago

I'm a bit late to this party, but for those who may have a similar issue…

After having my IPTV change my connection password a few times, I set up a system where I forward to an Lighttpd server on the same system that redirects with the proper username and password in the URL, added to the config:

$HTTP["host"] =~ "192.168.0.xxx:1234" {
url.redirect = (
^/iptv/(.*)$" => "https://iptvsuppliersurl.com/[username]/[password]/$1"
)
}
…in combination with a python script that re-writes the url from the m3u to create a new playlist.

So for instance, a url for a given channel is "https://iptvsuppliersurl.com/[username]/[password]/83488348"

the script will re-write it to "http://192.168.0.xxx:1234/83488348" for the playlist that TVH reads.

This way, if the passwords change again, nothing in the mixes TVH gets will change at all. The only important piece of information is that tailing number (IPTV channel ID).

    (1-4/4)