NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Extras v
1 2 3 4 Next »
Getting Pluto extra to work

 
  • 0 Vote(s) - 0 Average
Getting Pluto extra to work
ballfam
Offline

Member

Australia
Posts: 132
Threads: 11
Joined: Jul 2020
#51
2024-03-27, 01:34 PM
I'll give it another try this weekend. My wife had cooled off on watching PBR, and I decided it was a lot of work for little gain at this point. The problem solver part of my brain wants to solve it anyway, just so I don't feel like I got defeated by something. I'll let you know.
Prsa01
Offline

Member

United States
Posts: 51
Threads: 3
Joined: Dec 2023
#52
2024-03-27, 10:52 PM
Disregard, clearly just a fluke that it worked on some things yesterday. Right back to normal issues today.
bouilliabai
Offline

Member

USA
Posts: 63
Threads: 1
Joined: May 2024
#53
2024-05-15, 07:16 PM
New user here. Not a programmer by any means, but a tendency to be on the persistent side, so....

It doesn't look like the plugin has been updated in some time, and with recent changes to the Pluto API, some edits are needed to get channel data and EPG updates.

In pluto.py change line #268 from:

ET.SubElement(channel, 'args').text = 'https://pluto.tv/live-tv/{} best -O'.format(station['slug'])

to:

ET.SubElement(channel, 'args').text = 'https://pluto.tv/en/live-tv/{} best -O'.format(station['_id'])

Also, to make the season and episode numbers available, something like this under line #23 might suffice, keeping the indentation the same as the line above.

    if 'number' in listing['episode']:
        episode_num = 'S{:02}E{:02}'.format(listing['episode']['season'], listing['episode']['number'])
        ET.SubElement(programme, 'episode-num', system='onscreen' ).text = episode_num

The VOD script is a little trickier.

In vod.py under line #255, add, keeping the indentation consistent with the lines above and below:

                episode['series_id'] = series['_id']

Then change lines #286 and #288 (per the new numbering), respectively, from:

        ET.SubElement(channel, 'args').text = ' https://pluto.tv/on-demand/movies/{} best -O'.format(station['slug'])

        ET.SubElement(channel, 'args').text = ' https://pluto.tv/on-demand/series/{}/season/{}/episode/{} best -O'.format(station['series_slug'],station['season'], station['slug'] )

to:

        ET.SubElement(channel, 'args').text = ' https://pluto.tv/on-demand/movies/{} best -O'.format(station['_id'])

        ET.SubElement(channel, 'args').text = ' https://pluto.tv/on-demand/series/{}/season/{}/episode/{} best -O'.format(station['series_id'],station['season'], station['_id'] )

What would be super nice is if the Kodi NPVR client were able to access VOD content, but that would also require it to have its own browsing interface, which entails a bit of work for what amounts to a niche audience.

As for the timestamp discontinuities of live Pluto streams causing playback stoppage, stuttering, etc., plus very limited timeshifting capability, there doesn't appear to be a good solution apart from the prior recording and remuxing of programs. There are suggestions in this forum for various FFmpeg switches to use, but in testing, none made a difference so much as the remuxing operation itself. Something like this in PostProcessing.bat seems to work on a Windows machine.

"C:\Program Files\NextPVR\Other\ffmpeg.exe" -i %FILENAME% -c copy outputfile.ts

Of course, outputfile.ts would have to be defined, and would furthermore have to be renamed as %FILENAME% in order to show up under Recordings. Additional lines of script could define which device OIDs and which channel numbers require remuxing, then make decisions based on those. A bonus feature of using this method is that the commercials are skipped, even in the absence of comskip, however, that can throw off the total time reported for the file. And the process does require some system resources to employ, though not nearly as much as transcoding would.

But that doesn't address what to do for the case of watching live TV with desired timeshifting capability. Using Streamlink helps immensely in that regard, but it doesn't appear that the CLI allows the output to be piped to an instance of FFmpeg in real time, then the output of FFmpeg passed to NPVR via stdout. And even if an intermediate file is used, it is quite possible that the timestamp discontinuities would halt the process when encountered.

That's another discussion for another day though.

The question for the authors concerns the pluto.py xmltv-update nnn call in PostLoadEPG per the PlutoTV Extra directions. At least on a Windows machine, this is not working correctly. It appears that the delay timer is not being honored in the script, likely due to an existing instance of pluto.py being called by the initial update, then another instance from PostLoadEPG upon executing UpdateNextPVR(). This, in turn, causes the timer delay to be bypassed and the update.lock file to be immediately deleted in subsequent instances. What is curious is that updates are occurring on the schedule defined by nnn, so the timer is being activated. However, the absence of the update.lock file leads to problems in allowing more frequent updates due to additional instances of pluto.py being run when a daily update or manual update is later invoked. Moving the call to PostUpdateEPG didn't make a difference. Any suggestions in resolving this issue would be welcome.

Thanks to the authors for a very nice piece of software. It's a great addition to the home network.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#54
2024-05-15, 07:41 PM
OK thanks I will have a look and see what changed and use your suggestions as a guide. Be aware the S/E number in Pluto don't match Schedules Direct or TVDB/TMDB lists so they aren't to be depended on.

That simple remux will only work some of the time and is definitely going to fail, as we have found trying to post process recordings. Better to make sure streamlink is up to date. The pluto plugin was rewritten last month probably because of the API changes. If you want to be adventurous the Extra could call a batch file that would pipe output stream to ffmpeg, but you will be disappointed with the results plus you really are just running ffmpeg twice.

The delay timer in the batch file was just a suggestion to give an idea how it might work, but it doesn't handle things like server restart or reboots The only test is the existence of that lock file so you need to control it as you see fit.

You are right though I abandoned this because the quality of the streams and the fact they don't work well (or at all really) with comskip and there are lots of ads.

In the unlikely even sub adds VOD to a UI client then the Pluto VOD would be available. A Kodi addon could probably be written to do this, but I don't see anything wrong in using the browser. For me that web interface perfect for downloading, (I do use NextTool for improved meta data) and downloading isn't something that really needs to be done from the 10' interface with the remote.

Martin
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#55
2024-05-15, 08:22 PM
After a quick look the issue (at least here in Canada) isn't the API changed, since it looks like the slug is still supported here and it is streamlink that has changed. Do you have an example that won't play with older versions of streamlink? I checked some that were reported not working and the play fine ie

streamlink https://pluto.tv/live-tv/star-trek-ca best -O

vod

https://pluto.tv/on-demand/series/macgyv...5-1-1-ptv2 best -0

I am very hesitant about any change that requires streamlink 6.7.

Martin
bouilliabai
Offline

Member

USA
Posts: 63
Threads: 1
Joined: May 2024
#56
2024-05-15, 11:38 PM (This post was last modified: 2024-05-15, 11:43 PM by bouilliabai. Edit Reason: Attachments removed during preview )
Thanks for the prompt response.

I'm well aware that the scope of the above is very limited, but perhaps some good information can be gleaned from it.

Given that the season and episode are reported in the VOD module, those lines were just an attempt to keep things consistent. TMDB/TVDB numbering can be suspect as well, especially the season 0 stuff which seems to change with the weather, so what may line up one day might not the next. It seemed best practice to go with what's in the Pluto API and sort out any discrepancies later if it becomes a problem.

Other posts in this forum clearly indicate that remuxing will only work in some situations, which is why I've added a list of devices (ie the PlutoTV Extra) and channels to PostProcessing.bat, check for a match, and if so, perform the remux. That could change too, depending on updates to Streamlink especially. A lot of this is brand new to me, including Streamlink and the Python language, so please forgive the novice approach.

One of the first things tried was custom Extras that called FFmpeg with various arguments to try and address the timestamp problem. An m3u8 link to a troublesome Pluto channel was used as input. In all cases, the output was terminated at the first discontinuity, and what remained was unseekable. Switches used included -fflags +genpts, -movflags faststart, -mpegts_copyts 1 and -fps_mode drop, in various combinations, both input and output. Most of these were suggested at one point or another in these forums.

