2/20/13

Continuing Adventures with iTiVo

Getting shows off Tivo and into the Apple environment has been an adventure. I first blogged about a method using an application called iTiVo. It was a basic straightforward method that was easy to use. Then iTiVo broke when I updated to OSX 10.8 Mountain Lion. 

Because I still wanted to watch my shows on my AppleTV, iPhones and iPad I wrote up a work around that actually works well. It had a few hicups but once you get things set up it you are back in business. Then iTiVo got fixed! Hallehluya!  I could use the original iTiVo method again. 

But now, as of 2/20/2013, iTiVo broke when Tivo updated their software. When you try to download a show you get an error that says "Couldn't Download 'show name'"



The good news is that once again the iTiVo community  has a work around that will fix it. 

The fix involves using the Terminal app and some editing of some resource files inside iTiVo. Don't worry, it's nothing too difficult. The first thing you will want to do is download the latest iTiVo application and make a copy. Always, ALWAYS work any edits to program resource files on a copy. That way if you mess up you don't have to re-download the application. Once you have downloaded and made a copy we can start the edits.

Open Terminal and type in this command: 

curl -c ~/Documents/cookies.txt -d "tivo:MAK" http://tivoip:80

(replace "MAK" with the Media Access Key and "tivoip" with the ip of your tivo). To find out the IP address of your Tivo you can look at my previous blog post which uses LanScan from the Apple App Store. Your command might look something like this:

curl -c ~/Documents/cookies.txt -d "tivo:9876543210" http://192.168.2.20:80

This command will output a file called "cookies.txt." that will be placed in your home directory in the Documents folder. Once you have run the command, you will need to edit the cookies.txt file. Of course, before you do that you will want to MAKE A COPY

Open your Documents folder in your home directory and find the cookies.txt file that you just created and duplicate it. Call it something like cookies_ORIG.txt. Now edit the file called cookies.txt using your favorit text editor (Text Wrangler, Text Edit or even VI) . It will look something like this.




The problem that iTiVo is having is caused by an expired cookie. The "1360972800" in the cookie.txt file is the number of seconds past the beginning of the world. And as every geek knows the beginning of the world started on January 1, 1970You will need to change that value to something much larger. I just changed the first 1 to a 2. Now save the file. 





Now that you have your updated cookie file set up you need to edit the iTiVo resource file to point to it.  Find the copy of iTiVo  you made and right-click, and click "Show Package Contents". 



Go to Contents folder and drill down to the Resources folder.  Find the file called "http-fetcher.pl" right-click it. Using the "Open With" command  open it in Text-Edit or other editor. Find the long line of code that has this in the middle of it:


...... -c /tmp/cookies.txt --retry 12....

You will need to update the cookies.txt location to show the new /Users/'home folder'/Documents/cookies.txt" location.  Make sure to update the line with your information by changing  'UserID' to your user account. Don't for get to change the flag from "-c" to "-b"


...... -b /Users/UserID/Documents/cookies.txt --retry 12....


Then re-open iTivo and it should start working again!

42 comments:

  1. Thank you, very nice writeup!

    However, when I substitute my Tivo’s MAK and IP address in the command:

    curl -c ~/Documents/cookies.txt -d "tivo:MAK" http://tivoip:80

    and run it in Terminal, it returns

    curl: no URL specified!
    curl: try 'curl --help' or 'curl --manual' for more information

    changing the command to the form:

    curl -c cookies.txt -d "tivo:MAK" http://tivoip:80

    results in ”cookies.txt" placed in my home directory.

    I duplicated it, then moved the ”cookies.txt" file to ~/Documents. Then I opened it in Text Edit, changed the appropriate value, and saved the change.

    I then edited "http-fetcher.pl" in iTiVo, launched iTiVo and all was well.

    Any idea what my syntax (or other) error might have been that resulted in the “curl: no URL specified!” result?

    Thanks again for posting this.

    ReplyDelete
  2. I made the changes t0 http-fetcher.pl but I can't save the changes. It says the volume is read only. What am I doing wrong?

    ReplyDelete
  3. Nicee

    Here are some things to check:

    Does your Mac Account have admin privileges?
    Did you make a copy of iTiVo and make sure you are working on the copy?
    Is that copy of iTiVo on your HD where you can edit it rather than on a disk image?

    Try dragging your copy of iTiVo to your desktop and editing it there. That location should be writable by you. Good Luck!

    Bruce

    ReplyDelete
  4. Bruce,

    Thanks for your help. iTivo is working again.

    ReplyDelete
  5. Great job!

    Bacon saved for a long trip tomorrow!

    ReplyDelete
  6. I have never done this sort of thing and with your excellent instructions I was able to muddle through and get the job done. Thank you, thank you, thank you!!

    ReplyDelete
  7. That is one of the best step by step how tos I've found on the net. Also found out that time started Jan 1st 1970 which will be a great help next time I want to impress my friends with my geekiness :) Write up was a great help. Many thanks!

    Andrew

    ReplyDelete
  8. Thank you! Works great!

    ReplyDelete
  9. Thanks for the instructions. One question, once it is working, should I rename the copy and delete the original? or is it ok to leave the original in my applications folder?

    ReplyDelete
  10. @Anonymous - By all means, if your edited copy of iTiVo is working the delete the original and save a little space. You can always redownload a new copy if you need it. The purpose of the copy is to insure you have an original around to use if you screw things up. Glad things worked for you.

    ReplyDelete
  11. Thank you, thank you, thank you.

    ReplyDelete
  12. any pointers on how to add in multiple IP addresses? I have 4 tivos that are all networked together and was able to make this work for the one but I am not a good enough coder to know if I need a (, ; : or something else).
    thank you for your help!

    ReplyDelete
  13. You're a saint. Thank you for this! I need a clip from TV to show in my class tomorrow and you really saved the day.

    ReplyDelete
  14. @CBrown - I'm not sure how to gracefully handle multiple IP addresses. The ugly brute force approach would be to make as many copies of iTiVo as you have Tivo DVRs. Then, for each copy, edit the cookies.txt file for each DVR and add a different IP for each TiVo. So your files would be, cookies1.txt, cookies2.txt, etc. Then, for each iTiVo app you would rename it to iTiVo1, iTiVo2, etc. and edit the http-fetcher.pl file pointing to the correct cookieX.txt file.

    I can't test it, but you could also try to combine all the output lines from your various cookies.txt files into one file. So your file might look like this;

    # Netscape HTTP Cookie File
    # http://curl.haxx.se/rfc/cookie_spec.html
    # This file was generated by libcurl! Edit at your own risk.

    192.168.2.20 FALSE / FALSE 2360972800 sid 4EFF1DAD39AA92B1
    192.168.2.21 FALSE / FALSE 2360972800 sid 4EFF1DAD39AA92B1

    with an added line for each TiVo. Then you only need one iTiVo app. I'm not sure if that would work but it's worth a try.

    Good Luck

    Bruce

    ReplyDelete
  15. Thank you very much Bruce! I will admit that's above my skill level & I was hoping there might be a simple answer of just adding a comma for multiple IP's. Until iTivo puts out an update to fix, I will just transfer my shows to my one TiVo that is setup and then pull them over to my Mac :)
    Thank you very much for your assistance and for helping me get my one Tivo setup! Very helpful blog!

    ReplyDelete
  16. Thank you so much - it works great now! I had to do a similar fix when I downloaded to my PC using the Tivo desktop software too.

    ReplyDelete
  17. I'm trying to get this to work for the first time on an older mac running 10.4.11. I thought I had it working with your fix and downloaded 2/3 of a half hour program when it started saying that it was waiting on the Tivo. Since then it will either give me the "couldn't download XXX" or it acts like it's downloading (it makes folders named after the programs) but does it within seconds and there are no files.

    ReplyDelete
  18. @ Anonymous

    If you still have issues I would start again. Download a new copy of iTiVo and re-edit the files. It really sounds like you didn't correctly edit the cookies.txt file and point your iTiVo edited file to your updated cookies.txt. Make sure to change the flag to "-b". Good luck!

    ReplyDelete
  19. EXACTLY what I was looking for...and explained better than on the iTivo support thread I found. Thanks!

    ReplyDelete
  20. Thank you! I appreciate all of the tips. It works great.

    ReplyDelete
  21. If you want to put the cookies.txt file in a folder other than what is specified above; Do not use the Finder to move the file. Use Terminal and the mv command otherwise iTivo will still not work.

    ReplyDelete
  22. This fix worked great for me for a month. Thank you! However, it suddenly stopped working.

    Anyone else with a similar problem? Any ideas?

    ReplyDelete
    Replies
    1. Neal

      My first thought would be to make sure that your cookies.txt file didn't get removed, moved or changed. If that's still working maybe your IP address of your TiVo changed? If all else fails maybe just deleting your old work and try it again. Re-download & re-edit your files to see if it works again.

      My best guess is that your IP changed so check that first. Then all you would need to do would be re-edit your cookies.txt file and input your corrected IP.

      Good Luck!

      Bruce

      Delete
    2. You are brilliant. My router assigned a new IP address to the TiVo. Oddly, iTiVo was still able to connect and show the listings on the unit, just not download.

      Sorry for the false alarm.

      Thanks so much.

      Delete
  23. Awesome...I was freaking out because I just bought a new Tivo and I couldn't download anything...problem solved in 10 minutes.

    ReplyDelete
  24. Thank You! Worked perfectly after I fixed my typing mistakes.

    ReplyDelete
  25. Been working hard at this all night - very good instructions thanks for that , but everytime i try and run the curl command, i get curl: (7) couldn't connect to host.

    My tivo box is ethernet into my super hub and im wireless into my hub ... ive checked IP and MAK . I can get in from my browser but not curl .
    Im logged in as admin too please help

    ReplyDelete
  26. Be very VERY careful about what you type. Any extra character, mistyped character or misplaced space is bad.

    Here is an easier workaround for this.

    1) Go to /Applications
    2) Find iTivo, right click and choose "Duplicate"
    3) Right click on the newly created iTivo Copy and choose "Show Package Contents"
    4) Navigate to Contents > Resources and find http-fetcher.pl
    5) Edit this in your favorite text editor
    On the line with:

    Code:
    $shellScript = "curl -q \'http://$tivoip\:80/download/$showNAME\.TiVo?Container=%2FNowPlaying&id=$showID\' -c /tmp/cookies.txt --retry 12 --retry-delay 10 --digest -u tivo:$MAK -o $target --stderr $TivoDir/iTiVoDL";
    Change to:

    Code:
    $shellScript = "curl --cookie sid=abc -q \'http://$tivoip\:80/download/$showNAME\.TiVo?Container=%2FNowPlaying&id=$showID\' -c /tmp/cookies.txt --retry 12 --retry-delay 10 --digest -u tivo:$MAK -o $target --stderr $TivoDir/iTiVoDL";

    Save and launch. That should fix the issue.

    Good luck!!

    ReplyDelete
  27. Works perfectly...thank you!

    ReplyDelete
  28. I echo the sentiments of all the previous comments, thank you so much for taking the time to write this up! My 5 hour flight tomorrow will be far less painful.

    One suggestion for improvement, please also highlight in red the change to -b from -c as the first time through I missed that completely.

    Regards, Ian

    ReplyDelete
  29. Bruce,

    Thank you for this -- it works great. The instructions were well written.

    Joel

    ReplyDelete
  30. Hi! When I use lanscan, it shows my ip address as 10.0.1.4. Any idea what i'm doing wrong?

    ReplyDelete
    Replies
    1. Leynet - You aren't doing anything wrong. Each person's home network is different and your IP address my indeed be 10.0.1.4. Just insert YOUR IP address in the example above.

      Delete
    2. I did curl -c ~/Documents/cookies.txt -d "tivo:MAK" http://tivoip:80 on terminal but couldn't find the cookies.txt on documents. Could it be in some other folder? Tried doing a search but it didn't show anything. Also should I uninstall itivo before starting terminal?

      Delete
    3. Leynet - It's always difficult to diagnose issues long distance. Try a couple of different things to make sure that you are doing things correctly.

      - Enter http://10.0.1.4:80 in a browser window (Safari). Does your tivo come up? log into your Tivo using the username of "tivo" and a password of your MAK address. Does that work?

      - Give curl another try. If that doesn't work. You can try the fix as outlined above:

      1) Go to /Applications
      2) Find iTivo, right click and choose "Duplicate"
      3) Right click on the newly created iTivo Copy and choose "Show Package Contents"
      4) Navigate to Contents > Resources and find http-fetcher.pl
      5) Edit this in your favorite text editor
      On the line with:

      Code:
      $shellScript = "curl -q \'http://$tivoip\:80/download/$showNAME\.TiVo?Container=%2FNowPlaying&id=$showID\' -c /tmp/cookies.txt --retry 12 --retry-delay 10 --digest -u tivo:$MAK -o $target --stderr $TivoDir/iTiVoDL";
      Change to:

      Code:
      $shellScript = "curl --cookie sid=abc -q \'http://$tivoip\:80/download/$showNAME\.TiVo?Container=%2FNowPlaying&id=$showID\' -c /tmp/cookies.txt --retry 12 --retry-delay 10 --digest -u tivo:$MAK -o $target --stderr $TivoDir/iTiVoDL";

      Save and launch. That should fix the issue.

      Good luck!!

      Delete
    4. Thought I got it to work but won't finish downloading. Thanks for your help anyway!

      Delete
  31. Hi Bruce,
    I may be the only one here that couldn't get this work-around to work-around. I followed your very clear instructions to the letter and double checked that everything was saved. I still got the dreaded "Couldn't Download ...". FYI, I'm using a MacBook Pro (mid-2009) OS 10.6.8, iTivo version 1.7.7b3, and the download format I selected is H.264 5Mbps. Any other help for this problem?
    Thanks,
    Jack P.

    ReplyDelete
  32. Have there been any updates on this. Im a fairly new user and I did the patch you listed here and still getting "Couldnt download bla..."

    ReplyDelete
  33. I'm a bit of a dullard so it took a few tries, but it worked. One bit of weirdness, that I don't think has anything to do with you - the last time I was able to use itivo, it would display "phantom programs" that I had watched and deleted a long time ago. Those "phantom programs" now still display, despite being off my Tivo for years. I can learn to live with it. Thanks.

    ReplyDelete