TiVo Community Forum banner
1 - 20 of 25 Posts

· Registered
Joined
·
7 Posts
Discussion Starter · #1 ·
Over thanksgiving break I decided to port pytivo (wmcbrine's version) completely to python3. In the process I also tried to clean up some of the code.

If you're interested, here it is:
itsayellow/pytivo

It is installable as a python package via pip or pipx, which makes installation a little nicer and a little more portable.

For some help text, execute:
pytivo --help

I may not be super available for supporting end users, but the code is pretty solid and I've been using it for some months now without problem.

The main difference from the original pytivo is probably where it searches for pyTivo.conf. Here are the new locations:
  • /etc/pyTivo.conf
  • In your home directory: .config/pytivo/pyTivo.conf
  • In the directory you started pytivo from: pyTivo.conf
  • You can also specify the full path to your desired pyTivo.conf using the -c option.
For developers, it may be of note that the entire code is also statically typed with python type hints and can be verified using mypy.

Since python 2 is EOL this year, hopefully this is also useful going forward for other developers.
 

· Registered
Joined
·
7 Posts
Discussion Starter · #4 ·
Am I missing something, where is the pyTivo.py file?
That's another change from the old pytivo I guess.

The best way of running this is to install this using pipx. Once you do that, you should have a command on your path called 'pytivo' executable from anywhere.

Installation example if you downloaded pytivo to directory <Some_Directory>/pytivo (replace <Some_Directory> with whatever directory is the parent of your pytivo directory.)
  1. python -m pip install --user pipx
  2. pipx install <Some_Directory>/pytivo
pipx will install pytivo (or pytivo.exe on Windows) in your home directory to: .local/bin/ . If this is in your PATH, then pytivo will be executable anywhere. You can also run it explicitly from that path.

The more technical answer is, there are a number of python packages that need to be installed to make this new pytivo work. The installation method above handles this automatically. If you know what you're doing and install all the python packages needed yourself, then to run pytivo you can also execute:
python src/pytivo/main.py​
 

· Registered
Joined
·
325 Posts
Thanks for the note, that's good to know! I looked, but I couldn't find any python3 pytivo ports on my own...might have saved me some work :D
It sounds like we focused on different things for our ports, and there are things you've done that I'd definitely want, but I don't have the bandwidth now to look at merging. I've never even heard of pipx.
You can find my port at mlippert/pytivo

[edit] for instance I added some config functionality to allow defining how you want shows and movie files named, and I added a .syncerr.yaml file to show where the errors occurred when doing ts downloads, based on @Dan203's changes to wmcbrine's base code.
 

· Registered
Joined
·
7 Posts
Discussion Starter · #10 ·
@mlippert , I also don't have a ton of bandwidth, but was happy to see another python3 port.

I will say I was pleasantly surprised how much benefit using type hints gave me. Not only did it make porting much faster in the end, but I believe I may have found some bugs that had been hiding in pytivo for a while. It certainly eased tracking down all the str/bytes bugs that popped up in the transition from python2 to python3.
 

· Registered
Joined
·
325 Posts
@itsayellow Adding type hints is something I definitely wanted to do, but I didn't know nearly enough when I started about how to format them and actually lint them, so I left that for later. I did restructure many parts of the code, and I've been using it ever since I did this. I run it on linux though, and I didn't go the extra step to make it easier for others to install that it sounds like you did.
I know it runs on linux (if you get the required pre-reqs installed, and that's not hard, I use a virtual env and the requirements.txt), and I think I got it running on Windows a long time ago. I have no idea how/if it runs on a Mac.

If I get some time in the future I'll check out your port and if that happens I'm sure I'll have questions so you may hear from me!
 

· Super Moderator
Joined
·
55,660 Posts
So is there any real advantage to using 3 vs 2? I'm not really a python developer. I faked my way through the additions I made to my fork by a lot of goggling and trial and error. Would there be any advantages to using 3 in my pyTivo Desktop app?
 

· Registered
Joined
·
7 Posts
Discussion Starter · #13 ·
So is there any real advantage to using 3 vs 2? I'm not really a python developer. I faked my way through the additions I made to my fork by a lot of goggling and trial and error. Would there be any advantages to using 3 in my pyTivo Desktop app?
Well, I think the main thing is that Python 2 will not be supported anymore (EOL). "...January 1, 2020, will be the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it."
Sunsetting Python 2

Going forward, there won't be many libraries that still support python 2.

Other than that, I find python 3 much more pleasant to program in, it has a lot of nice features and syntax than python 2. Python 2.7 was released in 2010, a lot of nice stuff has happened since then in Python 3.
 

· Registered
Joined
·
325 Posts
So is there any real advantage to using 3 vs 2? I'm not really a python developer. I faked my way through the additions I made to my fork by a lot of goggling and trial and error. Would there be any advantages to using 3 in my pyTivo Desktop app?
So basically what @itsayellow said.

If you really were going to continue supporting/developing your pytivo desktop, then yes you probably should use python 3 and I would suggest you at least look at my fork because I've got your changes through 1.6.7 incorporated. But the effort involved isn't small, and what you have is working just fine.
 

· Registered
Joined
·
703 Posts
Is @wmcbrine pyTivo still "generally considered the stable mainline development branch" as it states in the pyTivo Wiki? Is anyone considering to update this to a Python 3 mainline, or at least to document all these other forks in the Wiki so we might know that they exist and which one to choose? I'm wondering if the "New users are recommended to start here" section is still good advice to follow?

Current Releases - pyTivo - Wiki
 

· Well-Known Mumbler
Rooting for the antihero
Joined
·
11,766 Posts
pyTivo is very nearly dead. That particularly describes my involvement with it, but it's true in the general case as well. TE4 breaks the core of pyTivo, PC to TiVo transfers. The Edge, IIRC, breaks TiVo to PC. And it's probably the last TIVo DVR anyway. The pyTivo forum is broken since KRKeegan abandoned it, I dunno how to fix it, and I'm not particularly motivated to figure it out. And then there's "pyTivo Desktop"...

The one thing that I really do feel is unfinished, is 4K. Since re-subscribing to Fios, I finally have some real 4K recordings to work with, and I'd like to get that going for the PC to TiVo side, if I can. I'll look into the Python 3 ports at that time. And then... that's probably it.

I do still use it, now and then. I probably will for as long as my TiVos keep working. But that time no longer seems unlimited.
 

· Super Moderator
Joined
·
55,660 Posts
The one thing that I really do feel is unfinished, is 4K. Since re-subscribing to Fios, I finally have some real 4K recordings to work with, and I'd like to get that going for the PC to TiVo side, if I can. I'll look into the Python 3 ports at that time. And then... that's probably it.
Does 4K download?
 
1 - 20 of 25 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top