# TiVo Streaming Plugin for Plex TiVoToGo.Bundle



## ke3ju

I have to say, once I bought my Roamio OTA and found out it did not support streaming in network, or out, I was very disappointed. Two months later, I found this.

GitHub - sander1/TiVoToGo.bundle: TiVo To Go Plex Server Channel

It works really well, and I can even stream outside my network on the Interwebz.

Apparently, this has been around for a while, but was broken, and some cat took the code, figured what was wrong, and fixed it.

Just thought I'd share here, because this really completes the system for me. Nothing left on the checklist. (Well, not really true, but this was really big)

Cheers everyone!!! Enjoy!!!


----------



## Scooter Scott

I'm going to try this tonight


----------



## jim8650

could you please report back with your experience?...and maybe step by step instructions?...I briefly looked at the instructions on the link and am kinda lost ...will take another shot at it tonight or tomorrow when I get time, as I would very much like to have the ability to do this on my iPad


----------



## reneg

I didn't spend a lot of time on it, but I tried this plugin last night, and while it did list the shows on my Tivo (which if I recall correctly is an improvement over the previous version), it would not play any of the videos for me. I got an endless spinning circle. I suspect that this plugin might only support PS streams from the Tivo, and not TS streams. The streams from the Tivo I tested only supports TS streams. I may try to play with this again when I have more time.

Install is simple. Copy the bundle directory to your Plex plugin folder and make sure the directory name ends in .bundle and then once the plugin is visible in Plex, click the settings icon to configure the MAK, Tivo IP address, etc.., then launch.


----------



## jim8650

thanks...I may invest the time as well then


----------



## ke3ju

reneg said:


> I didn't spend a lot of time on it, but I tried this plugin last night, and while it did list the shows on my Tivo (which if I recall correctly is an improvement over the previous version), it would not play any of the videos for me. I got an endless spinning circle. I suspect that this plugin might only support PS streams from the Tivo, and not TS streams. The streams from the Tivo I tested only supports TS streams. I may try to play with this again when I have more time.
> 
> Install is simple. Copy the bundle directory to your Plex plugin folder and make sure the directory name ends in .bundle and then once the plugin is visible in Plex, click the settings icon to configure the MAK, Tivo IP address, etc.., then launch.


What's the difference between PS Stream and TS?

Sent from my SM-G900V using Tapatalk


----------



## reneg

ke3ju said:


> What's the difference between PS Stream and TS?
> 
> Sent from my SM-G900V using Tapatalk


Just a guess on my part. From this plugins perspective, it uses tivodecode which works for PS streams and if I recall, has trouble with TS streams.


----------



## windracer

Interesting ... I'll give this a try.


----------



## reneg

I confirmed on a Roamio OTA that I could play back PS recorded streams with this plugin. I cannot play back TS recorded streams from my cable provider, Comcast. Expect mixed results from this plugin.


----------



## slowbiscuit

That's the reason why I had to abandon it - it used tivodecode which fails with Comcast mpeg4 channels. Which is almost all of them on Comcast now.


----------



## windracer

It kinda worked for me ... I can start a stream, but as soon as I try to trickplay, it just locks up and won't play anymore. I'd like to see updated graphics as well.

Might have to fork and poke around.


----------



## ke3ju

windracer said:


> It kinda worked for me ... I can start a stream, but as soon as I try to trickplay, it just locks up and won't play anymore. I'd like to see updated graphics as well.
> 
> Might have to fork and poke around.


Mine works fine, but the PC that's is doing the transcoding is an i7 with 20 gigs of RAM.

Sent from my SM-G900V using Tapatalk


----------



## windracer

windracer said:


> Might have to fork and poke around.


I think I'm going to start using this instead of the TiVo iOS app to download/playback recordings on my phone. It's very helpful since the downloads happen on the PMS server so I don't need to keep an app open on my phone like you do when downloading through the TiVo app.

I made a few changes in my fork, specifically the ability to name the downloaded file with the proper sXXeYY format for TV shows, and the option to specify multiple Plex libraries to refresh. This way I can add my TiVo downloads folder to both my "TV Shows" and "Movies" Plex libraries (which use different metadata agents) and for the most part the metadata lookup will work and show them under the proper library. It's not perfect, but it works most of the time.

jradwan/TiVoToGo.bundle


----------



## slowbiscuit

Please also consider switching to tivolibre to do the decrypt instead of tivodecode so the plugin can be used on Comcast (TS for mpeg4). kmttg does that today.


----------



## windracer

slowbiscuit said:


> Please also consider switching to tivolibre to do the decrypt instead of tivodecode so the plugin can be used on Comcast (TS for mpeg4). kmttg does that today.


I agree that'd be cool, but tivolibre is written in Java, so it was probably relatively easy to incorporate it into kmttg. The Plex plugin is written in Python. I'm not a master of either Python or Java so using a Java class in a Python program is a bit beyond me.

That being said, it looks like @Dan203 uses it in his pyTivo Desktop so maybe I'll take a look and see if I can figure it out. I might not be a master coder, but I'm good at poking around. 

_edit:_ oh, he made compiled executable versions to run on Windows and OSX so that doesn't help.


----------



## windracer

Ok, I've added tivolibre support. I've only tested on Linux but as long as you've got Java installed and put the path to your runtime in the plugin settings, it should work. Let me know how it works for you.

jradwan/TiVoToGo.bundle

I ran into a problem with this week's episode of Brooklyn Nine-Nine which is named "Bachelor/ette Party" and the forward slash in there causes a problem with the download thinking there's a missing subdirectory, so I'll try and clean that up.

I've also noticed the Suggestions folder doesn't work in the plugin. I suspect this is because it's using the old query (https://{TiVo IP}/nowplaying/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying%2F0) which doesn't work anymore. I'm not sure how to approach that one ...


----------



## slowbiscuit

Hmm, thanks for the tivolibre update but doesn't seem to be working on Win10. I set the java path to C:/ProgramData/Oracle/Java/javapath/java.exe (this is what's in the Windows environment vars for java) and checked the tivolibre box, can see all my Tivo shows but none of them playback, they all error out on play. Tried both mpeg2 and mpeg4 files, think it might be a tivolibre-related error.

Is it doing TS transfers and is there a log to see what's going on?


----------



## windracer

Yeah, check the plug-in log (com.plexapp.plugins.tivotogo.log under Plex Media Server/Logs/PMS Plugin Logs). Look for the "CMD" and "PIPED" debug log entries. The CMD shows the curl command (which is pulling the video from your TiVo) and the PIPED line shows the command-line for tivolibre (or tivodecode) that the output of curl is being piped through. I've probably got a bug in the command-line generation for Windows.



Code:


DEBUG (__init__:332) - CMD: /usr/bin/curl http://192.168.1.73:80/download/Brooklyn%20Nine-Nine.TiVo?Container=%2FNowPlaying&id=44354 --digest -s -u tivo:xxxxxxxxxx -c /tmp/cookies.txt
DEBUG (__init__:337) - PIPED to: /usr/bin/java -jar "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m xxxxxxxxxx -

In your case, the PIPED line should contain something like:



Code:


C:/ProgramData/Oracle/Java/javapath/java.exe -jar "{path to your Plex install}/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m xxxxxxxxxx -

_edit:_ I checked my Java install on my Windows 10 PC (I don't run Plex on it through) and the path to java.exe was actually C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe (which actually points to C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe). So make sure you confirm that what you put into the java path preference in the channel is valid. You could also try putting double-quotes around the string since it contains spaces. I could make a code change so the quotes get added automatically, just in case.


----------



## slowbiscuit

OK, here's the log entries when it fails trying to stream to Plex. Is it possible that curl is bombing because /tmp/cookies.txt is not a valid path? Everything else looks correct to me (the java path on my PC is good, path to curl is good). MAK was replaced by 'xx's below.



Code:


2018-05-01 09:03:33,691 (1210) :  INFO (logkit:16) - GET URL: http://192.168.1.178:80/download/The%20Crossing.TiVo?Container=%2FNowPlaying&id=23212
2018-05-01 09:03:33,693 (1210) :  DEBUG (logkit:13) - CMD: C:\Users\D***\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.178:80/download/The%20Crossing.TiVo?Container=%2FNowPlaying&id=23212 --digest -s -u tivo:xxxxxxxxxx -c /tmp/cookies.txt
2018-05-01 09:03:33,700 (1210) :  DEBUG (logkit:13) - PIPED to: C:\ProgramData\Oracle\Java\javapath\java.exe -jar "C:\Users\D***\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m xxxxxxxx -
2018-05-01 09:03:33,707 (1210) :  INFO (logkit:16) - Starting decoder
2018-05-01 09:03:33,934 (1210) :  INFO (logkit:16) - tivodecode/curl terminated


----------



## windracer

Yup, that's probably it. I think that's like that in the original channel code, but it's possible I missed it. For now, you can edit the __init__.py code in the channel's directory, look for "/tmp/cookies.txt" and replace it with "C:\temp\cookies/txt" (or some other place you know exists) and see if that works. I'll look into fixing that for the Windows platform.


----------



## shwru980r

What picture resolution should we expect from this plugin?


----------



## windracer

I'm not an expert, but it's just using curl to pull the video file off of the TiVo and then pipes it through tivodecode (or tivolibre) to decrypt it. I'm not sure if Plex intercedes at that point to determine if it needs to be transcoded for the target device or not, but in my experience the quality is very good.


----------



## windracer

slowbiscuit said:


> Is it possible that curl is bombing because /tmp/cookies.txt is not a valid path?





windracer said:


> Yup, that's probably it.


I've pushed a commit that should fix this (use the platform-specific temp directory).


----------



## slowbiscuit

windracer said:


> I've pushed a commit that should fix this (use the platform-specific temp directory).


Still not working, the temp directory is not correct. But a look at the curl man page indicates that if the cookie path is invalid curl will continue anyway without bombing.

What you get is a spinning circle on playback in Plex that never ends, for any show I have (mpeg2 or 4). Sure looks like curl is ending awful quickly in the log though, so I'm not sure if it's bombing or not.



Code:


2018-05-06 09:56:32,020 (14f4) :  INFO (logkit:16) - GET URL: http://192.168.1.178:80/download/House%20Hunters%20International.TiVo?Container=%2FNowPlaying&id=23622
2018-05-06 09:56:32,026 (14f4) :  DEBUG (logkit:13) - CMD: C:\Users\D****\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.178:80/download/House%20Hunters%20International.TiVo?Container=%2FNowPlaying&id=23622 --digest -s -u tivo:xxxxxxx -c c:\users\d****\appdata\local\temp/cookies.txt
2018-05-06 09:56:32,049 (14f4) :  DEBUG (logkit:13) - PIPED to: C:\ProgramData\Oracle\Java\javapath\java.exe -jar "C:\Users\D****\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m xxxxxxxx -
2018-05-06 09:56:32,069 (14f4) :  INFO (logkit:16) - Starting decoder
2018-05-06 09:56:32,351 (14f4) :  INFO (logkit:16) - tivodecode/curl terminated

EDIT: ok played around with this using a command line prompt - if I quote the entire curl cmdline string it starts downloading the file. Not sure if something needs to be quoted or not when issuing the CMD from python but I think the cmdline processor doesn't like the http string possibly due to unescaped question mark or ampersand.


----------



## windracer

The temp directory looks correct, based on the code changes I made anyway. But if it's still bombing, yeah, something else is wrong. I'm out of town for a few days at a conference but will try to look at this again when I get back. Hard to test since I don't run Plex on Windows ...


----------



## mattack

OK, dumb question on my part, what does this run on? Is there a chance of doing it on a Raspberry Pi or something like that? (Whichever the one is that actually comes in a completed box, basically to plug in..)

of course I have a laptop (that I download shows with kmttg on for example), but in theory if I could just have a little hopefully low-power-using box on all the time, then I'd use that.

(For me, the Tivo built in streaming/downloading barely works -- shows stop downloading all the time, and even 'successful' downloads sometimes end up hanging in the middle.. Enough so that I got Hulu Plus _mostly_ to watch shows at the gym, though the available shows that I already watch I watch at home on that too, since it has no commercials.)

But for this, I would consider leaving yet another device on the time, to have reliable streaming/downloading off site.


----------



## BrettStah

windracer said:


> I think I'm going to start using this instead of the TiVo iOS app to download/playback recordings on my phone. It's very helpful since the downloads happen on the PMS server so I don't need to keep an app open on my phone like you do when downloading through the TiVo app.
> 
> I made a few changes in my fork, specifically the ability to name the downloaded file with the proper sXXeYY format for TV shows, and the option to specify multiple Plex libraries to refresh. This way I can add my TiVo downloads folder to both my "TV Shows" and "Movies" Plex libraries (which use different metadata agents) and for the most part the metadata lookup will work and show them under the proper library. It's not perfect, but it works most of the time.
> 
> jradwan/TiVoToGo.bundle


I just installed this. Works great, but I've only tried streaming using it while at home using my AppleTV so far.

Can it easily be changed to not prompt for the TiVo's IP address if there is only one TiVo?


----------



## ke3ju

BrettStah said:


> I just installed this. Works great, but I've only tried streaming using it while at home using my AppleTV so far.
> 
> Can it easily be changed to not prompt for the TiVo's IP address if there is only one TiVo?


You can set it up under settings in the Plugin on the Plex Server. The same place you enter the Media Access Key...


----------



## BrettStah

ke3ju said:


> You can set it up under settings in the Plugin on the Plex Server. The same place you enter the Media Access Key...


I wasn't very clear.
I have entered my TIVo's IP address there already. I just want the plugin to always use it without making me select it each time I open the plugin.

Right now this is the process to get to the list of recordings on my TIVo via this plugin:

1) In my Plex client app, select Channels
2) Open the TIVo plugin
3) Select my TIVo's IP address

I want step 3 to happen automatically.


----------



## ke3ju

BrettStah said:


> I wasn't very clear.
> I have entered my TIVo's IP address there already. I just want the plugin to always use it without making me select it each time I open the plugin.
> 
> Right now this is the process to get to the list of recordings on my TIVo via this plugin:
> 
> 1) In my Plex client app, select Channels
> 2) Open the TIVo plugin
> 3) Select my TIVo's IP address
> 
> I want step 3 to happen automatically.


I'm thinking no, at least not yet.


----------



## Diana Collins

slowbiscuit said:


> ...I set the java path to *C:/ProgramData*/Oracle/Java/javapath/java.exe (this is what's in the Windows environment vars for java)...





windracer said:


> ...I checked my Java install on my Windows 10 PC (I don't run Plex on it through) and the path to java.exe was actually *C:\Program Files (x86)*\Common Files\Oracle\Java\javapath\java.exe (which actually points to C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe)...


One of you is using 32 bit Java (which works) and the other is using 64 bit (which doesn't). Unless the Java code includes both 32 bit and 64 bit libraries, I wouldn't expect it to work properly.


----------



## BrettStah

ke3ju said:


> I'm thinking no, at least not yet.


Yep, I'm hoping it can be easily changed to skip that UI step, though.


----------



## Diana Collins

mattack said:


> OK, dumb question on my part, what does this run on? Is there a chance of doing it on a Raspberry Pi or something like that? (Whichever the one is that actually comes in a completed box, basically to plug in..)
> 
> of course I have a laptop (that I download shows with kmttg on for example), but in theory if I could just have a little hopefully low-power-using box on all the time, then I'd use that.
> 
> (For me, the Tivo built in streaming/downloading barely works -- shows stop downloading all the time, and even 'successful' downloads sometimes end up hanging in the middle.. Enough so that I got Hulu Plus _mostly_ to watch shows at the gym, though the available shows that I already watch I watch at home on that too, since it has no commercials.)
> 
> But for this, I would consider leaving yet another device on the time, to have reliable streaming/downloading off site.


A low power processor wouldn't work for the Plex server, since it needs to do transcoding. For example, the Plex app on TiVo is restricted to certain codecs (and on the Roamios to 720p) so transcoding of content is required. The same applies to remote use, where the bit stream needs to be compressed to fit the particular device and link. I'd suggest at least a dual core Intel or quad core AMD CPU at a minimum of 2.4 gHz.


----------



## windracer

BrettStah said:


> Yep, I'm hoping it can be easily changed to skip that UI step, though.


I'll see if I can figure out a way to do that. Interesting that yours shows the IP address ... mine shows the names of my TiVo boxes.


----------



## BrettStah

windracer said:


> I'll see if I can figure out a way to do that. Interesting that yours shows the IP address ... mine shows the names of my TiVo boxes.


I'm running it on a Windows box, and I manually entered its IP address, since the auto-discovery option says it's "Linux only".


----------



## windracer

Diana Collins said:


> One of you is using 32 bit Java (which works) and the other is using 64 bit (which doesn't). Unless the Java code includes both 32 bit and 64 bit libraries, I wouldn't expect it to work properly.


Thanks for the tip.

@slowbiscuit try installing the 32-bit JRE, update the path in the plugin accordingly, and see if that works for you.


----------



## windracer

BrettStah said:


> I'm running it on a Windows box, and I manually entered its IP address, since the auto-discovery option says it's "Linux only".


Ah yes, another downside to me not running this on Windows.  Maybe I should try if I'm going to keep tinkering with this for people ...


----------



## BrettStah

windracer said:


> Thanks for the tip.
> 
> @slowbiscuit try installing the 32-bit JRE, update the path in the plugin accordingly, and see if that works for you.


FWIW, I'm using this for the Java path (this is copied and pasted from the plug-in's configuration page):
*C:\ProgramData\Oracle\Java\javapath*

Note the big differences between that and this, from an earlier thread:
*C:/ProgramData/Oracle/Java/javapath/java.exe*


----------



## BrettStah

windracer said:


> Ah yes, another downside to me not running this on Windows.  Maybe I should try if I'm going to keep tinkering with this for people ...


Eh, don't go out of your way - it's working great "as-is"... I'm just trying to skip that extra step each time I open the plug-in.


----------



## windracer

@BrettStah do me a favor and try auto-discovery (take out your TiVo IP from the settings). I just installed Plex for Windows and it looks like auto-discovery _does_ work (not every time, but most of the time). Curious if it would work for you too.


----------



## BrettStah

windracer said:


> @BrettStah do me a favor and try auto-discovery (take out your TiVo IP from the settings). I just installed Plex for Windows and it looks like auto-discovery _does_ work (not every time, but most of the time). Curious if it would work for you too.


Yep, that worked just fine.


----------



## windracer

Cool, I might remove that "static TiVo IP address" setting then. Although it could be used if your TiVo is on a different subnet, I'm not sure how useful that is.

Back to the main menu stuff, though, where your TiVo name is listed, this is also where the plug-in puts the "Active Downloads" when there's a download in progress. So not sure how to really eliminate that menu and go right to My Shows if only one TiVo is discovered.


----------



## BrettStah

windracer said:


> Cool, I might remove that "static TiVo IP address" setting then. Although it could be used if your TiVo is on a different subnet, I'm not sure how useful that is.


 I'd leave it, but change the label next to it to something like, "Enter your TiVo's IP address if it isn't automatically detected."


windracer said:


> Back to the main menu stuff, though, where your TiVo name is listed, this is also where the plug-in puts the "Active Downloads" when there's a download in progress. So not sure how to really eliminate that menu and go right to My Shows if only one TiVo is discovered.


 Could it be configured to only show that menu if you have two or more TiVos, or if a download is in progress?


----------



## slowbiscuit

windracer said:


> Thanks for the tip.
> 
> @slowbiscuit try installing the 32-bit JRE, update the path in the plugin accordingly, and see if that works for you.


Did that, still no worky - same quick java/curl exit and endless spinning circle in Plex client on playback. Interestingly I can get curl to d/l and pipe the show to tivolibre on a command line using the exact commands logged in your file, but the resulting mpg file I tried to play (with any player including VLC) only had audio, no video.


----------



## windracer

BrettStah said:


> I'd leave it, but change the label next to it to something like, "Enter your TiVo's IP address if it isn't automatically detected."


Yeah, I've left it and updated the text accordingly (removing the "Linux only" for auto-discovery).

Still trying to figure out the logic for building the main menu differently if there's only one TiVo (either via specified IP address or auto-discovery).


----------



## windracer

slowbiscuit said:


> Did that, still no worky - same quick java/curl exit and endless spinning circle in Plex client on playback. Interestingly I can get curl to d/l and pipe the show to tivolibre on a command line using the exact commands logged in your file, but the resulting mpg file I tried to play (with any player including VLC) only had audio, no video.


If you use tivodecode instead of tivolibre, does the download work?

@BrettStah you're running on Windows ... are you using tivodecode or tivolibre? What do your CMD and PIPED TO lines look like in the log file?


----------



## BrettStah

windracer said:


> If you use tivodecode instead of tivolibre, does the download work?
> 
> @BrettStah you're running on Windows ... are you using tivodecode or tivolibre? What do your CMD and PIPED TO lines look like in the log file?


I have only used the streaming feature. I haven't tried the download stuff.


----------



## slowbiscuit

windracer said:


> If you use tivodecode instead of tivolibre, does the download work?


It does work for mpeg2 streams (local channels), does not work for mpeg4 on Comcast which is to be expected. This is the same behavior before your change to add tivolibre.

I know that Kevin (@moyekj) had to add an option to d/l these files as TS streams for kmttg to get tivolibre to work, is it possible that this has to be enabled for curl downloads as well? Have no idea what option that is for the d/l URL but he would.


----------



## windracer

slowbiscuit said:


> It does work for mpeg2 streams (local channels), does not work for mpeg4 on Comcast which is to be expected. This is the same behavior before your change to add tivolibre.


Ok, I wasn't clear ... thought it wasn't working at all.



slowbiscuit said:


> I know that Kevin (@moyekj) had to add an option to d/l these files as TS streams for kmttg to get tivolibre to work, is it possible that this has to be enabled for curl downloads as well? Have no idea what option that is for the d/l URL but he would.


It's probably adding "&Format=video/x-tivo-mpeg-ts" to the URL to force a transport stream download. I'll try including that when the user selects the option to use tivolibre for decoding and see if that works for you.


----------



## windracer

@slowbiscuit try this. Edit __init__.py and find the MyVideoHandler class (line 310). Then add the if statement (2 lines) below after the "url =" line:



Code:


  def do_GET(self):
    try:
      url = base64.b64decode(string.split(self.path[1:], "/")[0], "-_")
      if Prefs['tivolibre']:
          url = url + "&Format=video/x-tivo-mpeg-ts"
      Log("GET URL: %s" % url)

That will force the transport stream download (when the tivolibre option is selected). When I tried this, I got choppy, blocky video (in the stream, and download) so I'm not sure if that's because of my Plex server's CPU, or the way tivolibre is decoding the TS file. Just curious to see if a) this works for you and b) if you see the same video quality issues.


----------



## slowbiscuit

No change, still the same quick exit. Note that I am using the javapath for Program Files (x86) below (which is valid) but not sure if this needs to be quoted.


Code:


2018-05-13 09:19:34,631 (2e48) :  INFO (logkit:16) - GET URL: http://192.168.1.178:80/download/House%20Hunters%20International.TiVo?Container=%2FNowPlaying&id=24192&Format=video/x-tivo-mpeg-ts
2018-05-13 09:19:34,635 (2e48) :  DEBUG (logkit:13) - CMD: C:\Users\D****\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.178:80/download/House%20Hunters%20International.TiVo?Container=%2FNowPlaying&id=24192&Format=video/x-tivo-mpeg-ts --digest -s -u tivo:xxxxxxx -c c:\users\d*****\appdata\local\temp/cookies.txt
2018-05-13 09:19:34,671 (2e48) :  DEBUG (logkit:13) - PIPED to: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe -jar "C:\Users\D****\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m xxxxxxx -
2018-05-13 09:19:34,684 (2e48) :  INFO (logkit:16) - Starting decoder
2018-05-13 09:19:35,144 (2e48) :  INFO (logkit:16) - Self-exit of tivodecode/curl
2018-05-13 09:19:35,144 (2e48) :  INFO (logkit:16) - tivodecode/curl terminated


----------



## BrettStah

slowbiscuit said:


> No change, still the same quick exit. Note that I am using the javapath for Program Files (x86) below (which is valid) but not sure if this needs to be quoted.
> 
> 
> Code:
> 
> 
> 2018-05-13 09:19:34,631 (2e48) :  INFO (logkit:16) - GET URL: http://192.168.1.178:80/download/House%20Hunters%20International.TiVo?Container=%2FNowPlaying&id=24192&Format=video/x-tivo-mpeg-ts
> 2018-05-13 09:19:34,635 (2e48) :  DEBUG (logkit:13) - CMD: C:\Users\D****\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.178:80/download/House%20Hunters%20International.TiVo?Container=%2FNowPlaying&id=24192&Format=video/x-tivo-mpeg-ts --digest -s -u tivo:xxxxxxx -c c:\users\d*****\appdata\local\temp/cookies.txt
> 2018-05-13 09:19:34,671 (2e48) :  DEBUG (logkit:13) - PIPED to: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe -jar "C:\Users\D****\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m xxxxxxx -
> 2018-05-13 09:19:34,684 (2e48) :  INFO (logkit:16) - Starting decoder
> 2018-05-13 09:19:35,144 (2e48) :  INFO (logkit:16) - Self-exit of tivodecode/curl
> 2018-05-13 09:19:35,144 (2e48) :  INFO (logkit:16) - tivodecode/curl terminated


Did you try out the exact path that I'm using, which is working correctly for me? I posted it a few days ago.


----------



## windracer

slowbiscuit said:


> No change, still the same quick exit. Note that I am using the javapath for Program Files (x86) below (which is valid) but not sure if this needs to be quoted.


Python should be handling the quoting when it runs the command-line. Some of the debug messages explicitly include the quotes, others don't, but the execution should be fine. Can you try running the curl and java command lines separately and make sure they work independently? It's working for BrettStah so I'm not sure why it's not working for you.


----------



## slowbiscuit

windracer said:


> Python should be handling the quoting when it runs the command-line. Some of the debug messages explicitly include the quotes, others don't, but the execution should be fine. Can you try running the curl and java command lines separately and make sure they work independently? It's working for BrettStah so I'm not sure why it's not working for you.


As I said before, the curl and java commands run fine in a cmd prompt and when piped together. They just don't work correctly when run from Python.

Also, the javapath I'm using now is the exact same one you posted before. I hate to say it but I think you really need to try this yourself on Win10 so I can compare if you get it working.


----------



## BrettStah

slowbiscuit said:


> As I said before, the curl and java commands run fine in a cmd prompt and when piped together. They just don't work correctly when run from Python.
> 
> Also, the javapath I'm using now is the exact same one you posted before. I hate to say it but I think you really need to try this yourself on Win10 so I can compare if you get it working.


Can you copy and paste your current javapath you are current using and post it here?

I'm using this as my path (notice how it doesn't include the actual EXE file at the end - it shouldn't be needed):
*C:\ProgramData\Oracle\Java\javapath*

Keep in mind that I am only streaming, so if the problem you are dealing with is only related to downloading, this may not be the cause of your problem.


----------



## windracer

BrettStah said:


> I'm using this as my path (notice how it doesn't include the actual EXE file at the end - it shouldn't be needed):
> *C:\ProgramData\Oracle\Java\javapath*


Well that's odd ... how is it working for you without actually including the binary? My code is expecting the Java path to include the path to the java runtime, including the filename. And you have the "use tivolibre" checkbox turned on? What do your CMD and PIPED TO debug log lines look like?



slowbiscuit said:


> I hate to say it but I think you really need to try this yourself on Win10 so I can compare if you get it working.


Remember I'm not the author of this code, I'm just tinkering with it. And it works fine for me on Linux which is my primary platform. I'll do what I can if I have time to tinker with Windows, but that's not my primary platform for this plug-in. Feel free to fork it and mess around with it yourself.


----------



## BrettStah

windracer said:


> Well that's odd ... how is it working for you without actually including the binary? My code is expecting the Java path to include the path to the java runtime, including the filename. And you have the "use tivolibre" checkbox turned on? What do your CMD and PIPED TO debug log lines look like?


I can check, but if this is for downloading, then I probably shouldn't have jumped in, because I am only using this plug-in for streaming - I haven't tested out any downloading features at all. I thought the javapath was also used for streaming.


----------



## windracer

The java path should be used for both streaming and downloading as tivolibre will be used for both if you turn on that checkbox.


----------



## BrettStah

windracer said:


> The java path should be used for both streaming and downloading as tivolibre will be used for both if you turn on that checkbox.


Ah... I don't have it checked:








I can give it a shot though... I'll report back my results.


----------



## BrettStah

I get this:


----------



## windracer

Ok, so you've been using the original tivodecode setup and not the new tivolibre stuff I added. So you turned on the tivolibre checkbox and then fixed the java path (to include "java.exe" at the end) and got that error? Can you check the plug-in log? It's under %APPDATA%\Local\Plex Media Server\Logs\PMS Plugin Logs\com.plexapp.plugins.tivotogo.log.


----------



## BrettStah

windracer said:


> Ok, so you've been using the original tivodecode setup and not the new tivolibre stuff I added. So you turned on the tivolibre checkbox and then fixed the java path (to include "java.exe" at the end) and got that error? Can you check the plug-in log? It's under %APPDATA%\Local\Plex Media Server\Logs\PMS Plugin Logs\com.plexapp.plugins.tivotogo.log.





Code:


2018-05-14 21:24:50,019 (464) : DEBUG (runtime:717) - Handling request GET /video/tivotogo/:/prefs
2018-05-14 21:24:50,020 (464) : DEBUG (runtime:814) - Found route matching /video/tivotogo/:/prefs
2018-05-14 21:24:50,038 (464) : DEBUG (runtime:88) - Sending packed state data (109 bytes)
2018-05-14 21:24:50,039 (464) : DEBUG (runtime:924) - Response: [200] MediaContainer, 1636 bytes
2018-05-14 21:25:01,641 (1e34) : DEBUG (runtime:717) - Handling request GET /video/tivotogo
2018-05-14 21:25:01,642 (1e34) : DEBUG (runtime:814) - Found route matching /video/tivotogo
2018-05-14 21:25:02,374 (1e34) : DEBUG (base:117) - Checking if com.plexapp.plugins.tivotogo is broken
2018-05-14 21:25:02,414 (1e34) : DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjgKY92tLnBsZXhhcHAucGx1Z2lucy50aXZvdG9nb3MxMAppZGVudGlmaWVycjAK'
2018-05-14 21:25:02,426 (1e34) : DEBUG (runtime:88) - Sending packed state data (109 bytes)
2018-05-14 21:25:02,426 (1e34) : DEBUG (runtime:924) - Response: [200] MediaContainer, 457 bytes


----------



## BrettStah

And now, it doesn't detect the TiVo at all... All I see is this (I don't have a playlist named Tivo to Go):


----------



## BrettStah

BrettStah said:


> And now, it doesn't detect the TiVo at all... All I see is this (I don't have a playlist named Tivo to Go):


Well, now I do see my TiVo... Must have been a short blip that corrected itself.


----------



## windracer

BrettStah said:


> Well, now I do see my TiVo... Must have been a short blip that corrected itself.


Yeah, I see that a lot where the channel doesn't retrieve the list of TiVos and shows that empty list. Usually just trying again fixes it. I've also seen the problem where, after a few failed transfers, the TiVo reports "server busy" and I have to reboot the box in order to get transfers working again.

For your log you included above, it looks like you didn't initiate a stream or download, so the CMD/PIPED TO lines I was interested in don't appear.


----------



## BrettStah

windracer said:


> Yeah, I see that a lot where the channel doesn't retrieve the list of TiVos and shows that empty list. Usually just trying again fixes it. I've also seen the problem where, after a few failed transfers, the TiVo reports "server busy" and I have to reboot the box in order to get transfers working again.
> 
> For your log you included above, it looks like you didn't initiate a stream or download, so the CMD/PIPED TO lines I was interested in don't appear.


Yeah that was because I had reverted the change since it didn't work, and I grabbed the log entries when it wouldn't list the TIVo. I'll try again when I get a chance.


----------



## BrettStah

Code:


2018-05-15 17:03:28,348 (31d4) :  DEBUG (logkit:13) - CMD: C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.99:80/download/PBS%20NewsHour.TiVo?Container=%2FNowPlaying&id=10321 --digest -s -u tivo:88888888888 -c c:\users\htpc\appdata\local\temp/cookies.txt
2018-05-15 17:03:28,411 (31d4) :  DEBUG (logkit:13) - PIPED to: C:\Program Files\Java\jre1.8.0_171\bin\java.exe -jar "C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m 8888888888 -
2018-05-15 17:03:28,484 (31d4) :  INFO (logkit:16) - Starting decoder
2018-05-15 17:03:29,640 (31d4) :  INFO (logkit:16) - tivodecode/curl terminated

Notice I used the path to Java.exe under "c:\Program Files". I'll try again using the other path.


----------



## BrettStah

Code:


2018-05-15 17:21:30,242 (31d4) : DEBUG (logkit:13) - CMD: C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.99:80/download/PBS%20NewsHour.TiVo?Container=%2FNowPlaying&id=10321 --digest -s -u tivo:8888888888 -c c:\users\htpc\appdata\local\temp/cookies.txt
2018-05-15 17:21:30,246 (31d4) : DEBUG (logkit:13) - PIPED to: C:\ProgramData\Oracle\Java\javapath\java.exe -jar "C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m 8888888888 -
2018-05-15 17:21:30,410 (31d4) : INFO (logkit:16) - Starting decoder
2018-05-15 17:21:30,753 (31d4) : INFO (logkit:16) - tivodecode/curl terminated

This is from using the C:\ProgramData\Oracle\Java\javapath path.


----------



## BrettStah

So I may have figured out at least one issue. The CMD line needs some tweaking, I think.

This line:


Code:


C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.99:80/download/PBS NewsHour.TiVo?Container=/NowPlaying&id=10321 --digest -s -u tivo:8888888888 -c c:\users\htpc\appdata\local\temp/cookies.txt

Should instead be:


Code:


"C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.99:80/download/PBS%20NewsHour.TiVo?Container=%2FNowPlaying&id=10321" --digest -s -u tivo:8888888888 -c c:\users\htpc\appdata\local\temp\cookies.txt

Notice the quotes, and the change to the backslash before cookies.txt


----------



## windracer

Thanks. I'll try adding the quotes and the slash fix and see if that works for you guys. Maybe Linux is more forgiving ...


----------



## slowbiscuit

BrettStah said:


> So I may have figured out at least one issue. The CMD line needs some tweaking, I think.
> 
> This line:
> 
> 
> Code:
> 
> 
> C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe http://192.168.1.99:80/download/PBS NewsHour.TiVo?Container=/NowPlaying&id=10321 --digest -s -u tivo:8888888888 -c c:\users\htpc\appdata\local\temp/cookies.txt
> 
> Should instead be:
> 
> 
> Code:
> 
> 
> "C:\Users\HTPC\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.99:80/download/PBS%20NewsHour.TiVo?Container=%2FNowPlaying&id=10321" --digest -s -u tivo:8888888888 -c c:\users\htpc\appdata\local\temp\cookies.txt
> 
> Notice the quotes, and the change to the backslash before cookies.txt


This is what I was talking about earlier, apparently the python Popen is working differently on Win10 because either curl or java exit immediately in the logs. What's odd is that there is no logged exception for an abnormal program exit even though there is a catch for that in the code.


----------



## Diana Collins

windracer said:


> Thanks. I'll try adding the quotes and the slash fix and see if that works for you guys. Maybe Linux is more forgiving ...


Yeah, Windows stops parsing the executable path at the first space (expecting what comes after to be parameters). Anything with a space requires the entire executable path be enclosed in quotes.


----------



## windracer

Well, I'm pretty sure it's not the quoting or slashes in the curl command-line. Python should be handling that, and the non-tivolibre (i.e., original) functionality is working for BrettStah on Windows. I pushed a commit that fixes the debugging messages that appear in the log to have the proper quotes so its easier to cut/paste for debugging, but it doesn't look like there's an easy way to see what the command-line Python is actually running.

Everything's working fine on Linux though! 

If I have some time tomorrow I'll try some more tinkering with the win32 stuff.


----------



## BrettStah

I'll give the update a shot...


----------



## windracer

The last "update" was just a change to the debug messages in the log. If you turn off the "tivolibre" checkbox in the channel settings it should go back to working for you (streaming) again. That would prove that the curl (and tivodecode) command-lines are fine, even with the wrong-direction slash for the cookies file, etc. So it's probably something specific to the tivolibre command-line I am building and how Windows is interpreting it ...


----------



## BrettStah

Ah... gotcha.


----------



## slowbiscuit

windracer said:


> The last "update" was just a change to the debug messages in the log. If you turn off the "tivolibre" checkbox in the channel settings it should go back to working for you (streaming) again. That would prove that the curl (and tivodecode) command-lines are fine, even with the wrong-direction slash for the cookies file, etc. So it's probably something specific to the tivolibre command-line I am building and how Windows is interpreting it ...


I agree, it's something in the java cmdline because it does work to stream mpeg2 files with tivodecode.


----------



## BrettStah

So here's the actual line from my log file (I pared down the paths for readability):


Code:


"C:\...\java.exe" -jar "C:\...\TivoDecoder.jar" -m 0123456789 -

Here's the sample line I found from the github page for tivolibre:


Code:


java -jar TivoDecoder.jar -i input.TiVo -o output.mpg -m 0123456789

Keeping in mind I know nothing about tivolibre at all, so feel free to tell me to stop bugging you, should the command that is actuallyused include a -i switch, like the example? And why does the command that I am seeing in the log file end with a hyphen?


----------



## windracer

Yeah, that command line you saw is for when you're running tivolibre on a file you've already downloaded and have sitting on your hard drive. The channel is downloading the file via curl and then PIPING the output of that into tivolibre, so it doesn't need the -i parameter. That dash at the end of the command line means "standard input" so it will receive the file as it's downloaded by curl and dumped either to a file (if you're downloading) or to the device (if you're streaming).

Just got back from seeing "Infinity War" with my daughter and have some other stuff to get to today. Then there's the hockey game tonight (go Bolts!) but I'll continue to tinker when I can.


----------



## kbgators

Took a awhile but I have this running on Plex on Ubuntu, and with a TiVo Bolt. 

Question - any way to automatically download all TiVo recordings at once? Or even better, download new recordings?


----------



## windracer

Glad you got it working. 

I don't know how it could be used to download all recordings at once or new ones, sorry.


----------



## windracer

I'll be honest, Windows folks, I'm stumped. Everything works fine with the existing tivodecode stuff, but when using tivolibre/java:

- to download a file, the download "completes" almost immediately (i.e., nothing happens)



Code:


2018-05-21 22:24:40,394 (2830) :  DEBUG (logkit:13) - CMD: "C:\Users\jeremy\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.73:80/download/Fear%20the%20Walking%20Dead.TiVo?Container=%2FNowPlaying&id=47252" --digest -s -u tivo:<mak> -c "c:\users\jeremy\appdata\local\temp/cookies.txt"
2018-05-21 22:24:40,434 (2830) :  DEBUG (logkit:13) - PIPED to: "C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe" -jar "C:\Users\jeremy\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m <mak> -o "C:\Users\Jeremy\Videos\Fear the Walking Dead - Just in Case.mpg" -
...
2018-05-21 22:24:47,549 (2830) :  INFO (logkit:16) - Download complete: C:\Users\Jeremy\Videos\Fear the Walking Dead - Just in Case.mpg

- to stream a file, the log shows "tivodecode/curl terminated"



Code:


2018-05-21 22:29:53,499 (1fd4) :  DEBUG (logkit:13) - CMD: "C:\Users\jeremy\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.73:80/download/Into%20the%20Badlands.TiVo?Container=%2FNowPlaying&id=47258" --digest -s -u tivo:<mak> -c "c:\users\jeremy\appdata\local\temp/cookies.txt"
2018-05-21 22:29:53,506 (1fd4) :  DEBUG (logkit:13) - PIPED to: "C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe" -jar "C:\Users\jeremy\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m <mak> -
2018-05-21 22:29:53,517 (1fd4) :  INFO (logkit:16) - Starting decoder
2018-05-21 22:29:53,822 (1fd4) :  INFO (logkit:16) - tivodecode/curl terminated

In both cases, if I copy/paste the generated command-lines to a command prompt in Windows, they work just fine. Everything works fine on Linux.

I'm not sure how to debug/troubleshoot this further ...


----------



## rassi

Just found this thread and would *LOVE* if I could watch my TiVo recordings via Plex...

I'm getting similar problems to other windows users, although I haven't gotten any shows to play (I'm on Time Warner). I get "The System cannot find the path specified" when I run the command from the logfile in a CMD window.

Looking at the path it's looking for, it seems to be looking for the .bundle directory, but that's under my plex installation, but it's looking for it in AppData. The only .bundle directory under AppData is Services.bundle.

I can provide exact logfile entries if that would be helpful....


----------



## windracer

Are you sure you installed the bundle correctly? The TiVoToGo.bundle folder should be under C:\Users\<username>\AppData\Local\Plex Media Server\Plug-ins. So if you put it somewhere else, yeah, you'd probably get a "cannot find path" error.


----------



## rassi

I found what appears to be my Plex installation under Program Files (x86) and installed the bundle here:

C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-31d3c0c65

The plug-in DOES show up in Plex when it runs under plugins....it just gives me the circle thing when I try to view any shows. I normally don't use a Plex client in a phone or anything, just on our Roku (which I haven't checked yet) and via browser on my PC. 
Should I move it to the AppData directory?


----------



## eherberg

The path windracer posted is the standard Plex plugin folder. All of your plugins should go there. Easy way to get to the right folder is to right-click the Plex icon in your system try on Windows and select the 'Open Plug-ins Folder' option.


----------



## rassi

eherberg said:


> The path windracer posted is the standard Plex plugin folder. All of your plugins should go there. Easy way to get to the right folder is to right-click the Plex icon in your system try on Windows and select the 'Open Plug-ins Folder' option.


Not sure what I'm supposed to right-click. When I have my Plex Server page open in a browser, right clicking the Plex Server's name just gives me normal right-click options from my web browser.

Right clicking the icon for Plex server on my system gives me normal windows options for an icon.

When I said Open folder for that, it pointed me to:

C:\Program Files (x86)\Plex\Plex Media Server

And highlighted the Plex server software, "Plex Media Server.exe"

Is it possible that back in the day when I installed Plex (many moons ago) I told it to install in C:\Program Files (x86)\Plex ?


----------



## BrettStah

You don't see the "Open Plug-ins Folder" menu option when you right-click on the Plex Server icon in your notification area?


----------



## rassi

BrettStah said:


> You don't see the "Open Plug-ins Folder" menu option when you right-click on the Plex Server icon in your notification area?


Ok, now I do. Didn't think to right click on the Plex status icon...

Ok, that shows the directory exactly where you guys had said...

Trying moving the plugin there....


----------



## rassi

Still getting the spinning circle....



Code:


2018-06-05 18:52:39,632 (3ee4) :  INFO (logkit:16) - GET URL: http://192.168.1.224:80/download/Modern%20Family.TiVo?Container=%2FNowPlaying&id=96695
2018-06-05 18:52:39,634 (3ee4) :  DEBUG (logkit:13) - CMD: "C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.224:80/download/Modern%20Family.TiVo?Container=%2FNowPlaying&id=96695" --digest -s -u tivo:8888888888 -c "c:\users\USERNAME\appdata\local\temp/cookies.txt"
2018-06-05 18:52:39,638 (3ee4) :  DEBUG (logkit:13) - PIPED to: "C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\tivodecode.exe" -m 8888888888 -
2018-06-05 18:52:39,720 (3ee4) :  INFO (logkit:16) - Starting decoder
2018-06-05 18:52:39,743 (3ee4) :  INFO (logkit:16) - Self-exit of tivodecode/curl
2018-06-05 18:52:39,743 (3ee4) :  INFO (logkit:16) - tivodecode/curl terminated

Anything else I should check???


----------



## windracer

Can you try copy/pasting the CMD and PIPED to lines to a DOS command-line? Like this:



Code:


"C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.224:80/download/Modern%20Family.TiVo?Container=%2FNowPlaying&id=96695" --digest -s -u tivo:8888888888 -c "c:\users\USERNAME\appdata\local\temp/cookies.txt" | "C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\tivodecode.exe" -m 8888888888 -

Now, the lines above are for a stream, so you'll get a bunch of garbage streaming into the command window and you'll probably have to kill it. I would recommend getting the debug command-lines for a download and try those. That should confirm that curl, the HTTP connection to your TiVo, and the tivodecode binary are all working correctly.

And just to confirm, you've got the right MAK entered in the plug-in settings, correct?


----------



## rassi

windracer said:


> And just to confirm, you've got the right MAK entered in the plug-in settings, correct?


Yes, taken directly from my Tivo account on the same screen...

Will try the CMD window later when I am home. Thanks!


----------



## ebockelman

@windracer, Is this version supposed to name the files as "ShowName SxxExx" like Plex likes? I'm not seeing that behavior from mine.


----------



## rassi

windracer said:


> Can you try copy/pasting the CMD and PIPED to lines to a DOS command-line? Like this:
> 
> 
> 
> Code:
> 
> 
> "C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.224:80/download/Modern%20Family.TiVo?Container=%2FNowPlaying&id=96695" --digest -s -u tivo:8888888888 -c "c:\users\USERNAME\appdata\local\temp/cookies.txt" | "C:\Users\USERNAME\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\tivodecode.exe" -m 8888888888 -
> 
> Now, the lines above are for a stream, so you'll get a bunch of garbage streaming into the command window and you'll probably have to kill it. I would recommend getting the debug command-lines for a download and try those. That should confirm that curl, the HTTP connection to your TiVo, and the tivodecode binary are all working correctly.
> 
> And just to confirm, you've got the right MAK entered in the plug-in settings, correct?


ok, for the CMD line it said SERVER BUSY Too many transfers in progress. For the PIPED line it said "Encryption by QUALCOMM " and hung at the command line (cursor never came back)


----------



## windracer

ebockelman said:


> @windracer, Is this version supposed to name the files as "ShowName SxxExx" like Plex likes? I'm not seeing that behavior from mine.


If you enable that in the settings by filling in your tivo.com username and password, yes, it will do the RPC lookup and name the file accordingly.


----------



## windracer

rassi said:


> ok, for the CMD line it said SERVER BUSY Too many transfers in progress. For the PIPED line it said "Encryption by QUALCOMM " and hung at the command line (cursor never came back)


To clarify, I didn't mean to run them separately. The "PIPED to" part of the command goes after the first command (CMD) followed by the pipe (|) (see my example in the original post).

And I've seen the SERVER BUSY message before in testing. Usually rebooting the TiVo will clear that out.


----------



## rassi

windracer said:


> To clarify, I didn't mean to run them separately. The "PIPED to" part of the command goes after the first command (CMD) followed by the pipe (|) (see my example in the original post).
> 
> And I've seen the SERVER BUSY message before in testing. Usually rebooting the TiVo will clear that out.


Ok, will reboot the TiVo and try those commands together this evening.


----------



## rassi

rassi said:


> Ok, will reboot the TiVo and try those commands together this evening.


Ok, I rebooted our TiVo and just tried to play it through the Plex again before trying things in a command window, and I actually got it to play a video. But it only works with one video (Jimmy Kimmel Live from last night), any other video just shows the rotating circle, and if I quit that video and try to restart it, it won't restart without rebooting my PC.


----------



## windracer

That could be because tivodecode doesn't do well with some transport streams, which is why I added the tivolibre support. But the other Windows users here have reported issues getting it to work that I have not been able to figure out yet. So you could try turning on the tivolibre options in the settings. And again, running the debug commands via command-line may help to troubleshoot the problem.


----------



## rassi

windracer said:


> That could be because tivodecode doesn't do well with some transport streams, which is why I added the tivolibre support. But the other Windows users here have reported issues getting it to work that I have not been able to figure out yet. So you could try turning on the tivolibre options in the settings. And again, running the debug commands via command-line may help to troubleshoot the problem.


Would the fact that I have a VPN on that box have any effect? I've tried it both on and off... just curious.


----------



## rassi

windracer said:


> That could be because tivodecode doesn't do well with some transport streams, which is why I added the tivolibre support. But the other Windows users here have reported issues getting it to work that I have not been able to figure out yet. So you could try turning on the tivolibre options in the settings. And again, running the debug commands via command-line may help to troubleshoot the problem.


Ok, turned on tivolibre and that didn't make any difference. So tried running the command in a admin command prompt, it just put a bunch of high-bit ascii characters on my screen for a few seconds before it finally stopped scrolling. Never returned to the command line. Window changed to (Not Responding) and I think it died.


----------



## windracer

I wouldn't think so ... unless Plex has to access the TiVo over the VPN?


----------



## kbgators

windracer said:


> Glad you got it working.
> 
> I don't know how it could be used to download all recordings at once or new ones, sorry.


Thanks. 
I had a thought. What about a way to schedule daily downloads using this, so I can get a certain show daily from my tivo recordings onto Plex? Would be ideal to cut out the commercial as well as it comes over to Plex. Thoughts?


----------



## windracer

Again, I didn't write this plug-in originally, just tinkering with it. From what I understand, channels like this are initiated by the user (when you click on them in the app). Not sure how it would run in the background to download certain recordings. That's above my coding level when it comes to this. kmttg is probably better suited for something like that.


----------



## lew

kbgators said:


> Thanks.
> I had a thought. What about a way to schedule daily downloads using this, so I can get a certain show daily from my tivo recordings onto Plex? Would be ideal to cut out the commercial as well as it comes over to Plex. Thoughts?


That's what I do. It's really an alternative to the tivo plug in approach.

I set up auto transfers with kmttg. Download, cut commercials then encode putting the encoded video in my Plex folder. I use Windows task to schedule a task which creates auto skip from skip mode then process my auto transfers.


----------



## kbgators

lew said:


> That's what I do. It's really an alternative to the tivo plug in approach.
> 
> I set up auto transfers with kmttg. Download, cut commercials then encode putting the encoded video in my Plex folder. I use Windows task to schedule a task which creates auto skip from skip mode then process my auto transfers.


Thanks. I run my media server and Plex on headless Ubuntu so not sure how I would get kmttg to work on the setup.


----------



## windracer

kbgators said:


> Thanks. I run my media server and Plex on headless Ubuntu so not sure how I would get kmttg to work on the setup.


My Ubuntu server is headless too. You can use VNC to connect to your server (once you have the stuff for X Windows installed) to get to the GUI and get kmttg setup and then use the command-line to execute it in batch. I used to do this a while back when I was using kmttg for auto-downloads.


----------



## kbgators

windracer said:


> My Ubuntu server is headless too. You can use VNC to connect to your server (once you have the stuff for X Windows installed) to get to the GUI and get kmttg setup and then use the command-line to execute it in batch. I used to do this a while back when I was using kmttg for auto-downloads.


Hey thanks for the tip. Why don't you do auto-download anymore? Seems better than manually picking show if you need them daily.


----------



## windracer

To be honest I stopped back then because I was just using the TiVo mobile app more to watch the content. But now that I've found this Plex bundle and have been messing with it, I've thought about going back to a kmttg/Plex combination as I find myself using the Plex app to watch content on my phone now more than the TiVo app.


----------



## kbgators

windracer said:


> To be honest I stopped back then because I was just using the TiVo mobile app more to watch the content. But now that I've found this Plex bundle and have been messing with it, I've thought about going back to a kmttg/Plex combination as I find myself using the Plex app to watch content on my phone now more than the TiVo app.


That's my reasoning as well. I use radarr and sonarr to feed content to Plex, but some shows are only available by using TiVo, so I would like to get those over to Plex as well.


----------



## windracer

windracer said:


> I'll be honest, Windows folks, I'm stumped. Everything works fine with the existing tivodecode stuff, but when using tivolibre/java ...


Good news! Thanks to @stephen wheet I think tivolibre on Windows is working now. I've pushed a fix to the Github repo. I did a few basic tests on my barebones Windows Plex setup and streaming and downloading worked. Let me know how it goes.

The RPC call (needed to properly name the file) on Windows still isn't working. I believe it's a similar path/spaces issue for the certificate file.


----------



## windracer

windracer said:


> The RPC call (needed to properly name the file) on Windows still isn't working. I believe it's a similar path/spaces issue for the certificate file.


Can one of you Windows users test the RPC query function for the episode search (by filling in your TiVo Online username and password in the plug-in settings) and let me know if it fails for you too? You'll see something like this in the plug-in log:



Code:


2018-07-11 22:14:56,997 (2a14) :  INFO (logkit:16) - Executing episodeSearch
2018-07-11 22:14:57,002 (2a14) :  CRITICAL (core:574) - Exception (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-31d3c0c65\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 843, in handle_request
    result = f(**d)
  File "C:\Users\username\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Code\__init__.py", line 503, in downloadLocal
    remote = Remote(rpc_username, rpc_password)
  File "C:\Users\username\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Code\__init__.py", line 753, in __init__
    self.ssl_socket = ssl.wrap_socket(self.socket, certfile=getCertPath())
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\ssl.py", line 933, in wrap_socket
    ciphers=ciphers)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\ssl.py", line 580, in __init__
    self.getpeername()
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied

I thought maybe this was another Windows path/spaces issue with the certificate file, but after attempting some more debugging I'm not convinced of that anymore. The 10057 error seems to be connection/socket-related. I'm wondering if it's a difference in the ssl.py being used on Windows vs. Linux (Python 2.7). Really just guessing at this point ...


----------



## BrettStah

I can try it, but maybe not until the weekend.


----------



## reneg

I installed the tivotogo plugin on Windows and am seeing the following in the logs after selecting download locally:


Code:


2018-07-12 09:18:11,301 (273c) :  INFO (logkit:16) - Executing episodeSearch
2018-07-12 09:18:11,628 (273c) :  CRITICAL (core:574) - Exception (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-fd05be322\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 843, in handle_request
    result = f(**d)
  File "g:\temp\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Code\__init__.py", line 501, in downloadLocal
    remote = Remote(rpc_username, rpc_password)
  File "g:\temp\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Code\__init__.py", line 706, in __init__
    self.ssl_socket = ssl.wrap_socket(self.socket, certfile=certfile_path)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\ssl.py", line 933, in wrap_socket
    ciphers=ciphers)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\ssl.py", line 580, in __init__
    self.getpeername()
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied

Plugin seems to work ok with the exception of download. Running Python 2.7.3


----------



## windracer

reneg said:


> Plugin seems to work ok with the exception of download. Running Python 2.7.3


Ok, thanks for confirming it's not just my PC.  If you clear out your TiVo username and password from the plug-in settings, the download should work (as it will skip the episode name lookup which is causing this error/crash).


----------



## reneg

I'm late to the Plex Tivo plug-in game, but I was having trouble using the plug-in to download TS formatted files. I made some changes to enable TS downloads when TivoLibre is selected as well as change the file naming depending on whether the file is PS or TS format. I tried these changes on both a Roamio Pro & Premiere with both TS and PS files. Feel free to incorporate the changes or not. renegaudet/TiVoToGo.bundle


----------



## windracer

If it's safe to assume always downloading a .TS file with tivolibre enabled, I have no problem with those changes, thanks. Although I did make your suggested modifications a little differently which required no changes to the dlThread function (that keeps the debug/log messages correct and requires no messing with the filenames in the Popen calls).

And similar changes aren't necessary to the streaming part of the code you don't think?


----------



## reneg

No problem incorporating the changes however you see fit. This was my first time looking at the code at all.

I didn't even try streaming, but looking at the other routines, I'd say similar changes are necessary for the streaming part.

I've also been trying to figure out that 10057 error, but didn't have any luck. I'll keep poking at it as free time permits.


----------



## windracer

I appreciate it (and I'm sure others do too)!

I've noticed that using TS downloads seems to result in more choppy videos (macroblocking). I might add another option/preference so that you can enable tivolibre but then decide if you want TS downloads (your changes) or the MPEG downloads (original code).


----------



## reneg

Would you mind adding in a couple of lines of code to support listing multiple Tivos? This will remove white space & split Tivos by IP address that are comma separated from the configuration page. Change is located in the MainMenu function

Current:


Code:


        if tivoName == "":
            discoverTiVo(oc)
        else:
            oc.add(DirectoryObject(key=Callback(getTivoShows, tivoName=tivoName, tivoip=tivoName), title=L(tivoName)))

Proposed change:


Code:


        if tivoName == "":
            discoverTiVo(oc)
        else:
            tivos = tivoName.replace(' ','').split(',')
            for x in range (0, len(tivos)) :
                oc.add(DirectoryObject(key=Callback(getTivoShows, tivoName=tivos[x], tivoip=tivos[x]), title=L(tivos[x])))

Thanks


----------



## windracer

If you leave the TiVo list empty it should auto-discover them on your network. Is that not working for you?


----------



## BrettStah

I still would love it if only one tivo is found (or manually listed), then it would just so that screen completely.


----------



## windracer

I've got that enhancement logged, and did take a look at it a while ago, but didn't make any progress. Still, it's listed.


----------



## BrettStah

windracer said:


> I've got that enhancement logged, and did take a look at it a while ago, but didn't make any progress. Still, it's listed.


I don't know much about JavaScript at all but I was thinking that a function could be written that counts the number of tickets, and if it equals 1, it would then do whatever action that is normally done by way of the button click on that page.


----------



## reneg

windracer said:


> If you leave the TiVo list empty it should auto-discover them on your network. Is that not working for you?


Auto discovery is not working for me


----------



## windracer

reneg said:


> Auto discovery is not working for me


On Windows, I'm guessing? The original code said that auto-discovery wasn't working on Windows but in my testing it does work ... sometimes. I have to launch the plug-in a few times and eventually it lists my TiVos. But yeah, sometimes it shows 0 boxes. I'm curious if you keep trying the plug-in if the TiVos will be discovered.

That being said, I don't see why allowing multiple IP addresses in that field would be a problem. Thanks for the code suggestion.


----------



## windracer

reneg said:


> Would you mind adding in a couple of lines of code to support listing multiple Tivos?


I've added this, and also an option to download TS files with tivolibre (instead of requiring it).


----------



## windracer

BrettStah said:


> I don't know much about JavaScript at all but I was thinking that a function could be written that counts the number of tickets, and if it equals 1, it would then do whatever action that is normally done by way of the button click on that page.


This is written in Python, not JavaScript, but either way yeah, the pseudo-code/logic is the easy part. Figuring out how to do that in someone else's code is not always as easy. 

That being said, I think I figured it out for you! I've pushed a new commit with the code changes. I did some cursory testing on Linux and Windows with both auto-discovery and specified IP addresses and it seems to work. And when you kick off a download, the "Active Downloads" menu item is appended to the end of the list of shows, just like it would be on the main menu. So everything seems to work as expected. Let me know what you think.


----------



## reneg

windracer said:


> On Windows, I'm guessing? The original code said that auto-discovery wasn't working on Windows but in my testing it does work ... sometimes. I have to launch the plug-in a few times and eventually it lists my TiVos. But yeah, sometimes it shows 0 boxes. I'm curious if you keep trying the plug-in if the TiVos will be discovered.
> 
> That being said, I don't see why allowing multiple IP addresses in that field would be a problem. Thanks for the code suggestion.


Yes, Windows. I tried re-launching the plug-in several times and it never discovered any of my Tivos.

Thanks for including the change to allow configuring multiple Tivos.


----------



## Dunnie

I installed on my synology ... I see my tivo .. but the list is blank ... any idea ? DO I need to supply a download directory ? Or will it default to some default ?


----------



## windracer

Did you go into the plug-in settings and enter your MAK and configure the other options there? That's also where you specify the download directory, etc. See Step #5 of the installation steps on the main Github page.


----------



## kbgators

I would still love a way to automatically download a tivo recording every day. 

There a show that airs every day at the same time so maybe some type of daily cron job? Not sure how to do this.


----------



## windracer

kbgators said:


> I would still love a way to automatically download a tivo recording every day.
> 
> There a show that airs every day at the same time so maybe some type of daily cron job? Not sure how to do this.


Plex plug-ins don't run in the background so I don't really know of a way to do this.

I use kmttg instead: the auto-transfer feature automatically downloads the shows I want and drops them in the directory where Plex can see them.


----------



## kbgators

windracer said:


> Plex plug-ins don't run in the background so I don't really know of a way to do this.
> 
> I use kmttg instead: the auto-transfer feature automatically downloads the shows I want and drops them in the directory where Plex can see them.


Thanks, so with kmttg can it all be automated to run daily?


----------



## windracer

Well, you can run it as a service so it's always running in the background and then every hour it checks for your auto-transfers and downloads/converts, etc. I believe you can also run it from the command-line so you could schedule it to run when you want (more details here).


----------



## rassi

I believe Plex recently posted that they are EOL'ing plug-ins as not enough users use them and it's not worth their development time. Don't know how long before plug-ins stop working.... It sounds like they'll support them for a while...

Subtitles and Sunsets: big improvements and a little housekeeping | Plex


----------



## ke3ju

rassi said:


> I believe Plex recently posted that they are EOL'ing plug-ins as not enough users use them and it's not worth their development time. Don't know how long before plug-ins stop working.... It sounds like they'll support them for a while...
> 
> Subtitles and Sunsets: big improvements and a little housekeeping | Plex


Looks like you'll still be able to install them manually.


----------



## rassi

ke3ju said:


> Looks like you'll still be able to install them manually.


I don't think support for them will last forever. Just something to keep in mind. I would love if there was an official app for Roku, for example, for my Tivo...


----------



## dozer1dave

This looks l ike a neat plug-in. Thanks for taking it on windracer!

I am trying to install on my DS918+ Synology NAS. I believe I have the 32-bit java, curl, and plug-in in place. I can see the plug-in in plex and I setup the MAK and config parameters in the plug-in config. It sees my tivos but it does not see any content. I see an error in the log as shown below. Any ideas? Thanks



Code:


2018-10-13 20:58:34,639 (7f88b6deb700) :  DEBUG (runtime:924) - Response: [200] MediaContainer, 877 bytes
2018-10-13 20:58:36,442 (7f88b66bd700) :  DEBUG (runtime:717) - Handling request GET /video/tivotogo/shows?url=https%3A%2F%2F192.168.1.172%3A443%2FTiVoConnect%3FCommand%3DQueryContainer%26Container%3D%252FNowPlaying&tivoip=192.168.1.172&tivoName=Bedroom
2018-10-13 20:58:36,444 (7f88b66bd700) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2018-10-13 20:58:36,445 (7f88b66bd700) :  DEBUG (runtime:814) - Found route matching /video/tivotogo/shows
2018-10-13 20:58:36,446 (7f88b66bd700) :  INFO (__init__:80) - getTivoShowsByIPURL: https://192.168.1.172:443/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying&AnchorOffset=0
2018-10-13 20:58:36,475 (7f88b66bd700) :  INFO (__init__:172) - Got a URLError trying to open https://192.168.1.172:443/TiVoConnect?Command=QueryContainer&Container=%2FNowPlaying
2018-10-13 20:58:36,476 (7f88b66bd700) :  INFO (__init__:172) - Failed with reason : SSLV3_ALERT_BAD_RECORD_MAC
2018-10-13 20:58:36,478 (7f88b66bd700) :  DEBUG (runtime:88) - Sending packed state data (109 bytes)
2018-10-13 20:58:36,478 (7f88b66bd700) :  DEBUG (runtime:924) - Response: [200] MediaContainer, 272 bytes


----------



## windracer

A quick search on that error (SSLV3_ALERT_BAD_RECORD_MAC) seems to indicate a problem between Python and OpenSSL. Which versions are running on your Syno? Are you able to open that URL (https://192.168.1.172:443/TiVoConnect?Command=QueryContainer&Container=/NowPlaying&AnchorOffset=0) from a browser on your PC?


----------



## dozer1dave

windracer said:


> A quick search on that error (SSLV3_ALERT_BAD_RECORD_MAC) seems to indicate a problem between Python and OpenSSL. Which versions are running on your Syno? Are you able to open that URL (https://192.168.1.172:443/TiVoConnect?Command=QueryContainer&Container=/NowPlaying&AnchorOffset=0) from a browser on your PC?


I am able to open the URL. My python is version 2.7.12 and OpenSSL version 1.0.2o (march 2018). I'll google more and report findings, just wanted to make sure this was not a known issue.


----------



## windracer

If you can't open that URL in a browser, the plug-in won't be able to either. Under Settings > Remote, CableCARD & Devices on your TiVo, have you enabled network remote control?


----------



## dozer1dave

windracer said:


> If you can't open that URL in a browser, the plug-in won't be able to either. Under Settings > Remote, CableCARD & Devices on your TiVo, have you enabled network remote control?


I am able to open the URL and Network Remote control was enabled.

I did find that by modifying __init__.py line 84 from:
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
to
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
I can now get the list of shows on my TiVo via the plug-in!

They still will not play....I am getting:


Code:


2018-10-15 21:55:09,169 (7f1cb6b7d700) :  DEBUG (__init__:332) - CMD: "/usr/bin/curl" "http://192.168.1.12:80/download/Ghostbusters.TiVo?Container=%2FNowPlaying&id=15643" --digest -s -u tivo:9743729572 -c "/volume1/Plex/tmp_transcoding/cookies.txt"
2018-10-15 21:55:09,193 (7f1cb6b7d700) :  DEBUG (__init__:337) - PIPED to: "/volume1/@appstore/Java8/j2sdk-image/bin/java" -jar "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 9743729572 -
2018-10-15 21:55:09,276 (7f1cb6b7d700) :  INFO (__init__:346) - Starting decoder
2018-10-15 21:55:13,707 (7f1cb6b7d700) :  INFO (__init__:354) - Unexpected error: [Errno 104] Connection reset by peer
2018-10-15 21:55:13,708 (7f1cb6b7d700) :  INFO (__init__:362) - tivodecode/curl terminated
2018-10-15 21:55:14,244 (7f1cb65a1700) :  DEBUG (runtime:717) - Handling request GET /video/tivotogo/:/function/CreateVideoClipObject?function_args=Y2VyZWFsMQoxCmRpY3QKNwpiMXM5CmNvbnRhaW5lcnM3MwovOi9wbHVnaW5zL2NvbS5wbGV4YXBwLnBsdWdpbnMudGl2b3RvZ28vcmVzb3VyY2VzL2FydC10di5qcGc%40dD0xNTM5NDYyMjE2czUKdGh1bWJzNTAKVGhlIExhc3QgV29yZCBXaXRoIExhd3JlbmNlIE8nRG9ubmVsbCAtIDEwLTE1LTIwMThzNQp0aXRsZXMxNzkKaHR0cDovLzEyNy4wLjAuMTo0OTQ5Mi9hSFIwY0Rvdkx6RTVNaTR4TmpndU1TNHhNam80TUM5a2IzZHViRzloWkM5VWFHVWxNakJNWVhOMEpUSXdWMjl5WkNVeU1GZHBkR2dsTWpCTVlYZHlaVzVqWlNVeU1FOG5SRzl1Ym1Wc2JDNVVhVlp2UDBOdmJuUmhhVzVsY2owbE1rWk9iM2RRYkdGNWFXNW5KbWxrUFRFMU5qUXpzMwp1cmxzMTAKMTAtMTUtMjAxOHM3CnRhZ2xpbmVzOTYKQW5hbHlzaXMgYW5kIGRpc2N1c3Npb24gb2YgdGhlIGRheSdzIHRvcCBzdG9yaWVzIGFuZCBjb21wZWxsaW5nIGlzc3VlcyBmcm9tIExhd3JlbmNlIE8nRG9ubmVsbC4gczcKc3VtbWFyeXM3CjM3ODAwMDBzOApkdXJhdGlvbnIwCg__
2018-10-15 21:55:14,247 (7f1cb65a1700) :  DEBUG (runtime:814) - Found route matching /video/tivotogo/:/function/CreateVideoClipObject
2018-10-15 21:55:14,248 (7f1cb65a1700) :  DEBUG (runtime:125) - Calling function 'CreateVideoClipObject'
2018-10-15 21:55:14,248 (7f1cb65a1700) :  DEBUG (__init__:178) - Starting a thread
2018-10-15 21:55:14,249 (7f1cb65a1700) :  DEBUG (__init__:180) - Done starting a thread
2018-10-15 21:55:14,249 (7f1cb65a1700) :  WARNING (runtime:1065) - Generating a callback path for a function with no route: <function CreateVideoClipObject at 0x7f1cbc089668>


----------



## windracer

Sorry, misread your post about accessing the URL. Glad you got the initial connection working with the ssl_context change (I'll have to test that here and see if it breaks anything).

For some reason either curl or tivodecode is terminating. It looks like curl is losing the connection to your TiVo ("connection reset by peer"). Have you tried using the tivolibre option? To debug, you can also try putting together the "CMD" and "PIPED to" debug messages onto the command-line if your NAS and see if there's anything more informative that happens.



Code:


/usr/bin/curl "http://192.168.1.12:80/download/Ghostbusters.TiVo?Container=%2FNowPlaying&id=15643" --digest -s -u tivo:{MAK} -c "/volume1/Plex/tmp_transcoding/cookies.txt" | "/volume1/@appstore/Java8/j2sdk-image/bin/java" -jar "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m {MAK} -

Just a side note: you might want to edit your MAK out of the log post. Most people like to keep those private.


----------



## dozer1dave

windracer said:


> Sorry, misread your post about accessing the URL. Glad you got the initial connection working with the ssl_context change (I'll have to test that here and see if it breaks anything).
> 
> For some reason either curl or tivodecode is terminating. It looks like curl is losing the connection to your TiVo ("connection reset by peer"). Have you tried using the tivolibre option? To debug, you can also try putting together the "CMD" and "PIPED to" debug messages onto the command-line if your NAS and see if there's anything more informative that happens.
> 
> 
> 
> Code:
> 
> 
> /usr/bin/curl "http://192.168.1.12:80/download/Ghostbusters.TiVo?Container=%2FNowPlaying&id=15643" --digest -s -u tivo:{MAK} -c "/volume1/Plex/tmp_transcoding/cookies.txt" | "/volume1/@appstore/Java8/j2sdk-image/bin/java" -jar "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m {MAK} -
> 
> Just a side note: you might want to edit your MAK out of the log post. Most people like to keep those private.


Thanks for the MAK suggestion......I fabricated that MAK but I guess I should have made it obvious! I am using the tivolibre option. Below is my output from running in shell. The key I see is "24942 is an unsupported chunk type" but I dont get any google hits on it. What openSSL, java, python versions are you running on your linux?



Code:


 "/usr/bin/curl" "http://192.168.1.172:80/download/Nature.TiVo?Container=%2FNowPlaying&id=1274" --digest -s -u tivo:0000000000 -c "/volume1/Plex/tmp_transcoding/cookies.txt"|"/volume1/@appstore/Java8/j2sdk-image/bin/java" -jar "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0000000000 -
Oct 16, 2018 4:13:20 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
Oct 16, 2018 4:13:20 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
Error reading chunk:
java.lang.IllegalArgumentException: 24942 is an unsupported chunk type
        at net.straylightlabs.tivolibre.TivoStreamChunk$ChunkType.valueOf(TivoStreamChunk.java:139)
        at net.straylightlabs.tivolibre.TivoStreamChunk.read(TivoStreamChunk.java:62)
        at net.straylightlabs.tivolibre.TivoStream.processMetadata(TivoStream.java:104)
        at net.straylightlabs.tivolibre.TivoStream.process(TivoStream.java:77)
        at net.straylightlabs.tivolibre.TivoDecoder.decode(TivoDecoder.java:69)
        at net.straylightlabs.tivolibre.DecoderApp.decode(DecoderApp.java:187)
        at net.straylightlabs.tivolibre.DecoderApp.run(DecoderApp.java:142)
        at net.straylightlabs.tivolibre.DecoderApp.main(DecoderApp.java:56)
Oct 16, 2018 4:13:22 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
WARNING: Could not lock User prefs.  Unix error code 2.
Oct 16, 2018 4:13:22 PM java.util.prefs.FileSystemPreferences syncWorld
WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.


----------



## windracer

On my Ubuntu server I've got Python 2.7.15rc1, Java 1.8.0_181, and OpenSSL 1.1.0g.

Have you tried just downloading a recording instead of streaming? Probably the same problem but worth a shot. It looks like from your command-line output that maybe there's a permissions issue (I see "no such file or directory" and "couldn't get file lock" amongst others). Are you running that command-line as root? Those errors are coming from tivolibre and not the plug-in itself so you might also want to try the default tivodecode instead of tivolibre and see if there's a difference.


----------



## Vet4Hire

Hello all!! can you give me directions on how to auto connect to the Tivo? mine will not connect at all. Am I required to enter code in python or something? thank you!!


----------



## windracer

Did you follow the setup instructions in the README on the Github page? Did you enter your settings like your MAK into the plug-in? I need more details about what's happening or what you're seeing/not seeing.


----------



## Vet4Hire

Yes step by step. I have access to the plugin on my Tivo Bolt, my MAK is enter, and I can watch the show that I record through the plugin. I am unable to locate the DVR through the Plex online DVR live TV in the settings. I have tried everything even putting my Tivo IP in. It still will not access the sows on the first page. Thank you for the help in advance. Is it any code that has to be changed in python?


----------



## reneg

Vet4Hire said:


> Yes step by step. I have access to the plugin on my Tivo Bolt, my MAK is enter, and I can watch the show that I record through the plugin. I am unable to locate the DVR through the Plex online DVR live TV in the settings. I have tried everything even putting my Tivo IP in. It still will not access the sows on the first page. Thank you for the help in advance. Is it any code that has to be changed in python?


That Plex functionality won't work with Tivo. Plex supports the following devices for DVR live TV: Supported DVR Tuners and Antennas | Plex Support


----------



## windracer

It sounds like we're discussing two different things. This plug-in is to download or watch recordings from your TiVo in Plex. It doesn't have anything to with online DVR/live TV functionality.


----------



## robojerk

My Plex server is kind of beefy, but if I try to "transcode and play" through Plex it will eventually fail. However I'm fine just to download the files then play after it's done downloading. However my Plex doesn't recognize .ts files.
If I do something like this then the Plex will recognize the files after the transcode.


Code:


ffmpeg -i /path/to/TTG/dir/downloaded.ts -vcodec h264 -acodec aac -f mp4 /path/to/TTG/dir/output.mp4


----------



## windracer

Are you using tivolibre? That should recognize .TS files. I tend to get choppy/pixelated playback if I use .TS files so I don't use them. There are options to enable tivolibre and .TS downloads in the plug-in settings.


----------



## robojerk

I'm using tivolibre to decode the SomeShow.tivo file on my TiVo and it creates a .ts file in the TTG folder. However the Plex acts like nothing is there.


----------



## windracer

Strange, it works for me. Just to clarify, are you using the Plex plug-in to download the .TS file? It sounds like maybe you're downloading the .TiVo/.TS file outside of the plug-in into your TTG folder. And that TTG folder is added to Plex? And you've tried a "rescan" in Plex and it still doesn't show up?


----------



## windracer

OneLoveAmaru said:


> Whether I download as a ts or mp4 file, Plex won't index it, unless it's a movie. Shows need to have season and episode information, which isn't in the file name or metadata. I opened up a github issue to see if there is a way to integrate this information when downloaded.


My fork of the TiVo plug-in for Plex includes the file naming required for Plex to pick it up as a TV show. On which Github project did you file an issue?


----------



## windracer

Ok, I see it now (didn't get an alert from Github for some reason).

Like I mentioned, the plug-in _does_ do proper file naming for TV episodes, but you need to fill in your TiVo Online username and password in the plug-in settings so it can do the RPC call to look up episode information.

That being said, this feature doesn't work if you are running Plex on Windows (issue #5) and I really haven't worked on that lately. Works fine one Linux though!


----------



## windracer

No worries, glad it worked for ya!


----------



## canbonbon

Hello, I have TIVO Roamio OTA and I just installed this bundle on the latest PLEX server on Windows. Its a pretty powerful machine. However, I see buffering in most programs I tried to watch. Is there any setting that I could modify to fix that? I did not try the download option yet. I could do that if all else fails. Both TIVO and Plex server are connected via Ethernet to the same gigabit network (but TIVO only uses 100mbps ethernet). Let me know if you have any suggestions to improve that.

Also, one more thing. Plex does not display any posters for the shows. It just shows the list. Anyway to enable the posters?


----------



## windracer

canbonbon said:


> However, I see buffering in most programs I tried to watch. Is there any setting that I could modify to fix that? I did not try the download option yet. I could do that if all else fails.


I don't do a lot of streaming via the app. I have kmttg running on my Linux server which auto-downloads content into my Plex folders and then I play those downloads.



canbonbon said:


> Also, one more thing. Plex does not display any posters for the shows. It just shows the list. Anyway to enable the posters?


Are you talking about when browsing the contents of your TiVo through the Plex plug-in? If so, that's the way it currently is: just the list of shows. It's using the XML interface to pull the Now Playing list from the TiVo and just displaying it so there's no posters as part of that. It might be possible to parse the contents and do lookups, but that would really slow it down. Once the files are downloaded to your Plex server, Plex will properly match the metadata and show posters, episode info, etc.


----------



## osu1991

Plex is removing plug in support, so eventually plug ins will go away.


----------



## BrettStah

From: *Plex is Killing the Plugin Directory, Here's How to Install Plugins Yourself*


> Plex is shutting down its plugin directory, but will continue to support manually installed plugins "for the foreseeable future."


----------



## windracer

"Eventually" is pretty vague. The original announcement said "But don't panic-while the Plugin Directory will soon be gone, you can still manually install plugins _for the foreseeable future_."

_edit:_ @BrettStah ninja'ed me to it.


----------



## osu1991

Take it however you want. Just passing it along for those that don’t visit Plex forums often. After the debacle of the Roku upgrade last month with that crappy new UI. Plugins were removed from the Roku interface and Elan has said they are gone and not coming back. Eventually or foreseeable future, in the end it is going away.


----------



## mulder5000

I have a new Bolt OTA and am trying to set up this plex plugin so I can stream my recordings to other TVs. My Plex server is on Windows 10. When I click on a show to stream, it just spins forever until I go back. I'm seeing the following in the logs.



Code:


2019-02-07 15:04:09,586 (44f8) :  INFO (logkit:16) - GET URL: http://192.168.1.142:80/download/Gordon%20Ramsay's%2024%20Hours%20to%20Hell%20%26%20Back.TiVo?Container=%2FNowPlaying&id=22
2019-02-07 15:04:09,588 (44f8) :  DEBUG (logkit:13) - CMD: "C:\Users\xxxx\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\curl.exe" "http://192.168.1.142:80/download/Gordon%20Ramsay's%2024%20Hours%20to%20Hell%20%26%20Back.TiVo?Container=%2FNowPlaying&id=22" --digest -s -u tivo:xxxxxxxxxx -c "c:\users\xxxx\appdata\local\temp/cookies.txt"
2019-02-07 15:04:09,598 (44f8) :  DEBUG (logkit:13) - PIPED to: "C:\Users\xxxx\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\win\tivodecode.exe" -m xxxxxxxxxx -
2019-02-07 15:04:09,602 (44f8) :  INFO (logkit:16) - Starting decoder
2019-02-07 15:04:11,292 (44f8) :  INFO (logkit:16) - Unexpected error: [Errno 10054] An existing connection was forcibly closed by the remote host
2019-02-07 15:04:11,293 (44f8) :  INFO (logkit:16) - tivodecode/curl terminated

If I run the CMD and PIPED lines together in the command prompt, I see a bunch of gibberish on the screen, which makes it seem like curl and tivodecode are working.

Any ideas on how to solve the error: Unexpected error: [Errno 10054] An existing connection was forcibly closed by the remote host?


----------



## windracer

Not sure ... sounds like the connection is being closed by the TiVo for some reason. I've run into strange issues sometimes where the TiVo will just stop responding to the plug-in and a reboot (of the TiVo) usually fixes it. Have you tried that? Is this a wired or wireless network?


----------



## mulder5000

I just restarted both the TiVo and the PC running Plex. The log shows the same error. All devices are currently wired, although I plan on using the plugin on a couple wireless devices if I can get it working.


----------



## windracer

Maybe try using tivolibre instead of tivodecode? 

To be honest I don't use this plug-in a lot for streaming directly from the TiVo. That and I don't run Plex on Windows so these types of problems are hard for me to track down.


----------



## mulder5000

I selected the option for tivolibre and put in the full path to the 32-bit java exe. Same error.

Thanks for the help. If I figure out anything while I'm playing around with it, I'll let you know.


----------



## windracer

Do regular downloads through the plug-in work? Is it just streaming that fails with the connection error?


----------



## mulder5000

I enabled the download option and set up a download folder. The download doesn't work, but I get a different error now.



Code:


2019-02-08 14:48:21,198 (2854) :  INFO (logkit:16) - URL: http://192.168.1.142:80/download/Gordon%20Ramsay's%2024%20Hours%20to%20Hell%20%26%20Back.TiVo?Container=%2FNowPlaying&id=22
2019-02-08 14:48:21,198 (2854) :  INFO (logkit:16) - Title: Gordon Ramsay's 24 Hours to Hell & Back - Bayou on the Vine
2019-02-08 14:48:21,200 (2854) :  INFO (logkit:16) - Search title  : Gordon Ramsay's 24 Hours to Hell & Back
2019-02-08 14:48:21,200 (2854) :  INFO (logkit:16) - Search episode: Bayou on the Vine
2019-02-08 14:48:21,200 (2854) :  INFO (logkit:16) - Executing episodeSearch
2019-02-08 14:48:21,203 (2854) :  CRITICAL (core:574) - Exception (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-cc260c476\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 843, in handle_request
    result = f(**d)
  File "C:\Users\xxxx\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Code\__init__.py", line 501, in downloadLocal
    remote = Remote(rpc_username, rpc_password)
  File "C:\Users\xxxx\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Code\__init__.py", line 724, in __init__
    self.ssl_socket = ssl.wrap_socket(self.socket, certfile=certfile_path)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\ssl.py", line 933, in wrap_socket
    ciphers=ciphers)
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\ssl.py", line 580, in __init__
    self.getpeername()
  File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied


----------



## windracer

That's a known issue on Windows. The RPC call to retrieve show information fails. Just clear out your TiVo Online username and password from the plug-in options and try again.


----------



## mulder5000

That did the trick for both downloading and streaming. Thanks so much for the help!


----------



## windracer

Great!

I didn't think the RPC call was being used during streaming ... if I have a chance I'll look into that. Didn't think I was going to kill two birds with one stone there. 

_edit:_ or maybe it was the switch to tivolibre


----------



## mulder5000

Just for fun, I put my username and password back in and tried the streaming again. It worked. Downloading didn't, as expected. I then tried removing the option for tivolibre and that worked too. I wonder if there was a setting such as video sharing or video downloads that took awhile to work its way to/through the TiVo.

I'm only recording OTA channels on this box. Do you recommend using tivolibre or tivodecode?


----------



## windracer

Strange.

I personally use tivolibre as it seems to handle some transcoding jobs better than others. And if you want transport streams (.ts) you have to use it. But it's personal preference as to what works for you.


----------



## jonw747

I don't think Windows is happy with mixing forward slashes with back slashes.

aka: "c:\users\xxxx\appdata\local\temp/cookies.txt"

There's a few places in __init__.py, where a file with a / is appended to a path that uses \. It's pretty simple to kludge for windows users by changing / to \\ where you see + "/cookies.txt and + "/cdata.pem, something more OS aware should be done for the real code.

Seemed like I had to shutdown Plex, and re-start it to convince it to re-process the plugin script.

I've been having problems getting more than 1 downloaded file to showup in Plex. Not sure why, plus the episode naming is pretty bad. The tivo server connection option doesn't seem to be working for me, either, even with the change to cdata.pem - it's getting a connection error.


----------



## windracer

jonw747 said:


> Not sure why, plus the episode naming is pretty bad. The tivo server connection option doesn't seem to be working for me, either, even with the change to cdata.pem - it's getting a connection error.


That's a known issue on Windows (and to be honest, I'm not really actively working on it, sorry).

I thought I had corrected all the OS slash stuff. If I get a chance I'll look into it again (again, my primary platform for Plex isn't Windows).


----------



## windracer

windracer said:


> I thought I had corrected all the OS slash stuff. If I get a chance I'll look into it again (again, my primary platform for Plex isn't Windows).


FYI, I've pushed a quick fix for the forward slash stuff. Windows is supposed to work with both kinds, but it's better to not hard code the forward slash.


----------



## jonw747

windracer said:


> FYI, I've pushed a quick fix for the forward slash stuff. Windows is supposed to work with both kinds, but it's better to not hard code the forward slash.


Windows doesn't like forward slashes, it's probably Python handling it in some cases (but not others).


----------



## HerronScott

jonw747 said:


> Windows doesn't like forward slashes, it's probably Python handling it in some cases (but not others).


While it may not like them, they do work in a number of places like Start, Run C:/Windows/System32 or a cmd prompt like cd /users/default. Honestly I didn't realize this until the post above indicating it should support them. 

Scott


----------



## ke3ju

HerronScott said:


> While it may not like them, they do work in a number of places like Start, Run C:/Windows/System32 or a cmd prompt like cd /users/default. Honestly I didn't realize this until the post above indicating it should support them.
> 
> Scott


There was a Windows 7 patch years ago that made forward slashes work. We found this out at work. A batch file we sent out to 5000 users had a forward slash in it. It worked on our test machines (latest patches applied), but not the field machines (patches not applied). It sucked to say the least. The client told us every machine in the field was up to date, in our defense.

I think the patch had something to do with POSIX support.


----------



## jonw747

HerronScott said:


> While it may not like them, they do work in a number of places like Start, Run C:/Windows/System32 or a cmd prompt like cd /users/default. Honestly I didn't realize this until the post above indicating it should support them.
> 
> Scott


Yeah, it looks like the underlying win32 API called CreateFile() permits either type of slash, so, really what we're dealing with are issues with the command interpreter because "/" is used to specify options.

Even the cd command which seems the most permissive is going to cause problems if you have a folder named "D" because cd supports a "/D" switch.

Anyway, thanks to windracer for keeping this project afloat.

Do you or windracer think it would be possible to workout the issues with recording under Windows and to implement the ability to resume a program from where it was watched last? With both of those, the plug in would be pretty awesome for remote viewing with Plex. I'm not asking if you'd fix the problems running under Windows, just wondering if you think the problems are fixable.


----------



## ligand

Hi. Thanks for creating this plugin. I'm trying to install it on a PMS running on OSX. Both TivoDecode and TivoLibre aren't working in my configuration. I've taking the commands and piped them together and it produced a lot of garbage on my screen. However when the commands run within the plugin I get a "broken pipe" error. I'm copying my the pertinent log entries below:
2019-03-20 23:40:21,931 (70000f078000) : INFO (__init__:324) - GET URL: http://192.168.25.126:80/download/Whiskey Cavalier.TiVo?Container=/NowPlaying&id=11326

2019-03-20 23:40:21,932 (70000f078000) : DEBUG (__init__:332) - CMD: "/usr/bin/curl" "http://192.168.25.126:80/download/Whiskey Cavalier.TiVo?Container=/NowPlaying&id=11326" --digest -s -u tivo:0123456789 -c "/var/folders/9q/8cw7cjqd2bb8ypgpnd_5zxmw0000gn/T/cookies.txt"

2019-03-20 23:40:21,941 (70000f078000) : DEBUG (__init__:337) - PIPED to: "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -jar "/Users/niten/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0123456789 -

2019-03-20 23:40:21,948 (70000f078000) : INFO (__init__:346) - Starting decoder

2019-03-20 23:40:23,382 (70000f078000) : INFO (__init__:354) - Unexpected error: [Errno 32] Broken pipe

2019-03-20 23:40:23,383 (70000f078000) : INFO (__init__:362) - tivodecode/curl terminated

Nitens-MBP-i7:bin niten$ "/usr/bin/curl" "http://192.168.25.126:80/download/Whiskey Cavalier.TiVo?Container=/NowPlaying&id=11326" --digest -s -u tivo:0123456789 -c "/var/folders/9q/8cw7cjqd2bb8ypgpnd_5zxmw0000gn/T/cookies.txt" | "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -jar "/Users/niten/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0123456789 -

?DJ|?????

A!?䪽[email protected]???????AC-3)???????1???!d???

??????AKQ??DTG1A??GA94B???????3|??C?UK?c{

?7?????2HU <?o?*??I??Y?Ұ????e???!>?????"Ho?~?M?T7??岱,2[+?j?r???*䑕??I??}????&)???t?#b????}r??gP2?/|#:?bC?;??????w????"y-?*?K??????O+2]<?o?\E??^???߼?b7?????rLo?E??gz]uJ^?#~?.Vw?-?????M?????}?O?⣾X?_??uߝk?'[email protected]\?Р??̰????Θ*???ʖ???̘?W?̚?h?l?2veOI̕??????T¬??A??(ʒ

?2?*u???X2S

?{[email protected][email protected]}????t???)f~r

?ͤ??


----------



## jonw747

ligand said:


> Hi. Thanks for creating this plugin. I'm trying to install it on a PMS running on OSX. Both TivoDecode and TivoLibre aren't working in my configuration. I've taking the commands and piped them together and it produced a lot of garbage on my screen. However when the commands run within the plugin I get a "broken pipe" error. I'm copying my the pertinent log entries below:
> 2019-03-20 23:40:21,931 (70000f078000) : INFO (__init__:324) - GET URL: http://192.168.25.126:80/download/Whiskey Cavalier.TiVo?Container=/NowPlaying&id=11326
> 
> 2019-03-20 23:40:21,932 (70000f078000) : DEBUG (__init__:332) - CMD: "/usr/bin/curl" "http://192.168.25.126:80/download/Whiskey Cavalier.TiVo?Container=/NowPlaying&id=11326" --digest -s -u tivo:0123456789 -c "/var/folders/9q/8cw7cjqd2bb8ypgpnd_5zxmw0000gn/T/cookies.txt"
> 
> 2019-03-20 23:40:21,941 (70000f078000) : DEBUG (__init__:337) - PIPED to: "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -jar "/Users/niten/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0123456789 -
> 
> 2019-03-20 23:40:21,948 (70000f078000) : INFO (__init__:346) - Starting decoder
> 
> 2019-03-20 23:40:23,382 (70000f078000) : INFO (__init__:354) - Unexpected error: [Errno 32] Broken pipe
> 
> 2019-03-20 23:40:23,383 (70000f078000) : INFO (__init__:362) - tivodecode/curl terminated
> 
> Nitens-MBP-i7:bin niten$ "/usr/bin/curl" "http://192.168.25.126:80/download/Whiskey Cavalier.TiVo?Container=/NowPlaying&id=11326" --digest -s -u tivo:0123456789 -c "/var/folders/9q/8cw7cjqd2bb8ypgpnd_5zxmw0000gn/T/cookies.txt" | "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -jar "/Users/niten/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0123456789 -
> 
> ?DJ|?????
> 
> A!?䪽[email protected]???????AC-3)???????1???!d???
> 
> ??????AKQ??DTG1A??GA94B???????3|??C?UK?c{
> 
> ?7?????2HU <?o?*??I??Y?Ұ????e???!>?????"Ho?~?M?T7??岱,2[+?j?r???*䑕??I??}????&)???t?#b????}r??gP2?/|#:?bC?;??????w????"y-?*?K??????O+2]<?o?\E??^???߼?b7?????rLo?E??gz]uJ^?#~?.Vw?-?????M?????}?O?⣾X?_??uߝk?'[email protected]\?Р??̰????Θ*???ʖ???̘?W?̚?h?l?2veOI̕??????T¬??A??(ʒ
> 
> ?2?*u???X2S
> 
> ?{[email protected][email protected]}????t???)f~r
> 
> ?ͤ??