The only thing that's worked with any degree of success when there are timestamp discontinuities is the PlutoTV Extra with Streamlink in order to get a complete recording, then remux that in PostProcessing. The same results were found independent of the FFmpeg switches used. Demuxing to elemental streams and remuxing didn't give any better results, so a simple remux is what's currently being used for recordings. But that still doesn't address live TV time-shifting, especially at program boundaries where playback stops every time.

In order to check the delay timer function, some modifications were made. See attached. That may be slightly different from what was used to generate the log file from which excerpts are also attached, but it should be close. PostLoadEPG contained the command per the instructions, with the delay time argument set to 5 minutes. The results are quite unexpected, indicative of a race condition, and possibly the misreporting of the PID as well. The lock file was created upon launch of a manual EPG update where the log excerpts begin and persisted for 5 minutes as it should, with the Task Manager showing one instance of pluto.py running, however that changed after the initial delay time expired. Also, if the lock file is present when the system shuts down or the script is otherwise interrupted, that could lead to other problems. One way around that might be to force xmltv-update (with no time argument) in the Pre or PostStartup service hook to perform a cleanup.

VOD is not working in the official Pluto plugin for Kodi, so there's no way to check its operation. That is new to me as well, as is the Pluto addon from the Slyguy repository, which has no VOD capability. In the NPVR web interface, shows and movies look to be seekable around ads, and of passable quality, so even if only playback were available in the Kodi client, that would add considerable value to the PlutoTV Extra. As is, in order to display VOD content on a 10' within Kodi, the most straightforward solution might be to download as a NextPVR recording via browser on a mobile device, then select for viewing from the Recordings menu. However, that's a bit clunky and somewhat defeats the purpose of video on demand to boot.


Attached Files
.zip   Attachment.zip (Size: 4.25 KB / Downloads: 1)
bouilliabai
Offline

Member

USA
Posts: 63
Threads: 1
Joined: May 2024
#57
2024-05-16, 12:17 AM (This post was last modified: 2024-05-16, 12:38 AM by bouilliabai. Edit Reason: Update )
(2024-05-15, 08:22 PM)mvallevand Wrote: After a quick look the issue (at least here in Canada) isn't the API changed, since it looks like the slug is still supported here and it is streamlink that has changed.  Do you have an example that won't play with older versions of streamlink?  I checked some that were reported not working and the play fine ie

streamlink https://pluto.tv/live-tv/star-trek-ca best -O

vod

https://pluto.tv/on-demand/series/macgyv...5-1-1-ptv2 best -0

I am very hesitant about any change that requires streamlink 6.7.

Martin

Just updated to Streamlink 6.7.4, and both of those URLs led to "no playable streams found" errors.

PS C:\Program FilesStreamlink\bin> streamlink https://pluto.tv/live-tv/star-trek-ca best -O
[cli][info] Found matching plugin pluto for URL https://pluto.tv/live-tv/star-trek-ca
error: No playable streams found on this URL: https://pluto.tv/live-tv/star-trek-ca

PS C:\Program Files\Streamlink\bin> streamlink https://pluto.tv/on-demand/series/macgyv...pisode/pil
ot-1985-1-1-ptv2 best -O
[cli][info] Found matching plugin pluto for URL https://pluto.tv/on-demand/series/macgyv...de/pilot-1
985-1-1-ptv2
error: No playable streams found on this URL: https://pluto.tv/on-demand/series/macgyv.../pilot-198
5-1-1-ptv2

Edit:

Oh, older versions. I only started with 6.7.3 last week. Is there an earlier version I should try?

Edit #2:

Ditto the slug listed in the API in the first instance.

PS C:\Program Files\Streamlink\bin> streamlink https://pluto.tv/live-tv/star-trek-1 best -O
[cli][info] Found matching plugin pluto for URL https://pluto.tv/live-tv/star-trek-1
error: No playable streams found on this URL: https://pluto.tv/live-tv/star-trek-1

However...

streamlink https://pluto.tv/live-tv/5efbd39f8c4ce900075d7698 best -O

