Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the tvg-name attribute value from the M3U file to create EPG xml data #42

Closed
mwlistscom opened this issue Jan 18, 2020 · 17 comments
Closed
Assignees
Labels
feature request A new feature request

Comments

@mwlistscom
Copy link

Many PPV/NHL/NBA/NFL do not have a EPG entry .

Usually stored in: tvg-name in the m3u, for example:

tvg-name="[PPV-4] ALVAREZ VS SEALS UNDERCARDS 7PM ET"

Usually used with ""no_tvg_id": true"

@bebo-dot-dev bebo-dot-dev added the pending feedback Pending feedback from the person who created an issue label Jan 18, 2020
@bebo-dot-dev
Copy link
Owner

Is this a statement or a question? If something isn't working as expected, please describe the problem in terns of what you see and what you expect to happen. Needs more info.

@mwlistscom
Copy link
Author

It's a RFE. If there is no EPG for a channel, use the m3u "tvg-name" name for the EPG.

@mwlistscom
Copy link
Author

For example:

joe@emby:/opt/tv/m3u$ cat no_epg_channels.txt
"[CA-S] SPORTSNET PPV",""
"[NHL-10] SABRES @ PREDATORS 8PM ET",""
"[NHL-11] STARS @ WILD 9PM ET",""
"[NHL-12] SHARKS @ CANUCKS 10PM ET",""
"[NHL-13]",""
"[NHL-1] CAPITALS @ ISLANDERS 1PM ET",""
"[NHL-2] BLUES @ AVALANCHE 3PM ET",""
"[NHL-3] COYOTES @ OILERS 3PM ET",""
"[NHL-4] FLAMES @ SENATORS 4PM ET",""
"[NHL-5] DEVILS @ BLUE JACKETS 7PM ET",""
"[NHL-6] PANTHERS @ RED WINGS 7PM ET",""
"[NHL-7] KINGS @ FLYERS 7PM ET",""
"[NHL-8] BLACKHAWKS @ MAPLE LEAFS 7PM ET",""
"[NHL-9] GOLDEN KNIGHTS @ CANADIENS 7PM ET",""
"[PP-2] UFC 246 MCGREGOR VS. COWBOY 30FPS - 615PM ET",""
"[PPV-10] RAGE IN THE CAGE OKC 71 - 9PM ET",""
"[PPV-11] BOXING JOEY SPENCER V ERIK SPRING - 9PM ET",""
"[PPV-12] BOXING CHRIS COLBERT V JEZZREL CORRALES - 10PM ET",""
"[PPV-13] BOXING CHRISTOPHER DIAZ V ADEILSON DOS SANTOS - 10PM ET",""
"[PPV-1] UFC 246 MCGREGOR VS. COWBOY 60FPS - 615PM ET",""
"[PPV-4] ALVAREZ VS SEALS UNDERCARDS 7PM ET",""
"[PPV-5] ALVAREZ VS. SEALS (MAIN CARD) 10PM ET",""
"[PPV-6] PF4 TAKEOVER - 730PM ET",""
"[PPV-7] SYNERGY PRO WRESTLING - 8PM ET",""
"[PPV-8] BOXING WILLIAMS VS ROSARIO - 8PM ET",""
"[PPV-9] GCW - 9PM ET",""

@bebo-dot-dev
Copy link
Owner

You started out with:

Many PPV/NHL/NBA/NFL do not have a EPG entry .

..which appears to be describing the scenario where your EPG provider is not supplying any EPG data for a number of channels.

Then you continued with:

If there is no EPG for a channel, use the m3u "tvg-name" name for the EPG

..which appears to be a request for this script to create or invent EPG data for channels where it doesn't exist.

This needs more info / a detailed coherent explanation.

@mwlistscom
Copy link
Author

mwlistscom commented Jan 18, 2020

Sorry for not being clear, english is my 3rd language and we do not use it much here.

