# Help with pyTivo and Windows 7



## darynsd (Apr 9, 2007)

I previously had pyTivo running on Windows XP but recently moved to a new computer with Windows 7, 64 bit. I'm having problems pushing files to my S3 TiVo. I can pull the files, but pushing gives an error of "list index out of range". I know from other posts that this often means there is a problem with my tivo_username and tivo_password settings but I'm certain these are correct. Still, it must be a problem communicating with mind.tivo.com as the debug log lists "Cookie cannot be authenticated; try login again". Turning off the Windows firewall has no effect so I'm guessing it's not an issue with ports.

I'm new to Windows 7 so I suspect it's something in the permissions that I've yet to understand. I appreciate any suggestions!


----------



## Rdian06 (Apr 12, 2008)

darynsd said:


> I previously had pyTivo running on Windows XP but recently moved to a new computer with Windows 7, 64 bit. I'm having problems pushing files to my S3 TiVo. I can pull the files, but pushing gives an error of "list index out of range". I know from other posts that this often means there is a problem with my tivo_username and tivo_password settings but I'm certain these are correct. Still, it must be a problem communicating with mind.tivo.com as the debug log lists "Cookie cannot be authenticated; try login again". Turning off the Windows firewall has no effect so I'm guessing it's not an issue with ports.
> 
> I'm new to Windows 7 so I suspect it's something in the permissions that I've yet to understand. I appreciate any suggestions!


Does your tivo_username contain a + sign in it? I know pyTivo couldn't handle that on older versions, but I think wmcbrine fixed it.

Are you certain you're running an updated version of pyTivo?

If you used the March 09 Windows installer, you should upgrade it to wmcbrine's lasted git version:

http://pytivo.sourceforge.net/forum/updated-windows-installer-2009-03-21-t512-30.html#7536


----------



## darynsd (Apr 9, 2007)

Nope, no "+" in the email address. I had followed your instructions about updating pyTivo. I used "wmcbrine-79ec1693bf877799655612b079f568bc5deafedd.zip". The files are dated 3/12/2010. The frustrating part is that it did work on my XP box -so I figure it must be something unique to Windows 7. Does the "badcookies" error give any hints to what I'm doing wrong?


----------



## Rdian06 (Apr 12, 2008)

darynsd said:


> Nope, no "+" in the email address. I had followed your instructions about updating pyTivo. I used "wmcbrine-79ec1693bf877799655612b079f568bc5deafedd.zip". The files are dated 3/12/2010. The frustrating part is that it did work on my XP box -so I figure it must be something unique to Windows 7. Does the "badcookies" error give any hints to what I'm doing wrong?


As you found through your searching, it's most likely a login failure to the mind server. That login must succeed for the push to be scheduled. The transfer mechanics aren't used at all until the push is scheduled so it's not a firewall issue.

Maybe try copying the conf file from your Windows XP machine over and then copying and pasting the tivo_username and tivo_password lines from the old one into your new conf. NOTE that the tivo_username and tivo_password must go in the Server section of the conf now and you should remove the Admin section from your new conf if it exists.

Also, when you upgraded, are you certain you overwrote the old files? The git zip has a "wmcbrine" folder inside it and some people accidentally place that folder inside the existing pyTivo folder instead of using the contents of the "wmcbrine" folder to overwrite the contents of the existing pyTivo folder.


----------



## dlfl (Jul 6, 2006)

With Win7, if you edit a file in the Program Files folder tree, depending on permissions, UAC setting and program you use to edit, you can *think* you're changing the file but Win7 actually creates a virtual copy of the file down in your Users folder tree and *that* file is what you're actually editing. It's "protecting" you from modifying something that would affect program operation!  You may have no clue this has happened other than bizarre lack of the response you expected from your edits.

I believe if you load the file into Notepad you see the "true copy", but there may be conditions on that too.


----------



## darynsd (Apr 9, 2007)

Yup, I tried copying the password and username lines from my XP conf file with no change and there's no "'wmcbrine" folder (I'd made that error before). Is there some way to verify the version? It has to be something with communicating the password and username to the mind server as I get the same error if I intentionally screw them up. Here's the error message (with my PW and username edited):