Sends the output to stdout in the console, which is not a great idea.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#58
2024-05-16, 12:36 AM
Since you can download VOD in the web interface and downloaded files show show up in all NextPVR clients, as PVR Recordings this is the most compatible solution. Kodi core doesn't even allow PVR addons to interface to any form of VOD. To me sub's download approach is better than VOD I can go room to room, watch and resume, and fast forward etc. Nothing I hate more with VOD from OTT services is sitting through commercials.

Quite honestly I am not going to even look into any changes on the XMLTV timer since it doesn't interest me to improve it, feel free to customize it, that is why it is there.

I have upgraded my addon to test for the streamlink version and it adjusts to use the id if 6.7 or higher is available, just need a bit more testing. I won't be including the S/E change it is not a one line solution something along this lines would be better but not worth the trouble https://github.com/cabernetwork/provider...pg.py#L179 Besides many episodic shows are available VOD so they don't need to be captured in real time.

Of course the new version of streamlink doesn't work with slugs they took them out. They still work here that is why I was looking for a slug that didn't work to with older streamlinks. You might be able to just download the old plutotv.py and use it with the current version.

Martin
bouilliabai
Offline

Member

USA
Posts: 63
Threads: 1
Joined: May 2024
#59
2024-05-16, 01:07 AM
Thanks for the update.

Again, novice at work. Apologies for dredging up issues that are already well known.

Understood that the method given for viewing VOD is the best we are going to get. I'm just thrilled to have something in place to get around the ads, and that was the main driver in looking at NPVR as a Pluto handler in the first place.

Resolution of the XMLTV timer issue would not be simple. As indicated by the testing results, multiple concurrent executions of the same script are leading to undesired conditions. Far easier to find a workaround at this point, especially given my limited background and understanding.
ballfam
Offline

Member

Australia
Posts: 132
Threads: 11
Joined: Jul 2020
#60
2024-05-16, 03:04 PM
I'm still seeing completely unreliable recordings from Pluto, specifically the PBR Ride Pass channel, although some other channels appear to be OK. I can stream everything from the "live" channel reliably using streamlink with an extra, and the EPG works well if I refresh every 3 hours, but the resulting file is just junk. It usually plays OK for a while, but skipping forward or back is a big issue, and it almost always just freezes the picture at some point during the playback. I think the timecodes are just all over the place.

Like Martin, I just don't have the time or patience to watch ads; if I can't record it and skip over the ads, then I'd rather not watch it.

I'm running streamlink 6.6.2, and I did not modify the code with changes Martin suggested in an earlier post in this thread. I'm hoping someone eventually fixes streamlink to handle these junk Pluto streams, but if anyone has a version or combination of streamlink parameters that seems to work well, I'm willing to give it a try. In the meantime, I can live without it.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (17): « Previous 1 … 4 5 6 7 8 … 17 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  TabloTV Extra mvallevand 17 5,359 2025-03-13, 10:55 PM
Last Post: mvallevand
  Reminder Pluto TV Extra removed mvallevand 0 509 2025-01-04, 06:32 PM
Last Post: mvallevand
  help requested with sending IR Blast command with extra _Dam0_ 3 656 2024-10-11, 12:53 PM
Last Post: mvallevand
  Is 'TabloTv Extra' Compatible with Gen 4 Devices? POWerSUrgeSW3 4 1,280 2024-06-23, 01:23 PM
Last Post: mvallevand
  Pluto TV. mvallevand 93 34,454 2024-05-16, 08:46 PM
Last Post: mvallevand
  Pluto/iptv epg expected actions Prsa01 3 1,391 2024-01-20, 03:37 PM
Last Post: mvallevand
  windows media player extra buntay20 4 1,128 2023-12-17, 06:48 PM
Last Post: Jaggy
  PlutoTV Extra Commerical Exit freezing bisonfan 13 2,891 2023-12-16, 07:42 PM
Last Post: mvallevand
  Extra donation access -plutotv bisonfan 3 1,056 2023-09-04, 07:26 PM
Last Post: mvallevand
  PlutoTV Extra Problem Metroid 3 1,064 2023-07-23, 06:41 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode