1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Installing pyTivo on the Mac for Beginners

Discussion in 'TiVo Home Media Features & TiVoToGo' started by bareyb, Feb 21, 2012.

  1. Feb 21, 2012 #1 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    PyTivo is a cool little program that allows you to Transfer media from your computer to your Tivo Box. You can watch all those adorable Home Movies and illegal UFC downloads in the comfort of your familiar Tivo GUI. Great right? :)

    If you would like to try pyTivo (and I definitely think you should), but are new to command-line Unix type stuff, then this is the thread for you. Hopefully this will save you some time and some therapy bills for our local Unix experts.

    Note: If you have been having trouble getting it to work, I suggest you simply do it EXACTLY the same way I do it in the guide here. Once you have an understanding of how it works it will be much easier to customize it to your personal taste. This guide assumes you have downloads downloaded to your "downloads" folder in your Dock and that you keep your Applications in the Applications folder. I'm using OSX version 10.6.8 (Snow Leopard) so your views may vary depending on what version you have.

    There are a couple of different versions of pyTivo available, including the forks by Iluvatar ,Lucasnz, and wmcbrine who are well known contributors on this site. You can read about the different versions at the pyTivo Wiki Page.

    When you are ready to start the Tutorial, proceed to Step One:
     
    Last edited: Jun 20, 2015
  2. Feb 21, 2012 #2 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Step One: Download the latest version of pyTivo

    1. For the purposes of this Tutorial, I used the most recent wmcbrine fork. Click here to go to the download Site: http://repo.or.cz/w/pyTivo/wmcbrine.git

    2. Once you are at the Website, you will see a list of recent versions. Go to the top line and click on the very end of the line where it says: tar, gz, zip. (I used zip). Your download will begin automatically and (once unzipped) will place a folder with the label "wmcbrine" in your downloads folder in your dock.

    3. Open your downloads folder in the finder (see pic) and move the "wmcbrine" folder to your DESKTOP.

    [​IMG]




    [​IMG]
     

    Attached Files:

    Last edited: Jun 20, 2015
  3. Feb 21, 2012 #3 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Step Two: Download the correct version of ffmpeg

    1.Be sure you are getting the latest ffmpeg build. We used the most recent version from Iluvatar's excellent "ffmpeg Builds for Mac OSX" thread. Click here to go to the download site: http://pytivo.sourceforge.net/forum/ffmpeg-builds-for-mac-os-x-t1803.html

    2. Once you are at the Website, scroll down the page until you see a list of recent versions. Go to the topmost attachment window, and click on the blue "Download" link as pictured below.

    3. The download will begin automatically and (once unzipped) you will end up with the little square thing pictured below in your downloads folder. That's ffmpeg. Put it on your desktop too. We will get to that later...

    [​IMG]

    [​IMG]
     

    Attached Files:

    Last edited: Jun 20, 2015
  4. Feb 21, 2012 #4 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Step Three: Place Everything in your Applications Folder

    1. First change the name of the folder you downloaded (should be on your desktop) from "wmcbrine" (or whatever else is on it) to "pyTivo" (without the quotes).

    2. Then open the newly named pyTivo folder and create a new folder in it named "bin".

    3. Place ffmpeg (the little gray thing you put on your desktop) into the bin folder you created within the pyTivo folder.

    4. Place the newly named pyTivo folder with the bin containing ffmpeg into your Applications Folder.

    [​IMG]
     

    Attached Files:

    Last edited: Jun 20, 2015
  5. Feb 21, 2012 #5 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Step Four: Create your pyTivo Configuration File (pyTivo.Conf)

    UPDATE: With the latest version of pyTivo, you no longer need to create a pyTivo Configuration file to launch the Web Interface! Be grateful, this eliminates a whole bunch of potential problems... Big THANKS to wmcbrine for the update! Proceed to the next step... :)
     
  6. Feb 21, 2012 #6 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Step Five: Use the "Terminal" App to launch pyTivo!

    Okay. It's time to start up pyTivo for the first time. Once we get that up and running the rest can be done through the Web Interface instead of through the Terminal. This is where it usually falls apart for people because they don't enter the command line correctly. I suggest you simply Copy and Paste the code from this thread directly into the Terminal Window.

    1. Open the"Terminal" App on your Mac. It should be in the Applications folder in the subfolder "Utilities".

    2. Once that is running and in your Dock you should copy and paste the following into the window:

    Code:
    cd /Applications/pyTivo 
    ./pyTivo.py 
    Note: Copy and paste the code exactly as it is into the window. If you insist on typing it in yourself be aware there is a space between "cd" and "/Applications" in the path. Easy to miss. Don't ask me how I know...There may be other text in the window already, but simply paste in at the end after the square cursor. (see pic below).

    3. If you entered the code correctly, you will see the Screen below showing the TiVo Boxes on your Network:

    [​IMG]
     

    Attached Files:

    Last edited: Jun 20, 2015
  7. Feb 21, 2012 #7 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Step Six: Setting up your Video Share

    This is where we show pyTivo where our Movies are so they can be downloaded to our TiVos! We are getting very close now....

    1.Launch the pyTivo configuration webpage here: http://localhost:9032/TiVoConnect?Command=Settings&Container=Settings

    2.That brings up the webpage that will help you complete the setup. Once the "Config" webpage is open you will need to click on the button that says: "Add Section". This will open the "Add Section" window.

    3. In the top field of the "Add Section" window that opens, enter whatever you would like the folder to be called on your Tivo. I chose to use "Movies" since that's the name of the folder I'm using. Hit "Save Changes" to save pyTivo. Once it relaunches you are ready for the next step.

    4. A new "Movies" section should appear in the left pane of the pyTivo web config tool. Click on that to select it (see pic). A new set of text entry boxes will then appear.

    5. Enter the TYPE of share you are creating In the first box down labeled "type" (see pic) you will enter the word "video" (no quotes of course and in lower case)

    6. In the next box down labeled "path" you will enter the path to the Movies folder on your Mac. In my case the path is: /Users/bareyb/Movies.

    [​IMG]

    Note: If you are unclear about what the path is you can click on the folder and the path will be shown at the bottom of the window on your Mac (see pic below). Don't use the part that says "Macintosh HD" and simply start with "/Users".


    7. Once you have entered the text into those three fields, hit the "SAVE CHANGES" button in the web config tool. When it comes back up, restart pyTivo to make sure all the changes took effect. It should look something like this"

    [​IMG]

    8. Next you should put some videos into the Movies folder on your Mac if you haven't already. Put something in there you know works...

    9. Lastly, check the bottom of your "Now Playing List" aka "Your Shows" on your Tivo boxes and see if there is a nifty little icon that looks like a Computer with the name "Movies" next to it.

    [​IMG]

    If so, SUCCESS! Right Arrow and the The Videos you placed in the Movies folder on your Mac should be visible. These are now available to TRANSFER to your Tivo Boxes. They transfer faster than real time, so you can watch them as they download! Once they complete the transfer to your Tivo, they will reside on your TiVo Hard Drive along with your other shows. Free to watch or delete at will. You can even use MRV to transfer them from one Tivo to another. How cool is that? If you would like to make your Music folder available to your Tivo too, stay tuned, it's a piece of cake, or should I say py? :p

    You will need to have your Computer and pyTivo up and running for all of this to work of course. If you log out or shut down, there will not be any videos available on your Tivo for Transfer until you relaunch pyTivo again.

    Congratulations! You have just installed a basic pyTivo video server on your Mac! There are a couple very easy methods for launching pyTivo automatically and/or running pyTivo in the background that I will get to later. For now if you quit Terminal, you will need to re-enter the code that launches pyTivo again.

    To restart pyTivo copy the "launch code" (below) and paste it into the Terminal window again:

    Code:
    cd /Applications/pyTivo 
    ./pyTivo.py
    
     

    Attached Files:

    Last edited: Jun 20, 2015
  8. Feb 21, 2012 #8 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Adding a Music Share to pyTivo:

    Adding your "Music" Folder to your Tivo is even easier than adding your "Movies" folder (hopefully) was.

    1. Make sure the pyTivo App is up and running. If you haven't set up pyTivo to run in the background, or downloaded the "pyTivo Launcher.app" yet, you will need to paste in the "launch code" as you did the last time you launched pyTivo.

    Copy and paste the code below as you did before and enter it into the Terminal Window.

    Code:
    cd /Applications/pyTivo 
    ./pyTivo.py
    2. Go to the Web Config page: http://localhost:9032/TiVoConnect?Command=Settings&Container=Settings

    3 Click the "Add Section" button as you did when you created your "Movies" share. This opens the "Add a section" box where you will type the word "Music" into the "Section Name" field. Click SAVE and wait for pyTivo to relaunch.

    4. You will now have a "Music" share listed on the left pane of pyTivo (see pic). Click on that and you will see some boxes appear to enter some text in.

    5. Under "Type" put "music" (lower case)

    6. Under "Path" type in the path to the STOCK Music Folder on your Mac which resides in the side bar under your "Movies" and "Pictures" folders

    In my case the path is: Users/bareyb/Music Your path will be the same with your own username in place of "bareyb".

    5. Click "Save Changes" Wait for pyTivo to restart and click the "restart pyTivo" button. Wait for pyTivo to relauch and you're done. It should look something like this:

    [​IMG]

    If all goes well, you should be able to go into your Tivo's "Music, Photos, & Showcases" section (under the "Tivo Central" main menu) and see a Folder there named "Music". Navigate to your iTunes' "Music" folder and all your iTunes songs will be in there ready to play. :)

    [​IMG]

    NOTE: If you are using a Series 4 TiVo with the new GUI the screens will look different but the Apps will be there.
     

    Attached Files:

    Last edited: Jun 20, 2015
  9. Feb 21, 2012 #9 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Setting Up "PUSH" and "PULL" in pyTivo

    This is REALLY cool... Besides being able to PUSH video TO your Tivo from your computer, you can now PULL Movies FROM your TiVo and save them to your Hard Drive. Nice! Let's do it...

    1. Open the Web Config Page and click on "Global Server Settings" in the left pane.

    2. Enter the username you use to log-in at Tivo.com (usually your email address) in the tivo_username box (ignore underscore in "tivo_username", that's just Unix-ese for "TiVo Username". It should look something like this: tutorial@example.com

    3. Enter the password you use at Tivo.com in the "tivo_password box. Something like this: passwordexample123

    4. Enter the 10 digit MAK address from the "Account & System Information" Menu under the heading "Media Access Key" on your Tivo. It's the same for all of your Tivos so you only need to get it once.

    5. Save your changes and restart pyTivo. When pyTivo comes back up you should see the screen below with all the info you entered from your TiVo Account, and the path to your Movies Folder.

    [​IMG]

    Go back out to the pyTivo Homepage (http://localhost:9032/) and you should see the screen below:

    [​IMG]

    Click the link to any of your TiVos, and you can PULL shows off any of them and save them to your Hard Drive where you can store them or convert them for other devices. It's always nice to have a few shows on your laptop for power outages. ;)

    Click the "Movies" link under the "Push" menu and it brings up a list of shows in your Movie Folder, ready to push to any Tivo box on your Network. Who knew all this cool stuff was under the Hood!


    [​IMG]
     

    Attached Files:

    Last edited: Jun 20, 2015
  10. Feb 21, 2012 #10 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Bonus Step: Setting up pyTivo to Run in the Background Automatically

    Iluvatar came up with a nifty little script that will allow pyTivo to start up automatically and run in the background when you log in. Pretty cool eh? To make the magic happen all you have to do is:

    1. Open the Application "TextEdit" from the Applications folder on your Mac

    2. Make sure that you save your new pyTivo.conf file in "Plain Text format". Open TextEdit's Preferences and set the new Document checkbox to "Plain Text" format.

    3. In a new blank document paste in the following:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Label</key>
    	<string>pyTivo</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>python</string>
    		<string>/Applications/pyTivo/pyTivo.py</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    </dict>
    </plist>
    4. Save the document with the title "pyTivo.plist" to your DESKTOP, making sure to UNCHECK the "Add .txt" checkbox in the "Save" window (see pic).

    [​IMG]

    5. IMPORTANT: Make sure that the file does not end in .txt or .rtf (or really anything other than .plist).

    To make sure please select/highlight the pyTivo.plist you created and use the "Get Info" command from the menus or simply type in: "Command-I". This will bring up the "Get Info" screen where you can see what the file name really is. Sometimes Macs will have extensions turned OFF by default. If so, there may be an extension appended to the file and you won't see it in the finder. You MUST uncheck the "Hide Extensions" checkbox to see any extensions so you can remove them.

    Note: If you need to open your "pyTivo.plist" document with TextEdit again, you will not be able to double click the file since we removed the extension, but you can still open it from within TextEdit using the Menu<Open command if you need to get back in there for any reason.

    Example of completed pyTivo.plist file:

    [​IMG]


    2. Navigate to the Launch Agents Folder, in my case it would be: (/Users/bareyb/Library/LaunchAgents) and place the pyTivo.plist file from your desktop into the Launch Agents folder. After that, pyTivo should launch in the background and leave the Terminal free. If you want to turn it off just remove the file from the Launch Agents folder. If you'd like to further hone your command-line skilz check out the quote below. Iluvatar put some scripts in there that will have Terminal place the files for you... Big thanks to Iluvatar for putting it all together.

    Note: If you would prefer not to have pyTivo running full time in the background, there is a cool little "Launcher" App described in the next section that will Launch pyTivo with a couple of clicks.


     

    Attached Files:

    Last edited: Jun 20, 2015
  11. Feb 21, 2012 #11 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Bonus Step #2: Fofer's pyTivo Launcher.app.

    If you would prefer not to have pyTivo running full time in the background and would rather use it "on demand". Well. Ahem... There's an App for that. ;)

    Fofer over at TCF created a handy little Applescript App that will automatically launch pyTivo when you double click it. To shut pyTivo back down, you simply go into the pyTivo Web Configuration Page (which opens automatically when you launch the App) and click the "Shut Down pyTivo" Button.

    1. To Download the pyTivo Launcher App click on the large TivoMan Icon below or use the "pyTivo Launcher.app.zip file link in the attachment window.

    2. Get it out of your downloads folder (it probably just bounced) and put it in the pyTivo Folder you put in your Applications folder earlier. It should look like the pic below... If it doesn't and looks like a fifty gallon drum with a trim waist, then you probably need to unzip it. Normally they unzip automatically...

    Click on TiVoMan to Download the Launcher:
    [​IMG]

    3. Double-Click the pyTivoLauncher.App whenever you want to launch pyTivo. That's it! No command line to remember or paste in. It does it all for you. When you're done use pyTivo's built-in Web Interface to shut it down. :)

    pyTivo Web Interface: http://localhost:9032/TiVoConnect?Command=Settings&Container=Settings
     

    Attached Files:

    Last edited: Jun 20, 2015
  12. Feb 21, 2012 #12 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Congratulations! You have completed the pyTivo Tutorial! I hope this guide made it a little easier. If you have any questions or run into any roadblocks feel free to post. Enjoy!

    [​IMG]

    Updated info and Side Notes:

    1. If you decide to update your version of pyTiVo to a newer version, you can use the same .conf file that you created previously so you won't have to copy all your information all over again. Just be sure you download the latest version of ffmeg too so you will get the latest features. ;)

    2. If you have a Series 4 TiVo, you can add a setting to the Global Server Settings that will allow you to download H.264 Movies natively without pyTiVo having to convert it. It's extremely FAST for downloads. Took me about 20 seconds to download an hour and half movie. :)

    All you have to do is paste in the command: "ts = on" under the server settings on your .conf file. Or conversely you can do it in the Web Gui by "Add Section" name it "ts" and set it to "on". It will look like the pic below when you're done.

    [​IMG]
     

    Attached Files:

  13. Feb 21, 2012 #13 of 176
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Why? That's a rather poor idea - certainly not a best practice. PyTivo is a server, and properly servers should run 24/7.
     
  14. Feb 21, 2012 #14 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    Some people will probably only use it on rare occasion though, and I can see the logic of wanting to start it up only when necessary /shrug. Different strokes... :)
     
  15. Feb 21, 2012 #15 of 176
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    This is also not the best idea. PyTivo (and other servers) shoud never require a login. I am not intimately familiar with OS X, and I know it does not employ a System V init, but it does employ a similar init function, and it is from there pyTivo (and other such servers) should run. Hamstringing a server like pyTivo by requiring a user login on the server side is a really bad idea.
     
  16. Feb 21, 2012 #16 of 176
    Fofer

    Fofer XenForo Rocks! TCF Club

    82,143
    306
    Oct 29, 2000
    Huh? I'd disagree. My primary computer is a MacBook Pro, that I carry with me everywhere. I have all my media on it, and I travel frequently. And I use AppleTV quite a bit more than my TiVo these days.

    Once in a blue moon, when I am at home, in front of my bigscreen TV, I'll want to use PyTiVo to transfer a video over to my TiVo. And so I'll launch PyTiVo (or PyTiVoX) to get the job done.

    Surely you're not suggesting I need to "properly" leave the PyTiVo "server" running 24/7 on my laptop?
     
  17. Feb 21, 2012 #17 of 176
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    How frequently it is deployed is really not the issue. How randomly is perhaps more salient, but even that is really not the point. PyTivo is not a user application. Its functionality in no way depends upon or should require a console, and it should be available transparently whenever any user has need of it. Now of course one can implement things any way they like, but implementing pyTiVo, vidmgr, etc. as console applications is just not really a good idea. At best it is clumsy, error-prone, and almost surely inconvenient.
     
  18. Feb 21, 2012 #18 of 176
    Fofer

    Fofer XenForo Rocks! TCF Club

    82,143
    306
    Oct 29, 2000
    Why in the world should I saddle my laptop with the task of running the PyTiVo server 24/7 when at most I use it for manually transferring a couple of shows every few months?
     
  19. Feb 21, 2012 #19 of 176
    bareyb

    bareyb Under Maintenance TCF Club

    25,944
    8
    Dec 1, 2000
    Silicon Valley
    You do realize we don't have dedicated servers for this right? How would you keep it up all the time without that? Either way, if you have a better way. I'm sure people would love to hear it. :)
     
  20. Feb 21, 2012 #20 of 176
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    So don't use your McaBook pro for a server. Using any workstation - certainly a laptop - as a server platform is anohter rather poor idea. Best practice is to deploy a headless system, and the most economical is an old P4 or some such. 'No need to have more than $150 tied up in the server, excluding possibly a RAID array.

    Which is not relevant.

    The more "blue moonish" the use, the more useful a headless server. It sits waiting for whomever, wherever to make a request.

    No, I'm saying a laptop is a poor choice of platform on which to run any server. Workstations in general are a poor choice for server platforms, but laptops are particulalry so. My home servers are offline at most once or twice a year, usually due to extended power outages. The entire rest of the time, they provide DHCP, DNS, IMAP & SMTP, DDNS, NTP, VPN, rsync, HVAC, SMB, NFS, web, pyTivo, Galleon, and vidmgr services to every workstation and TiVo on the network, with no logins on the server side, no keyboards, no mice, and no monitor. As long as the server stations have power, those sevices are available. Of course, they also all log any important activity or errors to log files, in case there is a problem.
     

Share This Page