_2010-04-04 18:41:49,351 DEBUG pyTivo.mind: __login
{'cams_security_domain': 'tivocom', 'cams_login_config': 'http', 'cams_cb_password': 'mypassword', 'cams_original_url': '/mind/mind7?type=infoGet', 'cams_cb_username': 'myemail'}
2010-04-04 18:41:49,913 DEBUG pyTivo.mind: pcBodySearch
{}

<error>


Code:


badCookie

<debug>1</debug><text>Cookie cannot be authenticated; try login again</text></error>g
2010-04-04 18:41:50,444 DEBUG pyTivo.mind: pcBodyStore
{'replaceExisting': 'true', 'name': 'pyTivo'}

<error>


Code:


badCookie

<debug>1</debug><text>Cookie cannot be authenticated; try login again</text></error>g
2010-04-04 18:41:51,005 DEBUG pyTivo.mind: pcBodySearch
{}

<error>


Code:


badCookie

<debug>1</debug><text>Cookie cannot be authenticated; try login again</text></error>g
2010-04-04 18:41:51,005 INFO pyTivo: 127.0.0.1 [04/Apr/2010 18:41:51] "POST /TiVoConnect HTTP/1.1" 500 -
2010-04-04 18:41:51,005 ERROR pyTivo: Exception during request from ('127.0.0.1', 51975)_

Sorry, I don't know how to properly format that... Maybe there's something else in there that catches your eye. I'm not sure if it's even a problem with pyTivo or Windows.

Thanks for your help.


----------



## darynsd (Apr 9, 2007)

dlfl said:


> With Win7, if you edit a file in the Program Files folder tree, depending on permissions, UAC setting and program you use to edit, you can *think* you're changing the file but Win7 actually creates a virtual copy of the file down in your Users folder tree and *that* file is what you're actually editing. It's "protecting" you from modifying something that would affect program operation!  You may have no clue this has happened other than bizarre lack of the response you expected from your edits.
> 
> I believe if you load the file into Notepad you see the "true copy", but there may be conditions on that too.


dlfl- I'm not sure I understand (and that's probably the crux of my problem) but I have been using notepad to edit the conf file and the changes do appear to have an effect. For instance, when I intentionally mess up my password, it is accurately reflected in the error message. Can you shed any light on your settings (permissions, etc.) in Win7 that may be affecting pyTivo from logging into the mind server?


----------



## dlfl (Jul 6, 2006)

darynsd said:


> dlfl- I'm not sure I understand (and that's probably the crux of my problem) but I have been using notepad to edit the conf file and the changes do appear to have an effect. For instance, when I intentionally mess up my password, it is accurately reflected in the error message. Can you shed any light on your settings (permissions, etc.) in Win7 that may be affecting pyTivo from logging into the mind server?


Looks like my idea is probably not your problem but I'm curious: Is pyTivo installed in your Program Files folder tree? If I edit a file in the Program Files folder tree with notepad, Win7 will not let me save the changes to the original file name. Maybe it would if I ran Notepad with "Run as administrator" but that's not usually convenient to do. At least with this behavior I know what's going one. With another editor I use, it just quietly saves the modified copy as a virtual file in a completely different location and lets me think I've changed the original file.

Just a wild thought: Add mind.tivo.com to the trusted sites in your Internet settings security tab. However I have to add that I don't have to do this for pyTiVo to push videos on my Win7 pc.


----------



## Rdian06 (Apr 12, 2008)

darynsd said:


> dlfl- I'm not sure I understand (and that's probably the crux of my problem) but I have been using notepad to edit the conf file and the changes do appear to have an effect. For instance, when I intentionally mess up my password, it is accurately reflected in the error message. Can you shed any light on your settings (permissions, etc.) in Win7 that may be affecting pyTivo from logging into the mind server?


Is your Windows XP box still accessible? Have you tested pushing from it today?

You might try logging into tivo.com and changing the password to something very simple temporarily and test with that. And if that works change it back to the original password and retest.


----------



## darynsd (Apr 9, 2007)

dlfl said:


> Looks like my idea is probably not your problem but I'm curious: Is pyTivo installed in your Program Files folder tree? If I edit a file in the Program Files folder tree with notepad, Win7 will not let me save the changes to the original file name. Maybe it would if I ran Notepad with "Run as administrator" but that's not usually convenient to do. At least with this behavior I know what's going one. With another editor I use, it just quietly saves the modified copy as a virtual file in a completely different location and lets me think I've changed the original file.
> 
> Just a wild thought: Add mind.tivo.com to the trusted sites in your Internet settings security tab. However I have to add that I don't have to do this for pyTiVo to push videos on my Win7 pc.