You may have configured the "Path to Java runtime" wrong. Admittedly the thread has been pretty confusing on the right setting, but you need to specify the path to the java executable, otherwise it's trying to pipe the stream in to a folder rather than an application.

It could also be a permission error.

so for instance, if you type:

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java

at a Bash prompt, does it look like it's trying to run java? Or is that actually just a folder that includes java?

In general, what you want to do is check all the paths/programs/commands in the log output and make sure they're all legit (as much as you can).


----------



## ligand

jonw747 said:


> You may have configured the "Path to Java runtime" wrong. Admittedly the thread has been pretty confusing on the right setting, but you need to specify the path to the java executable, otherwise it's trying to pipe the stream in to a folder rather than an application.
> 
> It could also be a permission error.
> 
> so for instance, if you type:
> 
> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
> 
> at a Bash prompt, does it look like it's trying to run java? Or is that actually just a folder that includes java?
> 
> In general, what you want to do is check all the paths/programs/commands in the log output and make sure they're all legit (as much as you can).


So "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" is the path to the actual executable. I changed the Java path configuration to be "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin" and now I get:

019-03-21 21:14:20,880 (700004cb5000) : DEBUG (__init__:180) - Done starting a thread

2019-03-21 21:14:20,880 (700004cb5000) : WARNING (runtime:1065) - Generating a callback path for a function with no route: <function CreateVideoClipObject at 0x108594500>

2019-03-21 21:14:20,881 (7000054bb000) : INFO (__init__:378) - Server already running or port in use

2019-03-21 21:14:20,883 (700004cb5000) : DEBUG (runtime:88) - Sending packed state data (109 bytes)

2019-03-21 21:14:20,883 (700004cb5000) : DEBUG (runtime:924) - Response: [200] MediaContainer, 1801 bytes

2019-03-21 21:14:20,938 (7000050b8000) : INFO (__init__:324) - GET URL: http://192.168.25.126:80/download/The Orville.TiVo?Container=/NowPlaying&id=10673

2019-03-21 21:14:20,938 (7000050b8000) : DEBUG (__init__:332) - CMD: "/usr/bin/curl" "http://192.168.25.126:80/download/The Orville.TiVo?Container=/NowPlaying&id=10673" --digest -s -u tivo:0123456789 -c "/var/folders/9q/8cw7cjqd2bb8ypgpnd_5zxmw0000gn/T/cookies.txt"

2019-03-21 21:14:20,946 (7000050b8000) : DEBUG (__init__:337) - PIPED to: "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin" -jar "/Users/niten/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0123456789 -

2019-03-21 21:14:20,955 (7000050b8000) : INFO (__init__:354) - Unexpected error: [Errno 13] Permission denied

