xteve-project / xTeVe

M3U Proxy for Plex DVR and Emby Live TV
MIT License
1.72k stars 227 forks source link

Could not tune channel - Plex and xteve.m3u #3

Closed ananchev closed 4 years ago

ananchev commented 4 years ago

I was able to configure and run xteve with the m3u8 playlist and xmltv epg I use in Kodi IPTV simple client and Android Perfect Player. I can see the mapped channels, epg grid etc. in Plex Live TV, but when trying to run any channel I get playback error: Could not tune channel. Please check your tuner or antenna. The xteve log shows just 2019-08-04 17:40:56 [xTeVe] Plex stream:, which to me seems no stream is passed through. Am I missing something with the config and what would be the troubleshooting steps? Note that the source playlist and epg do work in the IPTV players.

Update: I also see Device not found in Plex setting for Live TV. When I delete and add the DVR again the running xTeVe is found, but as soon as its configuration in plex is finished, status goes back to Device not found.

mar-mei commented 4 years ago

Which version of xTeVe do you use? Troubleshooting: https://github.com/xteve-project/xTeVe-Documentation/blob/master/en/troubleshooting.md

ananchev commented 4 years ago

I have actually tried with both 1.4.4 and 2.0.0 and there is no difference in the described behavior. Thanks for the link regarding troubleshooting - went though it, but actually do not see a match with my particular case. Any advice would be however more than welcome.

mar-mei commented 4 years ago

Have you ever tried to open the xteve.m3u with VLC?

ananchev commented 4 years ago

Tried a second ago with a failure: access error: HTTP connection failure http error: cannot connect to 192.168.1.66:34400 Nevertheless, from a browser xteve.m3u returns, it seems, valid playlist containing links in the format http://192.168.1.66:34400/stream/092bd32c256af36169ec6cfde5e96c45 This though is not playable - could it be something related to how the xteve proxy redirects to the source?

mar-mei commented 4 years ago

Depends on how you configured xTeVe. Buffer off: The real streaming URL is passed to the client via HTTP Redirect 302. xTeVe is then no longer involved. Buffer on: xTeVe loads the video stream and forwards the stream to Plex unchanged.

ananchev commented 4 years ago

Sorry for my slow response, I would like to reopen the issue as I made some tests and can provide an update. Your comment about the buffering was very useful. I indeed need an HTTP redirect to url as provided in the input M3U playlist. Nevertheless, something goes wrong.

Below is the remote playlist I configured in XTEVE web interface: 203751C7-90F7-437E-B6A9-92EA05BC26A4

Whilst the playlist is successfully processed when configuring, this is what I receive in xteve.m3u: B16326CF-FE6D-4A8D-B118-9C9852A2EB91

Note that all channel entries are with the same url - this is where I believe the issue comes from...

A get request to this url returns 404 and logs an error in console / log BF2EAE86-6256-4E3D-BD5B-7D2F8C38C5AA 78330BC3-2627-47D5-959D-C1FFE562BC2A

xteve-project commented 4 years ago

the file urls.json (config folder) stores all information about the stream.

The link consists of an ID and the original URL, if your provider changes the streaming URL, the link in the xteve.m3u will also change.

Your IPTV client must periodically update the xteve.m3u file

Example: xteve.m3u streaming url: http://localhost/stream/3d013578a2ab43eb192131ba8e659856

urls.json

"3d013578a2ab43eb192131ba8e659856": {
    "channelNumber": "1000",
    "name": "Bunny HD 1",
    "playlistID": "M0TZTM8OU7Q9I65O4YK5",
    "url": "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",
    "urlID": "3d013578a2ab43eb192131ba8e659856"
  }

After a change of the provider streaming URL xteve.m3u streaming url: http://localhost/stream/09e2e6f13f8d216f8f8eadac22c94d7f urls.json

"09e2e6f13f8d216f8f8eadac22c94d7f": {
    "channelNumber": "1000",
    "name": "Bunny HD 1",
    "playlistID": "M0TZTM8OU7Q9I65O4YK5",
    "url": "http://clips.vorwaerts-gmbh.de/big_buck_bunny_new.mp4",
    "urlID": "09e2e6f13f8d216f8f8eadac22c94d7f"
  },
ananchev commented 4 years ago

There is only one channel in the urls.json for me and its url value is empty. Same after clearing up the config folder & restart. I am using my own proxy between the provider and my iptv clients - it takes care for login, refresh of links etc. and provides the playlist that is on the first screenshot above. Still the url for each channel is unique, but for any reason from xteve's the urls back to the proxy are not there.

xteve-project commented 4 years ago

I suspect a proxy removes the parameters from the URL. If the parameters were removed, the URL is always the same (http://192.168.1.66:8080/plylist.m3u8)

I copied that without a proxy:

Provider m3u:

#EXTM3U
#EXTINF:-1 CUID="1000" tvg-id="" tvg-name="" tvg-logo="https://vignette.wikia.nocookie.net/logopedia/images/d/d5/ESPN2.svg/revision/latest?cb=20180427153715" group-title="Buffer 1",Bunny HD 1
http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?ch=1000

#EXTINF:-1 CUID="1001" tvg-id="" tvg-name="" tvg-logo="" group-title="Buffer",Bunny HD 2
http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?ch=1001

xteve.m3u:

#EXTM3U url-tvg="http://192.168.178.90:34400/xmltv/xteve.xml" x-tvg-url="http://192.168.178.90:34400/xmltv/xteve.xml"
#EXTINF:0 channelID="x-ID.0" tvg-chno="1000" tvg-name="Bunny HD 1" tvg-id="1000" tvg-logo="" group-title="Buffer 1",Bunny HD 1
http://192.168.178.90:34400/stream/a113f84f24e5a64439a2efbecd927cf6
#EXTINF:0 channelID="x-ID.1" tvg-chno="1001" tvg-name="Bunny HD 2" tvg-id="1001" tvg-logo="" group-title="Buffer",Bunny HD 2
http://192.168.178.90:34400/stream/0fbe47abffc1ea84f2f9797e3492b9a8

urls.json

{
  "0fbe47abffc1ea84f2f9797e3492b9a8": {
    "channelNumber": "1001",
    "name": "Bunny HD 2",
    "playlistID": "MU2THY9BKPIY9SSA7UEQ",
    "url": "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?ch=1001",
    "urlID": "0fbe47abffc1ea84f2f9797e3492b9a8"
  },
  "a113f84f24e5a64439a2efbecd927cf6": {
    "channelNumber": "1000",
    "name": "Bunny HD 1",
    "playlistID": "MU2THY9BKPIY9SSA7UEQ",
    "url": "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?ch=1000",
    "urlID": "a113f84f24e5a64439a2efbecd927cf6"
  }
}

image

ananchev commented 4 years ago

This could be a possible reason. Interestingly, in your example the parameter was handled correctly?

I can modify the way my proxy generates its playlist and use unique urls with uids instead of parameters. As long as from xteve / plex, I then receive a redirect to this url, my proxy will handle the rest generating the provider url.

xteve-project commented 4 years ago

xTeVe does not change the URL, in the log on the screenshot you can see the original streaming URL, which is the same as in the provider M3U

ananchev commented 4 years ago

What in your view could be then the reason that the channel urls are empty in xteve.m3u and not the ones from playlist e.g. http://192.168.1.66:8080/playlist.m3u8?ch=100183 and so on (ch parameter value differs for each channel)?

When generating its xteve.m3u, does xTeVe just parse the provider playlist, or is making e.g. web requests to each of the channel urls in it? If it is a simple parsing I would expect to see in urls.json multiple entries.

The other thing I observe is that in your sample provider m3u there is CUID, which is not present in my playlist. Is this expected /used in xTeVe m3u generation?

xteve-project commented 4 years ago

The streaming URI is empty on your screenshot, because there is no ID for this stream in the urls.json file. Only if the ID exists, then the streaming URL can be found.

In order for each client to request the streaming URL from xTeVe, there must be a URL in xteve.m3u that links to xTeVe. in the urls.json file are only the URLs of the active channels (mapping = green)

CUID is a unique ID for this stream, but not every provider supports this feature. If such an ID exists, it will be used to identify the stream. Fallback is the channel name.

Problem with the names is, should the name change, it is a new channel for xTeVe and gets a new channel number. But if the stream has an ID, the name can change without losing the mapping in xTeVe. Of course, the ID should never change

ananchev commented 4 years ago

Thanks for the quick responses! So, I provide as input to xTeVe the remote m3u as on screenshot below link. Then upon starting the xteve binary, the xteve.m3u is generated and later the urls.json based on the mappings within plex. Though, as you can see on the earlier screenshots, the url for all channels in xteve.m3u is same and the urls.json contains one entry and no stream url ( although all channels are mapped in plex).

Would adding CUIDs in my input playlist solve this, or something additional is needed?

https://user-images.githubusercontent.com/34111833/63201810-21b2e180-c087-11e9-9c03-960834940a21.jpeg

xteve-project commented 4 years ago

The CUID will not solve your problem. Test your configuration without proxy. I can not imagine that xTeVe causes the problem.

ananchev commented 4 years ago

I cannot skip the proxy unfortunately as my provider does not deliver m3u. I created the proxy in order to automate the web authentication, scrape the links and generate the playlist. It is working in well in Kodi Simple IPTV, VLC, etc. Still, I can extend / change the proxy functionality when needed. If you think there is nothing that can be done from xTeVe side, you can close the issue.

ananchev commented 4 years ago

I added a method to my proxy to generate m3u playlist with the channel urls directly from the IPTV provider (instead of links pointing to the proxy itself). These links expire after certain period, but for the testing this is not issue. The playlist is below - highlighted one of the provider urls. Note that it is on its own also pointing to an m3u list...

Tried with that m3u in xTeVe, but still same result: xteve.m3u for all channels has the same url (same UID after <xteve’s http address>/stream/), which on GET returns 404. Buffering is off, so I would expect a redirect to the provider url but it does not work. There is in my view something related to how xTeVe processes the input m3u and channel links. I am more than happy to support any further troubleshooting, but need your help :)

73C6BAFF-5EB6-4764-B468-9040579C7805

xteve-project commented 4 years ago

If you have a test list, I can look at it.

ananchev commented 4 years ago

Happy to share and thanks being ready to have a look. I would like to send the file per email although stream links would expire. If you do not want to share your address here, can you drop me one at ananchev at gmail.

mar-mei commented 4 years ago

Send me that via Discord

mar-mei commented 4 years ago

Was solved. The problem was invalid URLs in the provider M3U.

GroupMaster commented 4 years ago

I would like to add to this for other people that are having an issue of this nature. I found a single space before each URL in the master M3U file causing xteve to make all the same URLs on it's output and an error when attempting to play any stream. The xteve "window" or "screen" indicated that it was unable to find a stream for that station. As soon as the script was corrected and the spaces removed from the M3U file, all fell back into place. I hope that someone may find this helpful.