Installing PyTiVo on Mac for New User

Discussion in 'Developers Corner' started by Tagno, Aug 11, 2019.

  1. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    I have experience with Python, but hardly ever have had to use anything more complex than pip to install libraries on my Mac. I now have a TiVo Bolt OTA and am thinking about a few things I can probably do with PyTiVo (according to what I've heard).

    How difficult or tricky is installing and using PyTiVo on a Mac?

    (At this point I have a lot going on and not much time to deal with things, but I'd like to write a short program that will work like rsync for copying TiVo recordings to my own server, so I can stream them to other devices with Plex instead of buying a TiVo Mini VOX. I don't mind doing leg work on something like this, but I'm just trying to assess whether this is something I can do now or if I should just spend the money on a Mini VOX to use for the next 9-12 months, when I'll have time to dig in deeper.)

    --------
    Sorry - on first post I meant to include I tried installing PyTiVo with pip and got this:


    Downloading/unpacking pytivo
    Downloading pytivo-0.0.2.tar.gz
    Running setup.py (path:/private/tmp/pip_build_root/pytivo/setup.py) egg_info for package pytivo
    Traceback (most recent call last):
    File "<string>", line 17, in <module>
    File "/private/tmp/pip_build_root/pytivo/setup.py", line 5, in <module>
    with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

    File "<string>", line 17, in <module>

    File "/private/tmp/pip_build_root/pytivo/setup.py", line 5, in <module>

    with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:

    TypeError: 'encoding' is an invalid keyword argument for this function

    ----------------------------------------
    Cleaning up...
     
    Last edited: Aug 11, 2019
  2. Allanon

    Allanon Active Member

    798
    96
    Nov 2, 2005
    You might want to try pyTivo Desktop. It's pyTivo but with a desktop GUI for easier use.
     
    Mikeguy likes this.
  3. Mikeguy

    Mikeguy Well-Known Member

    22,166
    6,522
    Jul 28, 2005
    ^ This. With pyTivo Desktop, you're up and running in minutes.

    pyTivo Desktop discussion thread here: Easier to use pyTivo
     
  4. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    Thanks! I’ll try that.

    I know I can look some of this up, right now, as I think you saw, I just want a quick solution. Later I want to explore the library and write a few programs that use it. But for most of the next year, I just need a quick solution.
     
  5. Mikeguy

    Mikeguy Well-Known Member

    22,166
    6,522
    Jul 28, 2005
    pyTiVo Desktop--minutes, literally (and single digit minutes).
     
  6. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    The hardest part was copying my MAK - and that was a nightmare. I found a bug in the Epson Home Cinema 1450 Home Theater Projector. Somehow, when TiVo goes from standby to active, and the Epson projector is being turned on, if it's not done in the right sequence, the TiVo Bolt gets the wrong display info and tries to display things in the wrong resolution - AND it makes almost everything green!

    I'll have to report this. I sent back my first Bolt because of this, but now that I see it happening on my BD player, I know it's the TV, not TiVo. (Although I suspect it's TiVo that sets the wrong mode, though.)

    Once I got that figured out, it was no problem and it's copying over files now.

    When I get time, I'll have to read up on the API. I'll write something like rsync, so I can leave it running in the background and automatically sync recordings periodically throughout the day. That way the version on the HD is up to date with the TiVo.
     
  7. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    FYI you can get your MAK by logging in to your account on TiVo.com
     
  8. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    Am I right that installing PyTiVo Desktop also installs PyTiVo, so I don't have to worry about that? I can just read up on the API for it when I have time?

    I noticed when PyTiVo Desktop lists my recordings on my TiVo, the files have different icons by them - a blue circle, yellow circle, yellow with a exclamation point, and red. I've looked over the PiTiVo's info on GitHub, but I can't find anything that documents what these icons mean.
     
  9. Mikeguy

    Mikeguy Well-Known Member

    22,166
    6,522
    Jul 28, 2005
    Yep--a reason it's so nice. :) (And no reading-up is needed.)
    The TiVo "when this show may go away" indicators.
     
  10. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    It's 100% self contained.

    They're the same icons shown on the TiVo itself for the recordings. I mainly did it because I wanted to show an icon for Suggestions and it looked weird when the other recordings didn’t have an icon at all. So just to fill the space I put the same icons that TiVo uses in their UI.
     
  11. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    P.S. I am the developer of pyTivo Desktop. So if you have any trouble you can contact me directly and I can help you out.
     
  12. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    Thank you!

    So it's all in one package, and installing it did not automatically also install PyTiVo on my Mac?

    I just set my TiVo up on Saturday (or maybe Friday night) and haven't had time to actually sit down and enjoy it - so I had not seen the icons yet. But that also makes it puzzling why something might be marked as close to deletion when everything was recorded this weekend.

    It looks like pyTiVo Desktop is mainly for a simple way to copy files over to a hard drive. Is there a way to copy just the new files over? Or to "refresh" by deleting any recordings on the hard drive that have been deleted on TiVo and copy only new files/
     
  13. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    It does not install python. It uses a program called pyInstaller to package the PyTivo code and the python needed to run it into a single executable. When you run that executable it extracts everything to a temp directory so that it can run. When you exit the app it cleans up the temp directory so it can’t be used for anything else.

    No it doesn’t have any advanced functionality like that. Do those sorts of things on a TiVo requires an advanced API that is not exposed in PyTivo. If you want functionality like that you'll have to use kmttg.
     
  14. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    So if I want to use the pyTiVo library, then I have to install that separately?

    Okay. I'm a bit confused. I thought PyTiVo Desktop was basically a nice GUI to use for basic copying with the PyTiVo library, and that the library is still something I can install on its own.
     
  15. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    When the little tray app is running pyTivo is running. You can still access it via the UI just like the various pyTivo guides show. In fact all the Desktop app is is a fancy webpage using the pyTivo API, with some minor additions from me. So if you want to use the web UI, or even send http requests directly, you can.

    The purpose of pyTivo Desktop was to make pyTivo easier to install and use. The first iteration was just the installer and a few simple dialogs for changing the settings and setting up shares. The fancy Desktop UI came along when I wanted to learn Angular and needed something to apply it to.
     
  16. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    I'm thinking I must have misunderstood things. I thought pyTiVo would be a library with an API to access TiVo recording and transfer them. So basically it's a GUI app, but not as slick and easy to use as PyTiVo Desktop?

    So what should I download and install if I want a library that lets me:
    - Read what recordings are currently on my TiVo
    - Get metadata from those recordings, including full titles
    - Copy those recordings to my hard drive (and, if necessary, transcode them) in a form that works with Plex so I can stream them with Roku or other streaming boxes?
     
  17. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    There are APIs there if you really want to use them. They're not really documented though. They're based entirely on the TiVo HTPP API used for TiVo Desktop, which you might be able to find documentation for somewhere if you search.

    For the functionality you're requesting you should try kmttg. It uses a newer API called mind/RPC that has access to more features of the TiVo.
     
  18. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    Okay. Thanks. I wasn't clear if everything was using the TiVo API or if there were libraries written as wrappers around whatever TiVo had.

    Got it. (I was hoping for something in Python, not Java, but I can handle Java. Oh, well.)
     
  19. Dan203

    Dan203 Super Moderator Staff Member TCF Club

    46,922
    4,229
    Apr 17, 2000
    Nevada
    All of the extra API functionality I added to support the Desktop UI still uses the HTPP request format.

    If you're a software developer there is a guy who's reverse engineered the TiVo mind/RPC API in python, if that's better than java for you. However there is still a bit of a process getting it working as that API requires use of a certificate. The developer of kmttg has been hacking the certificate from the iOS app using a jail broken iPhone. But apparently it's getting harder and harder to do and it expires every couple years, so there could be a day when that just stops working.

    I tried contacting TiVo and asking for an official certificate, which they offered at one time via their developer program, but the person that set up the developer program no longer works there and no one else can figure out who, if anyone, is capable of creating these certificates. That's what put me off from adding it to pyTivo. I didn’t want to put work into an API that may stop working as soon as the certificate expired and it was no longer possible to hack it out of the app.
     
    Wil and ClearToLand like this.
  20. Tagno

    Tagno New Member

    24
    3
    Aug 5, 2019
    So kmttg can break at any time due to certificate issues. I did see one page, somewhere, on the TiVo website, where I could sign up as a developer, but I was hoping not to have to pay fees to access the API.

    From what you're saying, it sounds like you need a certificate to do that.

    It sounds like, basically, unless TiVo actually comes out with the apps they promised in January, accessing the recordings on the device is not easy. (And one of those apps was promised for the 2nd quarter and hasn't showed up and the other for the 3rd quarter.)

    On pyTiVo Desktop, since you're using HTTP, is that easy to use and is that the standard TiVo API? And are you accessing it without a certificate?
     

Share This Page