2019-03-21 21:14:20,956 (7000050b8000) : INFO (__init__:360) - Self-exit of tivodecode/curl

2019-03-21 21:14:20,956 (7000050b8000) : INFO (__init__:362) - tivodecode/curl terminated

It looks like the piped command line is missing "java" now? Can you point me to which folder I should check for permissions?

Thanks again for the help and the great work
Niten


----------



## ligand

ligand said:


> So "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" is the path to the actual executable. I changed the Java path configuration to be "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin" and now I get:
> 
> 019-03-21 21:14:20,880 (700004cb5000) : DEBUG (__init__:180) - Done starting a thread
> 
> 2019-03-21 21:14:20,880 (700004cb5000) : WARNING (runtime:1065) - Generating a callback path for a function with no route: <function CreateVideoClipObject at 0x108594500>
> 
> 2019-03-21 21:14:20,881 (7000054bb000) : INFO (__init__:378) - Server already running or port in use
> 
> 2019-03-21 21:14:20,883 (700004cb5000) : DEBUG (runtime:88) - Sending packed state data (109 bytes)
> 
> 2019-03-21 21:14:20,883 (700004cb5000) : DEBUG (runtime:924) - Response: [200] MediaContainer, 1801 bytes
> 
> 2019-03-21 21:14:20,938 (7000050b8000) : INFO (__init__:324) - GET URL: http://192.168.25.126:80/download/The Orville.TiVo?Container=/NowPlaying&id=10673
> 
> 2019-03-21 21:14:20,938 (7000050b8000) : DEBUG (__init__:332) - CMD: "/usr/bin/curl" "http://192.168.25.126:80/download/The Orville.TiVo?Container=/NowPlaying&id=10673" --digest -s -u tivo:0123456789 -c "/var/folders/9q/8cw7cjqd2bb8ypgpnd_5zxmw0000gn/T/cookies.txt"
> 
> 2019-03-21 21:14:20,946 (7000050b8000) : DEBUG (__init__:337) - PIPED to: "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin" -jar "/Users/niten/Library/Application Support/Plex Media Server/Plug-ins/TiVoToGo.bundle/Contents/Resources/TivoDecoder.jar" -m 0123456789 -
> 
> 2019-03-21 21:14:20,955 (7000050b8000) : INFO (__init__:354) - Unexpected error: [Errno 13] Permission denied
> 
> 2019-03-21 21:14:20,956 (7000050b8000) : INFO (__init__:360) - Self-exit of tivodecode/curl
> 
> 2019-03-21 21:14:20,956 (7000050b8000) : INFO (__init__:362) - tivodecode/curl terminated
> 
> It looks like the piped command line is missing "java" now? Can you point me to which folder I should check for permissions?
> 
> Thanks again for the help and the great work
> Niten


I just tried it with tivodecode instead and it works!!!  I'm going to leave it like this for a while and not bother with Tivolibre.

Niten


----------



## jonw747

ligand said:


> I just tried it with tivodecode instead and it works!!!  I'm going to leave it like this for a while and not bother with Tivolibre.
> 
> Niten


The new problem is probably because you're trying to execute a path, rather than running java. You're old setting was probably right, but there's something going wrong either with running java or the other programs referenced.

I can certainly understand the sentiment of giving up at the point it's doing something useful for you, though.


----------



## ligand

jonw747 said:


> The new problem is probably because you're trying to execute a path, rather than running java. You're old setting was probably right, but there's something going wrong either with running java or the other programs referenced.
> 
> I can certainly understand the sentiment of giving up at the point it's doing something useful for you, though.


You're right on the path change... but the weird part is if I copy and paste the 2 commands on the command line it works. Maybe its because of the version of python I'm using?


----------



## windracer

jonw747 said:


> Do you or windracer think it would be possible to workout the issues with recording under Windows and to implement the ability to resume a program from where it was watched last? With both of those, the plug in would be pretty awesome for remote viewing with Plex. I'm not asking if you'd fix the problems running under Windows, just wondering if you think the problems are fixable.


Sorry for the delayed response, I've been out of town (out in AZ for my annual spring training trip).

