Kodi Community Forum

Full Version: PS Vue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2019-09-22, 22:16)gottahavit Wrote: [ -> ]I think I figured it out and I guess it's across most if not all  live dvr shows.  If you look at the m3u8 file for the stream on a file that is starting before the last show ends you find this:

#EXT-X-PROGRAM-DATE-TIME:2019-09-03T21:54:59.039Z

Notice that it's 5 min before the top of the hour

Where if you look at the m3u8 for the VOD stream it's:

#EXT-X-PROGRAM-DATE-TIME:2019-08-09T00:00:00.000Z

I think I'll add a setting to jump live recordings up 5 minutes for now when they play back, eventually should pull that from m3u8 file in case it varies.  Need to figure out how to set the resume point on a stream in kodi.

Update:  It seems to be always around 5 min.  Right now I have it working with resume time with fixed 5 min based on being dvr vs VOD, it's gonna tale some scraping to get the exact value out of the m3u8 file, prior to feeding it to player, but should be doable.
I've been doing this for a long time. Add this ps_vue.py.  It will prompt you when you start a DVR'd show to start at 5:00 or the beginning (if you have not watched it before).  Bold part is what I added.  

Of course you can program your remote to be able to skip 5 min, but that really wasn't ideal for me. 

    resumetime=''
    if 'last_timecode' in show['airings'][air_num]:
        resumetime = str(show['airings'][air_num]['last_timecode'])
        xbmc.log("RESUME TIME = "+resumetime)
        try:
            h,m,s = resumetime.split(':')
        except ValueError:
            h,m,s,ms = resumetime.split(':')
        resumetime = str(int(h) * 3600 + int(m) * 60 + int(s))

    # xbmc.log("RESUME TIME IN Seconds = "+resumetime)
    # xbmc.log("TOTAL TIME IN Seconds = "+str(int(duration.total_seconds())))
    
#VUEMOD
    if (resumetime=="0" or not resumetime) and (str(show['airings'][0]['badge'])=="dvr" or str(show['airings'][0]['badge'])=="catchup"): resumetime="300"
    show_url = SHOW_URL + '/' + airing_id
(2019-09-23, 04:53)michaeljc70 Wrote: [ -> ]
(2019-09-22, 22:16)gottahavit Wrote: [ -> ]I think I figured it out and I guess it's across most if not all  live dvr shows.  If you look at the m3u8 file for the stream on a file that is starting before the last show ends you find this:

#EXT-X-PROGRAM-DATE-TIME:2019-09-03T21:54:59.039Z

Notice that it's 5 min before the top of the hour

Where if you look at the m3u8 for the VOD stream it's:

#EXT-X-PROGRAM-DATE-TIME:2019-08-09T00:00:00.000Z

I think I'll add a setting to jump live recordings up 5 minutes for now when they play back, eventually should pull that from m3u8 file in case it varies.  Need to figure out how to set the resume point on a stream in kodi.

Update:  It seems to be always around 5 min.  Right now I have it working with resume time with fixed 5 min based on being dvr vs VOD, it's gonna tale some scraping to get the exact value out of the m3u8 file, prior to feeding it to player, but should be doable.
I've been doing this for a long time. Add this ps_vue.py.  It will prompt you when you start a DVR'd show to start at 5:00 or the beginning (if you have not watched it before).  Bold part is what I added.  

Of course you can program your remote to be able to skip 5 min, but that really wasn't ideal for me. 

    resumetime=''
    if 'last_timecode' in show['airings'][air_num]:
        resumetime = str(show['airings'][air_num]['last_timecode'])
        xbmc.log("RESUME TIME = "+resumetime)
        try:
            h,m,s = resumetime.split(':')
        except ValueError:
            h,m,s,ms = resumetime.split(':')
        resumetime = str(int(h) * 3600 + int(m) * 60 + int(s))

    # xbmc.log("RESUME TIME IN Seconds = "+resumetime)
    # xbmc.log("TOTAL TIME IN Seconds = "+str(int(duration.total_seconds())))
    
#VUEMOD
    if (resumetime=="0" or not resumetime) and (str(show['airings'][0]['badge'])=="dvr" or str(show['airings'][0]['badge'])=="catchup"): resumetime="300"
    show_url = SHOW_URL + '/' + airing_id
\
That's exactly what I did at first, now I have it skipping automatically if no resume time specified.  I'm working on the parsing to make it more accurate now
something else  just noticed which I'm wondering if it's related to some of the occasional playback errors or errors in the middle of streams.  I occasionally get 401s in the middle of a stream after a random period of time and I noticed this:
    r = requests.get(url, headers=headers, cookies=load_cookies(), verify=VERIFY)

