Jump to content

Channels are not oredered by the m3u file order


Yodikko
Go to solution Solved by Carlo,

Recommended Posts

The problem is pretty simple. When I add the m3u and go to channels, Emby doesn't order the channels how they should be (they are ordered on the m3u and on any IPTV player they have the same order). Is there a way I can do it automatically or at least manually? Without creating a collection or stuff like that?

Link to comment
Share on other sites

  • Solution

Do you have tvg-chno (channel number) tags in the m3u file?

If you do something like this they should sort by channel number.

#EXTM3U
#EXTINF:-1 tvg-chno="1",Channel Name for 1
http://IP:PORT/live?channel=1&client=1
#EXTINF:-1 tvg-chno="2",Channel Name for 2
http://IP:PORT/live?channel=2&client=2
#EXTINF:-1 tvg-chno="3",Your Channel Name for 3
http://IP:PORT/live?channel=3&client=3

 

  • Thanks 1
Link to comment
Share on other sites

#EXTINF:-1 tvg-ID="" tvg-name="X" tvg-logo="" group-title="X",X
http://x

I have like this. Should I add the number in tvg-ID="1" ?

Edited by Yodikko
Link to comment
Share on other sites

'I'd try what I mentioned above.

Make it simple and grab 10 channels from your M3U file and use them as a test.  This way you can try a couple of different things pretty quickly.

Link to comment
Share on other sites

Just like shown.  There can be other tags as well but what's shown will give you the channel number and the Name/Description of the channel.

Link to comment
Share on other sites

Oh okkey but editing one at time will be a pain in the ass 😰

I tryed even a software last time that put channels id into m3u, sadly it didn't worked and changed nothing in the file lmao

Link to comment
Share on other sites

This is why I suggest working with a small test batch of say 10 channels.

Find out what works correctly for your provider. Then once we know if this fixes your issue we can maybe find an automated way to do this for you such as using xTeVe or similar program.

But for now it's easiest to try this by hand on a small test file.

Link to comment
Share on other sites

10 minutes ago, Yodikko said:

Yesss it worked!! Thanks ❤️

Now, is there a way to do this automatically with a software?

Can you send me a copy of your M3U file via PM and let me take a look at it's format?
I don't need your username/password so feel free to change them.

Link to comment
Share on other sites

I sent you back a revised m3u file for you to try.
If this works I'll post a vbscript that can be ran on Windows to add the channel numbers to any m3u file.

Link to comment
Share on other sites

Glad it worked (from PM).  I wrote a small vbscript that can be used for your m3u file or can be easily adapted by anyone else for their needs.

inputfile = "Original.m3u"
outputfile = "New.m3u"

Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile(inputfile)
Set f2 = fso.CreateTextFile(outputfile,True)
c=1

Do Until f1.AtEndOfStream
	s=f1.ReadLine
	if InStr(1, s, "#EXTINF:-1 ") then
		s=Replace(s,"#EXTINF:-1 ","#EXTINF:-1 tvg-chno=""" & c & """ ")
		c=c+1
	end if
	WScript.Echo s
	f2.writeline(s)
Loop

f1.Close
f2.Close

Copy the contents and add it to a file with a vbs extension such as channels.vbs.

Edit the input and output file names at the top of the script.

Now open a command prompt (DOS) and navigate to where you put this file and enter

cscript channels.vbs
Change the file name above to match what you named it.

 

Let me know if you have any trouble with it or have any additional issues.

Carlo

Edited by cayars
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...