Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tivolibre logic doesn't work on Windows? #4

Closed
jradwan opened this issue Jun 3, 2018 · 3 comments
Closed

tivolibre logic doesn't work on Windows? #4

jradwan opened this issue Jun 3, 2018 · 3 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jradwan
Copy link
Owner

jradwan commented Jun 3, 2018

When trying to use the tivolibre functionality on Windows, the download (or stream) "completes" almost right away (without doing anything):

download:

2018-06-03 18:19:37,322 (2d6c) :  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.73:80/download/Colony.TiVo?Container=%2FNowPlaying&id=49643" --digest -s -u tivo:<MAK>5 -c "c:\users\username\appdata\local\temp/cookies.txt"
2018-06-03 18:19:37,334 (2d6c) :  DEBUG (logkit:13) - PIPED to: "C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe" -jar "C:\Users\username\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m <MAK> -o "C:\Users\Username\Videos\Colony - End of the Road.mpg" -
...
2018-06-03 18:19:44,487 (2d6c) :  INFO (logkit:16) - Download complete: C:\Users\Username\Videos\Colony - End of the Road.mpg

stream:

2018-06-03 18:21:58,213 (13a4) :  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.73:80/download/Colony.TiVo?Container=%2FNowPlaying&id=49643" --digest -s -u tivo:<MAK> -c "c:\users\username\appdata\local\temp/cookies.txt"
2018-06-03 18:21:58,221 (13a4) :  DEBUG (logkit:13) - PIPED to: "C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe" -jar "C:\Users\username\AppData\Local\Plex Media Server\Plug-ins\TiVoToGo.bundle\Contents\Resources\TivoDecoder.jar" -m <MAK> -
2018-06-03 18:21:58,233 (13a4) :  INFO (logkit:16) - Starting decoder
2018-06-03 18:21:58,710 (13a4) :  INFO (logkit:16) - Self-exit of tivodecode/curl
2018-06-03 18:21:58,710 (13a4) :  INFO (logkit:16) - tivodecode/curl terminated

All of the paths are correct, and if you copy/paste the "CMD" and "PIPED to" debug lines to a Windows command prompt they work just fine. So it seems to be something related to the paths (embedded spaces?) and how Python is handing them in the command-lines for Windows (this all works fine on Linux and obviously the existing tivodecode calls work fine ... so something related to the Java command-line?).

@jradwan jradwan added the bug Something isn't working label Jun 3, 2018
@jradwan jradwan self-assigned this Jun 3, 2018
@jradwan jradwan added the help wanted Extra attention is needed label Jun 3, 2018
@stephenwheet
Copy link

stephenwheet commented Jul 7, 2018

The problem with it not working on Windows is the spaces in the default path of Plex Media server. It's not parsing correctly. Just add shell=True to the tivodecode line of your code (I think 338 and 439) and let python do all the escape squences for you.. it works great.

tivodecode = Popen([java_path, "-jar", tvd, "-m", getMyMAK(), "-"],stdin=curlp.stdout, shell=True, stdout=PIPE)

@jradwan
Copy link
Owner Author

jradwan commented Jul 9, 2018

Thanks, I'll try this out!

@jradwan
Copy link
Owner Author

jradwan commented Jul 11, 2018

@stephenwheet thanks, that seems to work! Although 'shell=True' seems to break the command-line for Linux, so I had to put in an OS check and only add the 'shell=True' for win32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants