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

New program for 1 step TTG downloads, decryption, encoding - kmttg

Discussion in 'TiVo Home Media Features & TiVoToGo' started by moyekj, Mar 15, 2008.

  1. Feb 16, 2013 #4741 of 10411
    morac

    morac Cat God

    8,934
    19
    Mar 14, 2003
    NJ
    Found another work around for people using Firefox. Install the Cookie Manager+ add-on and edit the "sid" cookie to expire at a later date. In Firefox this appears to "stick" so going back to the TiVo web page doesn't cause the cookie to expire again. I don't use Chrome, but it looks like this add-on does the same thing.

    Note curl has an option to read cookies from a file (--cookie). TiVo Desktop actually does that when it tries to download a program. It looks for a .cookie file in save to folder on the PC. The name of the file is the same name as the .TiVo file with a .cookie appended to it. So for example, if the TiVo file is "Curiosity - ''Did God Create the Universe'' (Recorded Aug 7, 2011, DSCHD).TiVo" the the cookie file would be "Curiosity - ''Did God Create the Universe'' (Recorded Aug 7, 2011, DSCHD).TiVo.cookie". Theoretically if you create a cookie file for curl to read and put an unexpired sid cookie in there, it should work. See this page.

    I'm not sure how TiVo's going to go about fixing this for old boxes as I've fairly certain the cookie is coded into the box's software. When I looked at my browser cookies I found that all TiVo box cookies expired Feb 15, 2013. It was probably hard coded into the code to do that. Premieres can be updated, but with S2 and S3 not getting updates, I don't see how they can be fixed.
     
  2. Feb 16, 2013 #4742 of 10411
    morac

    morac Cat God

    8,934
    19
    Mar 14, 2003
    NJ
    Just to expand on what I wrote above. Type the following curl command to download the box's cookies:

    The current expiration date listed is the number "1360972800", which is the number of seconds since midnight of January 1, 1970. So simply change that number to when you want the cookie to expire. For example if you want it to expire next year, change it to 1392508800.

    You can then use "curl -b cookies.txt" to read in the cookie file. As I mentioned above TiVo Desktop tries to read in a .cookie file with the same name as the .TiVo file it is downloading. It seems like it would be possible to trick it into using the cookie file.

    Unfortunately I've found that the TiVo returns a different SID value each time curl makes a request, but apparently the TiVo doesn't care what SID is sent as long as it's valid. I "created" a new cookie for my S3 and gave it the same SID cookie value that my Premiere gave me and could download from my S3 using Firefox.
     
  3. Feb 16, 2013 #4743 of 10411
    Fofer

    Fofer XenForo Rocks! TCF Club

    82,090
    286
    Oct 29, 2000
    So we change the date back on our computer to fix this? Can we then change it back? What a mess.
     
  4. Feb 16, 2013 #4744 of 10411
    morac

    morac Cat God

    8,934
    19
    Mar 14, 2003
    NJ
    That or build your own cookie as I described above. I've found that the TiVo box (at least the S3 OLED) doesn't care what the value of the SID is, as long as it is in a valid format and is sent.
     
  5. Feb 16, 2013 #4745 of 10411
    BigJon

    BigJon New Member

    21
    0
    Mar 9, 2012
    Many thanks to notting, morac, unitron and the others who figured this out....and have pointed to this thread from the at least one other that is out there ranting on this subject. Just to be clear, is there an assumption here in the community that this is a planned obsolescence strategy on the part of TiVo to force folks out of perfectly good TiVo S2's and S3's? (I don't normally buy into conspiracy theories, but....). They just had a promotion to pay 99 bucks for a lifetime service plan on your S3/HD if you bought a Premier 4 through them. So, once again, are we not likely to see a software revision to the S3/HD's (or the S2's for that matter) that will fix this?

    And for those of us who are not yet Jedi Masters with pytivo, and some of the other tricks out there, what is the easiest most foolproof way to update the cookie file on a TiVo HD TCD652160 upgraded to a 2tb drive, using TiVo Desktop as the PC/transfer interface (I can't just roll back my clock and leave it there for other reasons as the PC does other stuff beyond TiVo server duty). I am not entirely clear on what medium to use to type the command lines to set the next cookie expiration date out 25 years if that's what I want to do (and, if I want a 25 year expiration, why not?).

    Thanks again for the help some of the members have put into this.

    BJ
     
  6. Feb 16, 2013 #4746 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    BigJon, if you use kmttg for downloads an easy workaround was already discovered and posted in this thread.
    File-Configure-Program Options-Use java for downloads instead of curl

    Can't help you with TiVo Desktop as I don't like to use it and don't have a full installation of it. I doubt TiVo will let this problem sit for too long without offering a workaround of their own.
     
  7. Feb 16, 2013 #4747 of 10411
    jbrown13

    jbrown13 New Member

    34
    0
    Jun 29, 2006
    Perry, GA
    Set my clock back to 2/13/2013 and Desktop started transferring again. Another bug from the TiVo software group that can't seem to release new versions without creating issues.:mad:
     
  8. Feb 16, 2013 #4748 of 10411
    opieant

    opieant New Member

    16
    0
    Dec 6, 2006
    moyekj: For what it's worth, I modified kmttg to do the following as a workaround since my use of kmttg requires curl support:

    - Add "--head" to the usual curl command line, and run curl so it only caches the cookie without trying to download
    - Parse the value for the "sid" cookie from the cookie file
    - Add the "sid" cookie to the usual curl command line with --cookie (or -b, if you prefer), and run curl to download the file

    My implementation of this makes use of some of my previous modifications to kmttg, so unfortunately my code can't just be added directly into the current source. I just wanted to suggest this approach since it works nicely, but you may have a better idea. :)
     
  9. Feb 16, 2013 #4749 of 10411
    pL86

    pL86 New Member

    96
    0
    Oct 11, 2009
    New York City
    Thanks to everyone who figured this out - too bad I didn't find this answer before I reinstalled Windows. What a hassle...

    One question - does the date need to be set before February 13 every time before transferring a recording to the PC? Or is once enough and going forward, this step doesn't need to be done?
     
  10. Feb 16, 2013 #4750 of 10411
    Fofer

    Fofer XenForo Rocks! TCF Club

    82,090
    286
    Oct 29, 2000
    To be fair, this bug was probably there since the first version, it's just that the date of Feb. 16th 2013 triggered it.
     
  11. Feb 16, 2013 #4751 of 10411
    Fofer

    Fofer XenForo Rocks! TCF Club

    82,090
    286
    Oct 29, 2000
    Now I am curious, how does building a browser cookie on my computer take care of this? Do iTiVo and kmttg use and share these same cookies?
     
  12. Feb 16, 2013 #4752 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    OK thanks. I tried this out and got it to work. Run 1st with --head and without an output file, parse stdout to grab the sid and then run a 2nd time normal way with --cookie sid=xxxx. This also means the cookie file (--cookie-jar) is no longer needed when doing it that way. I'll keep the code on hand in case it becomes necessary for next release.
     
  13. Feb 16, 2013 #4753 of 10411
    morac

    morac Cat God

    8,934
    19
    Mar 14, 2003
    NJ
    The TiVo http server is simply looking for a SID cookie, it doesn't seem to care if it gets one that doesn't match the one it set. The reason it's currently failing is because no cookie is sent since it expired. Building your own violates RFC standards, but it works so who cares. :)
     
  14. Feb 16, 2013 #4754 of 10411
    opieant

    opieant New Member

    16
    0
    Dec 6, 2006
    I just checked this out since I had to see it to believe it. Sure enough, it works, and formatting doesn't seem to matter either. The TiVo seems to accept any string of at least one character as a valid session ID. Considering that, it's amazing they bothered to write the code to check if the "sid" cookie is sent at all. The programmers just needed to slack off a tiny bit more and this transfer problem never would have cropped up. ;)
     
  15. Feb 16, 2013 #4755 of 10411
    tluxon

    tluxon Member

    250
    0
    Feb 28, 2002
    Kirkland, WA
    I was able to see that the cookies.txt files created from each of my TiVoHDs contained the "1360972800" value, but I'm not clear on whether you were describing making it a global (all the cookies in the TiVo box) change or if it needs to be sent as an argument for each download request. When I commanded
    Code:
    curl [B]-b[/B] cookies.txt -d "tivo:MAK" http://tivoip:80
    to upload the edited cookies.txt file to the TiVo, it doesn't seem to have done anything because a subsequent
    Code:
    curl -c cookies.txt -d "tivo:MAK" http://tivoip:80
    still created a cookies.txt file containing the "1360972800" value.

    I guess I'm not quite understanding this...
     
  16. Feb 16, 2013 #4756 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    All you need to do for curl to work is use:
    --cookie sid=abc

    As discussed above the TiVo http server doesn't seem to care what the actual sid value is as long as there is one.
     
  17. Feb 16, 2013 #4757 of 10411
    tluxon

    tluxon Member

    250
    0
    Feb 28, 2002
    Kirkland, WA
    So the idea isn't to change the expiry time value of the cookie residing on the TiVo - but to just tweak the download request by substituting a dummy "cookie" string for the standard cookie string? Does that require downloads to be done on a manual basis or can this tweak be done on a more global basis?
     
  18. Feb 16, 2013 #4758 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    v0p9l version released with above discussed fix/workaround for curl downloads. Also contains new Season Passes Export button to export to csv file among some other things. See release_notes for all the details.
     
  19. Feb 16, 2013 #4759 of 10411
    morac

    morac Cat God

    8,934
    19
    Mar 14, 2003
    NJ
    It depends on what program you are using to do the download. You can add a cookie that doesn't expire to most web browsers. TiVo Desktop uses curl, but it specifies it's own parameters so it's not really something you can automate. Third party programs that use curl can be changed as needed. So except for TiVo Desktop it can be done "globally".

    I'm wondering if it would be possibly to replace the curl.exe in the TiVo Desktop folder with a batch file that simple calls curl.exe with the required "--cookie" argument. That would work depending on whether or not TiVo Desktop tried to run "curl" or "curl.exe". If TiVo Desktop calls curl.exe specifically there are still ways of doing this, but it becomes more difficult. At that point it would be easier to modify the source code of curl to hard code the cookie so a command line argument isn't needed.
     
  20. Feb 16, 2013 #4760 of 10411
    tluxon

    tluxon Member

    250
    0
    Feb 28, 2002
    Kirkland, WA
    That was quick. Thanks!
     

Share This Page