Since I'm just a tinkerer, and didn't write the original plug-in code, I'm not really the ideal person to implement big new features like that (assuming it's even possible to resume from the last watched point). I'm also not certain what the "ussyes with recording under Windows" you're referring to are. The big Window issue I have logged is the Mind RPC call (for file naming) and I spent a lot of (wasted) time on that trying to get it to work and really don't know why it doesn't.


----------



## windracer

jonw747 said:


> You may have configured the "Path to Java runtime" wrong. Admittedly the thread has been pretty confusing on the right setting, but you need to specify the path to the java executable, otherwise it's trying to pipe the stream in to a folder rather than an application.


Correct, it's the path to the java runtime _including _the 'java' (Linux/OSX) or 'java.exe' (Windows) part.



ligand said:


> Both TivoDecode and TivoLibre aren't working in my configuration. I've taking the commands and piped them together and it produced a lot of garbage on my screen. However when the commands run within the plugin I get a "broken pipe" error. I'm copying my the pertinent log entries below:





ligand said:


> You're right on the path change... but the weird part is if I copy and paste the 2 commands on the command line it works. Maybe its because of the version of python I'm using?


The broken pipe usually indicates that the "stream" of data from curl (through the pipe to tivolibre) has stopped for some reason. I can't test on OSX, but it's sufficiently Linux-like. It could be a permission thing like @jonw747 suggested: maybe you're running the Plex service as a different user with different permissions than when you're running the debug command-line? From the command-line, if you remove the '-' at the end (which is sending the decoded stream to standard output, so you see all that garbage scroll by) and replace it with '> /some/directory/filename.mp4' you should get a converted file (assuming the curl process finishes successfully). So sorry, more debugging required.