..which appears to be a request for this script to create or invent EPG data for channels where it doesn't exist.

This is mostly exactly correct. The EPG data does not exist from the provider link for the channel, this is true, but provider did provide some information in the channel name in the m3u.

I noticed in my provider, for VOD they include the name in the m3u, for example:

#EXTINF:-1 tvg-id="" tvg-name="Behind the Bullet - 2019" tvg-logo="[some image]" group-title="[VOD ACTION]",Behind the Bullet - 2019 [stream link.mp4]

Many providers do not populate an EPG for VOD, but there is some information from the M3U that could be inserted into the EPG to make it easier to read on emby or plex. My provider uses tvg-name.

Provider populated some information in the M3U for PPV/NHL/NBA and others like they did for VOD.

I hope this is more clear.

@bebo-dot-dev
Copy link
Owner

Thanks that has clarified things.

If we do go down this road, it's worth highlighting now that the best you could expect from this script in terms of population of EPG data from the data that is present and usable in the M3U file would be the creation of <channel> and <display-name> elements and no more than that because there simply is no <programme/> element data available.

In other words, to use the data in line number 1 from your no_epg_channels.txt file in your comment above

"[CA-S] SPORTSNET PPV",""

..it would be possible for this script to populate the output EPG with data that looks like this and no more:

<?xml version='1.0' encoding='UTF-8'?>
<tv generator-info-name="py-m3u-epg-editor" generator-info-url="py-m3u-epg-editor" source-info-name="py-m3u-epg-editor">
  <channel id="[CA-S] SPORTSNET PPV">
    <display-name>[CA-S] SPORTSNET PPV</display-name>
  </channel>
  ..
  ..
</tv>

I honestly have no idea if doing this would be enough to make Emby / Plex happier but if you think that this is of some value, I'd be happy to take a look at implementing this change in some way.

Let me know, thanks.

@mwlistscom
Copy link
Author

mwlistscom commented Jan 18, 2020

Yes please I think this would be of value.
http://prntscr.com/qpldcl

@bebo-dot-dev bebo-dot-dev added feature request A new feature request and removed pending feedback Pending feedback from the person who created an issue labels Jan 18, 2020
@bebo-dot-dev
Copy link
Owner

Thank you, I'll take a look asap and update back here when there's something ready for a test.

@bebo-dot-dev
Copy link
Owner

Hi @ihavealegohead, I noticed your edited previous comment and see your screenshot. I have my doubts that the change being applied is going to give you what you want. I'm making the change now, we'll know soon enough.

@bebo-dot-dev
Copy link
Owner

Ok there is a new branch here:

https://github.com/jjssoftware/m3u-epg-editor/tree/EPG-extension

..currently containing one new commit:

203d026

A new --force_epg / -fe has been introduced which works in tandem with no_tvg_id and no_epg.

When EPG processing is enabled and when this new --force_epg option is specified as true, the generated EPG file will be populated with elements for channels in the m3u file that normally would have no EPG data.

As previously mentioned, only <channel> and <display-name> elements are populated into the generated EPG file and no more at this time.

I'm going to be very surprised if this alone results in the desired behaviour in Emby's EPG view as you have described in your screenshot.

Give it a try and let me know how it goes.

@bebo-dot-dev bebo-dot-dev added the pending feedback Pending feedback from the person who created an issue label Jan 19, 2020
@mwlistscom
Copy link
Author

mwlistscom commented Jan 19, 2020

Thank you very much for the changes. My friend is helping me with my English hopefully this very helpful :

I see now that the channel element from m3u is now in the guide, and this is good:

joe@emby:/opt/xteve/m3u$ diff yv.xml /tmp/test/streams.xml
2,42c2
<
<
< [NHL-10] SABRES @ PREDATORS 8PM ET
<
<
< [NHL-11] STARS @ WILD 9PM ET
<
<
< [NHL-12] SHARKS @ CANUCKS 10PM ET
<
<
< [NHL-13]
<
<
< [NHL-1] CAPITALS @ ISLANDERS 1PM ET
<
<
< [NHL-2] BLUES @ AVALANCHE 3PM ET
<
<
< [NHL-3] COYOTES @ OILERS 3PM ET
<
<
< [NHL-4] FLAMES @ SENATORS 4PM ET
<
<
< [NHL-5] DEVILS @ BLUE JACKETS 7PM ET
<
<
< [NHL-6] PANTHERS @ RED WINGS 7PM ET
<
<
< [NHL-7] KINGS @ FLYERS 7PM ET
<
<
< [NHL-8] BLACKHAWKS @ MAPLE LEAFS 7PM ET
<
<
< [NHL-9] GOLDEN KNIGHTS @ CANADIENS 7PM ET
<
<

\ No newline at end of file

However the emby guide is not filled in:

http://prntscr.com/qpu6dd

When we use XTEVE -- resulting tvg xml file looks like this http://prntscr.com/qpufg2 -

[NHL-1] CAPITALS @ ISLANDERS 1PM ET [NHL-2] BLUES @ AVALANCHE 3PM ET [NHL-5] DEVILS @ BLUE JACKETS 7PM ET . . . . . <title lang="en"> [NHL-1] CAPITALS @ ISLANDERS 1PM ET (Su. 00:00 - 02:00) </title> xTeVe: (120 Minutes) Sunday 00:00 - 02:00 2020-01-19 00:00:00

@bebo-dot-dev
Copy link
Owner

bebo-dot-dev commented Jan 19, 2020

Thanks for the feedback, it is at the moment as I suspected it would turn out: populating the EPG with <channel/> elements alone is not enough for Emby / Plex (and likely other applications) to make sense of the xml data well enough to populate a meaningful EPG view.

The corresponding <programme/> elements for the <channel/> elements are also going to need to be populated into the EPG but this now raises the question exactly how these elements should be populated:

It is easy enough to say "create this fake data" and I would guess that creating <programme/> elements in chunks of 2hr intervals from "now" would result in an EPG view that could be made sense of, but we do still have to decide how many 2hr interval chunks to create because we can't just fill the disk indefinitely. I suggest 24hrs worth of fake EPG data be created from the point in time where the newly generated EPG is created and in order for this to work, the script would need to be executed at least once daily. Does this sound like it would work acceptably well?

@mwlistscom
Copy link
Author

In fact this is what I do. I have a crob job that runs at 5am for m3u-epg-editor and then an EMBY job that runs at 5:15.

Would it make sense to limit the EPG to range?

--range [RANGE], -r [RANGE]
An optional range window to consider when adding programmes to the epg

This of course is acceptable and desirable.

@bebo-dot-dev
Copy link
Owner

Thanks for that, that's a really good call on using the --range / -r argument. I'll work that in.

@bebo-dot-dev
Copy link
Owner

bebo-dot-dev commented Jan 19, 2020

There is now another commit in the branch, this latest one introduces the creation of the required <programme/> elements:

471c715

As part of this change I had to introduce the use of a new python module which enables timestamps in the EPG on the <programme/> elements to be constructed in a timezone aware way: tzlocal

You might find that you need to install the tzlocal module if your python install doesn't already have it, i.e.: pip install tzlocal

Please give this updated version a try and let me know how it goes.

@bebo-dot-dev bebo-dot-dev changed the title When there is no EPG for a channel use the tvg-name Use the tvg-name attribute value from the M3U file to create EPG xml data Jan 19, 2020
@mwlistscom
Copy link
Author

Looks good - this is a VOD view:

http://prntscr.com/qqcae9

Thanks for making the feature !

@bebo-dot-dev
Copy link
Owner

Thanks for the update, it sounds good if this works as expected for you. I'll merge the branch to master and generally clean up later on tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new feature request
Projects
None yet
Development

No branches or pull requests

2 participants