that code loads the json about the stream and is sent the reqPayload cookie that  the addon keeps from login, but that call constantly sends back an update reqPaload cookie, seems to always be same value, but with new expiration, but I wonder if sometimes it's sending a new cookie back?  I'm going to update code to resave and use the updated cookie from each request and see if that improves the cookie handling since that is essentially what happens in the browser app.
How is everyone using this add-on? I like my setup but feel like I'm potentially working too hard.

Here is my set up:
Skin: Aeon Nox: Silvo
I use PVR Plugin Player to generate a m3u file
I use that m3u in IPTV Simple client along with zap2xml to generate the xmltv.xml file
I have one widget that is PVR >> Recently Played Channels
I have another widget that is a shortcut to PSVue >> Trending TV

Are people using the PSVue add-on just as an add-on? If so, what views do you use?

Are you creating custom widgets?

I'm just looking for other ideas.

Thanks.
(2019-09-27, 18:30)Doctor Eggs Wrote: [ -> ]How is everyone using this add-on? I like my setup but feel like I'm potentially working too hard.

Here is my set up:
Skin: Aeon Nox: Silvo
I use PVR Plugin Player to generate a m3u file
I use that m3u in IPTV Simple client along with zap2xml to generate the xmltv.xml file
I have one widget that is PVR >> Recently Played Channels
I have another widget that is a shortcut to PSVue >> Trending TV

Are people using the PSVue add-on just as an add-on? If so, what views do you use?

Are you creating custom widgets?

I'm just looking for other ideas.

Thanks.
You can just use the PSVue pvr add-on which more or less automates everything you've done, except it scrapes the guide info from the PSVue site.
Your method seems like a lot of unnecessary work tbh.
@michaeljc70 @gottahavit , I've personally just have gotten use to fast forwarding 5m on my recordings. But if you two have code that picks the correct resume time, then I'll add it to my testing fork. It sounds like something most people would want.

To my main reason to post and maybe put a smile on @Doctor Eggs face, I've managed to merge the EPG builder and Video addon. I'm testing it on my setup and it seems to work well. You still need a PVR client but no longer need the EPG build service. It's a simple merge and I'm still cleaning up some code. Please try it out and let me know if there are any bugs, it's on My Github.
(2019-09-27, 20:22)snoopyjoe Wrote: [ -> ]@michaeljc70 @gottahavit , I've personally just have gotten use to fast forwarding 5m on my recordings. But if you two have code that picks the correct resume time, then I'll add it to my testing fork. It sounds like something most people would want.

To my main reason to post and maybe put a smile on @Doctor Eggs face, I've managed to merge the EPG builder and Video addon. I'm testing it on my setup and it seems to work well. You still need a PVR client but no longer need the EPG build service. It's a simple merge and I'm still cleaning up some code. Please try it out and let me know if there are any bugs, it's on My Github.
fyi I just started getting the bad cookie error again on one machine.  two others were working, to test I whiped my good cookies and can't get a good one again.  Hopefully this is another temporary glitch from sony.  I still have one that works, but I'm guessing not for long

UPDATE:  ok very odd, been working for weeks, this happened on one machine.  I just did a full uninstall and re-install and all is good again.  Obviously there is some "cookie" info other than in settings.xml and cookies.lwp.
(2019-09-28, 00:00)gottahavit Wrote: [ -> ]
(2019-09-27, 20:22)snoopyjoe Wrote: [ -> ]@michaeljc70 @gottahavit , I've personally just have gotten use to fast forwarding 5m on my recordings. But if you two have code that picks the correct resume time, then I'll add it to my testing fork. It sounds like something most people would want.

To my main reason to post and maybe put a smile on @Doctor Eggs face, I've managed to merge the EPG builder and Video addon. I'm testing it on my setup and it seems to work well. You still need a PVR client but no longer need the EPG build service. It's a simple merge and I'm still cleaning up some code. Please try it out and let me know if there are any bugs, it's on My Github.
fyi I just started getting the bad cookie error again on one machine.  two others were working, to test I whiped my good cookies and can't get a good one again.  Hopefully this is another temporary glitch from sony.  I still have one that works, but I'm guessing not for long

UPDATE:  ok very odd, been working for weeks, this happened on one machine.  I just did a full uninstall and re-install and all is good again.  Obviously there is some "cookie" info other than in settings.xml and cookies.lwp. 

Also I am using the EPG plugin to drive TVGuide Fullscren rather than Simple PVR.  I had to make a couple changes so TGFS would eat the data.  One to add the TZ offset to all program times and second to encode all the descriptions and titles.
(2019-09-27, 20:22)snoopyjoe Wrote: [ -> ]@michaeljc70 @gottahavit , I've personally just have gotten use to fast forwarding 5m on my recordings. But if you two have code that picks the correct resume time, then I'll add it to my testing fork. It sounds like something most people would want.

To my main reason to post and maybe put a smile on @Doctor Eggs face, I've managed to merge the EPG builder and Video addon. I'm testing it on my setup and it seems to work well. You still need a PVR client but no longer need the EPG build service. It's a simple merge and I'm still cleaning up some code. Please try it out and let me know if there are any bugs, it's on My Github.

WOW! This is amazing. I've been messing around with this for a bit and it is absolutely AWESOME!

So far, no bugs to report.

Thank you. Thank you!
@Doctor Eggs  I've uploaded beta2 of the addon which also includes @gottahavit resumetime code. There is the ability to disable the EPG service in the settings for those that do not want to use the EPG service. Also useful where only one box runs the service and others load data from that device or storage. I'll be submitting a PR soon but it can be tested from My Github
(2019-09-29, 02:07)snoopyjoe Wrote: [ -> ]@Doctor Eggs  I've uploaded beta2 of the addon which also includes @gottahavit resumetime code. There is the ability to disable the EPG service in the settings for those that do not want to use the EPG service. Also useful where only one box runs the service and others load data from that device or storage. I'll be submitting a PR soon but it can be tested from My Github

cool,  I figured out how to start stream playback 5 min in, but I cant figure out how to tell if the user pick a resume time when selecting video.  So I  cant leave it alone if they did. Seems adding resume time is best way, but doest work with auto play next stream.  Will look more later
(2019-09-27, 20:22)snoopyjoe Wrote: [ -> ]To my main reason to post and maybe put a smile on @Doctor Eggs face, I've managed to merge the EPG builder and Video addon. I'm testing it on my setup and it seems to work well. You still need a PVR client but no longer need the EPG build service. It's a simple merge and I'm still cleaning up some code. Please try it out and let me know if there are any bugs, it's on My Github.
This sounds great, so you would uninstall the ps vue epg service, and update @eracknaphobia ps vue now, correct?
I should be able to push @snoopyjoe  changes to my repo today. Which should make the update easier. I would imagine you would still have to uninstall the ps vue service addon manually.

Update version 2019.10.3 is now in my repo.
Correct @clones ,Uninstall the old EPG build service then update the PSVue addon.
(2018-05-12, 19:45)jamieb122 Wrote: [ -> ]@snoopyjoe @mikefreeman 
Update on TVHeadend progress: Its basically done.

I stripped out the guts from the various PSVue addons and developed a standalone python script.

Workflow for configuration is as follows:
Run python script (first run will ask for PSVue login), you can set this as a service or however you want to auto run at boot
In TVHeadend:
  • Add IPTV Auto network in TVHeadend (Set max muxes to 3 so scanning doesnt fail due to PSVue stream limits)
  • Map muxes to services (this is automatic....just click map all services)
  • Rerun EPG grabber within TVheadend (using schedules direct or your EPG grabber of choice)
  • Set channel numbers etc to your desire.
If you use the Kodi TVHeadend PVR addon and point it to your Tvheadend box it will then have all of the channels in the EPG.  You can select like normal and it plays (no need for IPTV Service PVR addon, or the PSVue addon).

As a bonus, if you have an OTA atenna with TVHeadend you can have them all advertised on the one EPG.

Admittedly I hacked it together in a few days after work so the code is ugly.  Also, I did *not* implement the EPG download and advertisement since I have TVHeadend pointing to my SchedulesDirect account (I just used Time Warner cable line up and it auto matched 90% of the channels).  Other issues I'm not a fan of: password is stored in plain text in a file that stores off all data (I didn't do a sql database like the service plugin because I just wanted it up and running).....but that is the way the Kodi PSVue addon is now.

I don't have a github repo setup.  Before I do set one up.....is anyone interested in this setup?

EDIT: Ok, there is a github repo up now (https://github.com/jamieb122/PSVueProxy) ....no README file yet, but you really just need to run "python ./main.py" and in TVHeadend set the IPTV m3u playlist URL to http://127.0.0.1:54321/playlist.m3u for now   

Is anyone still running a PSVue Tvheadend setup? I've have been unable to get the above to work properly. Any help would be greatly appreciated!

Globals: setting(npsso) not found
Globals: setting(reqPayload) not found
SONY: [-] ERROR: Could not find npsso cookie
SONY:  not logged in, logging in
/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest...l-warnings
  InsecureRequestWarning)
SONY: [-] ERROR: Login error - Invalid login