I can edit the conf file with notepad and save to the original file name if I change the properties/security permissions for the file to "full control". I added mind.tivo.com as a trusted site with no effect.



Rdian06 said:


> Is your Windows XP box still accessible? Have you tested pushing from it today?
> 
> You might try logging into tivo.com and changing the password to something very simple temporarily and test with that. And if that works change it back to the original password and retest.


Sadly, the XP box is not currently functional, though I have its hard drive hooked to the Win7 box. Changing my password at tivo.com didn't help either. I'm thinking it's not an issue with the password itself, but passing it to the server. I can ping mind.tivo.com so it must be up, right?

Thank you both for your help.


----------



## Rdian06 (Apr 12, 2008)

darynsd said:


> Sadly, the XP box is not currently functional, though I have its hard drive hooked to the Win7 box. Changing my password at tivo.com didn't help either. I'm thinking it's not an issue with the password itself, but passing it to the server. I can ping mind.tivo.com so it must be up, right?


What IP address do you get when you run "nslookup mind.tivo.com." from a command prompt?


----------



## darynsd (Apr 9, 2007)

Rdian06 said:


> What IP address do you get when you run "nslookup mind.tivo.com." from a command prompt?


204.176.49.65

I reinstalled using the latest versions of pyTivo and Python and still get the same error. Does the HTTP/1.1 500 part of the error message imply an internal server error (on my machine)? Would it have anything to do with pyTivo or Python or just something in how my machine is set up?


----------



## Rdian06 (Apr 12, 2008)

darynsd said:


> 204.176.49.65
> 
> I reinstalled using the latest versions of pyTivo and Python and still get the same error. Does the HTTP/1.1 500 part of the error message imply an internal server error (on my machine)? Would it have anything to do with pyTivo or Python or just something in how my machine is set up?


If you try to visit the following URL from a web browser on the machine, do you get a Forbidden response:

https://mind.tivo.com:8181/


----------



## darynsd (Apr 9, 2007)

Rdian06 said:


> If you try to visit the following URL from a web browser on the machine, do you get a Forbidden response:
> 
> https://mind.tivo.com:8181/


Yes, 403 "You don't have permission to access / on this server." I assume you're onto something?


----------



## Rdian06 (Apr 12, 2008)

darynsd said:


> Yes, 403 "You don't have permission to access / on this server." I assume you're onto something?


Not really. That just proves communication with the mind server is working at a network level.

I'm at a loss to explain why it's not working. Can you PM me more of the log output?


----------



## darynsd (Apr 9, 2007)

PM sent -thanks!


----------



## darynsd (Apr 9, 2007)

*Unbelievable!* While looking through some of the logs to try and figure out what the problem might be, I noticed that the date on the entries was wrong. Somehow, my computer thought it was a day ahead. Once corrected, I was surprised to see that it now works! I'm guessing the date must be part of the information pyTivo sends to mind.tivo and that caused the problem.

In any case, I wanted to post this so others may learn from my seemingly simple error and to thank those that helped. I really appreciate it!


----------



## cheesesteak (Jul 24, 2003)

I have this same exact problem. Used to work on my old xp box. Bought new win 7 box over the weekend. Haven't been able to get push to work properly on the win 7 box. I get this message:



> list index out of range
> 
> Traceback (most recent call last):
> File "C:\Program Files\pyTivo\plugins\video\video.py", line 397, in Push
> ...


I've copied the c:\program files\pyTiVo directory from the xp box to the win 7 box. Still get problem.

What's weird is that the new xp box's clock was off by a day when I first turned it on. Now the date/time is correct. What log files should I be looking at or is there another solution?

What's also weird is that the "pyTivo-Start Service" and "pyTivo Stop Service" menu options don't work on the win 7 box. I get a "System error 5 has occurred. Access is denied error on both".


----------



## cheesesteak (Jul 24, 2003)

Ugh. I'm a dope. Somehow my win 7 box was set to Pacific time instead of Eastern time. I set it correctly and now have a push in progress. Thanks for this thread.


----------