----------



## jonw747

windracer said:


> Sorry for the delayed response, I've been out of town (out in AZ for my annual spring training trip).
> 
> Since I'm just a tinkerer, and didn't write the original plug-in code, I'm not really the ideal person to implement big new features like that (assuming it's even possible to resume from the last watched point). I'm also not certain what the "ussyes with recording under Windows" you're referring to are. The big Window issue I have logged is the Mind RPC call (for file naming) and I spent a lot of (wasted) time on that trying to get it to work and really don't know why it doesn't.


I wasn't sure if my problems with downloading (under Win10) were strictly due to naming, or something else, but I'd download like 3 different (copyable) programs and Plex would maybe show and play back one of them. It might have made a difference whether I used .mp4 or .ts, but I just couldn't get it to work consistently with any of the various things I tried.

I also use kmmtg but this looks like it might had been a much better way to get a file from tivo over to a mobile device when the TiVo App just isn't in the mood ...


----------



## ligand

I just wanted to say that I love using the TivoToGo Plugin for Plex. I use it everyday to stream content during my commute because the TiVo app's native streaming function is atrocious. @windracer Thank you so much for getting this working.


----------



## windracer

I just stood on the shoulders of giants ... slapped some bandages on it and added some new stuff, but thanks!


----------



## kendq

I am a bit confused, Is there anyway someone could write a DETAILED installation route for windows users? I got as far as installing the plugin and it displays the Box Name with a '0'. I am getting lost on the installation of curl. Will this even work with the Win7 64bit and the Tivo bolt (I am using it for OTA) . Does the Plex have to have the Plex Pass activated? ever thought of a you tube video? would be a lot of Happier Tivo users I know Ive been considering giving up on it because I upgraded to the Bolt because it promissed out of home streaming, should have stuck with my series 2.

Thanks for giving me hope
kendq


----------



## windracer

kendq said:


> Is there anyway someone could write a DETAILED installation route for windows users?


I've done basic testing of the plugin on Windows but my primary platform is Linux. I'm heading out on vacation for two weeks but maybe when I get back if I have time I could put something together. There are other Windows users in this thread that might be able to assist, though.



kendq said:


> I got as far as installing the plugin and it displays the Box Name with a '0'.


If you don't have curl installed, the plugin can "see" your TiVo on the network, but can't retrieve the list of shows (that's why it shows 0).



kendq said:


> Will this even work with the Win7 64bit and the Tivo bolt (I am using it for OTA).


It should.



kendq said:


> Does the Plex have to have the Plex Pass activated?


No, I don't think so (although I am a Plex Pass subscriber).



kendq said:


> ever thought of a you tube video?


Not really. Again, if I have time when I get back from vacation _maybe _I can put something together, but doing a video would require more time than just writing up some instructions.


----------



## kendq

Windracer;
Thanks for the reply, You already helped quite a bit with those answers, looks like my main issue is to get curl installed,


----------



## kendq

I've gotten to where it plays on my phone (after 1 minute it shuts down due to not having Plex pass which I will get if i can get it working on other devices) But on my computer it has a playback error message. still working on it.

Thanks again


----------



## slowbiscuit

kendq said:


> I am a bit confused, Is there anyway someone could write a DETAILED installation route for windows users? I got as far as installing the plugin and it displays the Box Name with a '0'. I am getting lost on the installation of curl. Will this even work with the Win7 64bit and the Tivo bolt (I am using it for OTA).


Never worked for me on Win10 and Comcast since the plugin errored out with tivolibre, which is required for mpeg4 Tivo files. I posted some logs here and never found a good workaround. Others (I think) got it working.


----------



## reneg

I've got it working on my Win10 system. I have the pytivo\bin (desktop version of pytivo) in my path statement to pickup tivolibre.exe, and the kmttg\curl in the path to pickup curl.exe.

Here is the bottom half of my configuration screen for the directory settings of the ttg plugin:


----------



## bradleys

I used to use this plugin all the time before it stopped returning my TiVo's - I installed the new version and it returned the tivos once, but most of the time I still get nothing. 

I will pull the logs and see if I can figure out why I am not getting a result. 

It is time to rebuild my pc - so this might be the impetus to start over with a fresh system.


----------



## windracer

(back from vacation)

The plugin doesn't seem to work on the mobile app anymore (see issue #8) but I have seen it where it stops returning the list of TiVos in the browser as well. Usually restarting Plex fixes this.


----------



## ligand

Hi Everyone, has anyone noticed that the plugin no longer responds from the web app? I tried it this morning and it wouldn't launch even after restarting plex media server. The issue occurs from my desktop and mobile device...


----------



## reneg

I've noticed that too. I think it's part of the slow demise of Plex plugin support.


----------



## BrettStah




----------



## ligand

Downgrading to *1.15.6.1079 *restored my ability to use the plugin. Not sure if this is the case for everyone, but I had to use the local web client and not Plex to get the plugins feature to work again. Hope this helps.

I found older versions of plex at this site:
Plex Media Server 1.16.1.1291 Download for Windows / Old Versions / FileHorse.com


----------



## windracer

Known issue. Not sure how to fix it.


----------



## James-

I am running my Plex server on my synology NAS. Where does java have to be installed, on the server or client?


----------



## windracer

James- said:


> I am running my Plex server on my synology NAS. Where does java have to be installed, on the server or client?


On the server, so your NAS.


----------



## James-

I get "There was an unexpected error during playback. Please visit our forums if you continue to experience problems." What can I provide that might help troubleshoot this?


----------



## windracer

That sounds like an error from Plex, not the plug-in. But if you look in the plug-in log there might be something that would help. The log is in the Plex installation directory (for example, on my Linux box it's /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.plugins.tivotogo.log).


----------



## James-

windracer said:


> That sounds like an error from Plex, not the plug-in. But if you look in the plug-in log there might be something that would help. The log is in the Plex installation directory (for example, on my Linux box it's /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs/com.plexapp.plugins.tivotogo.log).


The only thing I saw was no streams followed later by port in use.


----------



## windracer

So you've configured the plug-ins settings? And when you select the plug-in, what happens? Can you see your TiVos and browse the recordings on them? I don't see a lot to go on here in that log.


----------



## James-

Yes, I can browse all my recordings, but when I try to play one I get the playback error.


----------



## windracer

I was able to replicate the error using a browser (documented the issue here). My logs looks the same as yours. On the TiVo itself the plug-in seems to work fine. The logs look the same _except_ the GET URL executes and passes the stream to the encoder (and playback starts).

To be honest, I don't really use the plug-in for streaming playback, mostly for browsing and downloading (and then I stream the downloads through the Plex app to my phone). With Plex continuing to de-support plug-ins and channels, this could be another sign of their back-end changes breaking things (the plug-in hasn't worked on mobile for a while, for example). So these things are not really within my ability to fix, sorry!


----------



## jesiegel

ok im a bit behind you all, i got this installed and i configured it on the server but cant seem to find any hook to look up my tivo files... am i doing something wrong?


----------



## jesiegel

OneLoveAmaru said:


> Discontinuation of Plugins, Watch Later, Recommended, and Cloud Sync


so im too late to the party? no way to access it any more?


----------



## windracer

It might still work. I haven't used it since I exited the TiVo ecosystem earlier this year. So you have the plug-in installed and it shows up in your Plex interface? What does your plug-in settings screen look like?


----------



## eherberg

That's the rub. You can certainly manually put stuff in the plug-in directory -- but accessing the plug-in settings screen is going to be tough without a plug-in section in the interface. A plugin author who has an interface now would need to use a 3rd-party interface like Kitana, for example.


----------



## windracer

I still have a Plug-Ins menu item on my Plex server under Settings. The TiVo plug-in should show up there if it's installed.


----------

