On the MLB support forum is this from a mlb rep:
Quote:
Quote:
Quote:
|
I think the issue is that I need to look a bit more closely at the various communication steps in the script to make sure that it "signs out" when it disconnects, to release the session. Apologies to anyone if they get this error as a result of the script -- it does go away, but it's annoying.
EDIT: Yeah, I think the problem is that the user never officially logs out. I've written a new method that logs out after the video is done playing. I have to wait until tomorrow when my current ban is lifted to try it out on live games. If it fixes the problem, it will go into that 0.1beta version with all the other new stuff. Wolfvorkian -- daftcat had a similar issue a couple of pages back. He had a solution... |
Quote:
For a quick fix, edit that file: /usr/lib/python2.5/site-packages/ClientForm.py Comment out line 698 and change it to return instead of raising an error: Seek this line 698: Code:
raise ParseError("start of INPUT before start of FORM") Code:
#raise ParseError("start of INPUT before start of FORM") |
I can't get the Dodgers / Diamondbacks game tonight. It says:
[mlbviewer couldn't read this...] That's the April 8 game if you want to debug it. |
Quote:
|
I wanted to release this newer version to help deal with the multiple login problem. It's not ideal -- it logs in and out for each game, instead of keeping one session the whole time (would make things a bit snappier). The problem there is that I don't know how to ensure that there's a final log-out if the script exits ungracefully. This way, at least, you'll log out of your session when you stop watching video.
Note: this version has new configuration. First, video and speed have been moved to .mlbtv (though if you don't enter them, it has default values). Also, mlbtv, now uses EQUAL signs, not colons. Code:
user = email - Generate the game names from given team codes, instead of trying to parse the text string. Should cut down on errors. (This also means that in the future, it will be easy for the user to configure the presentation.) - No more requirement for ClientCookie. ClientForm still required. - ClientFrom automatically turns off backwards compatibility which removes the annoying warning. NOTE: This isn't beta yet. I just wanted to share it early, in the hopes that it will solve the login issue. Testing is, of course, appreciated. Script can be found here: http://www.columbia.edu/~jr2075/mlbviewer.py Older version, in case something got screwed up, can be found at: http://www.columbia.edu/~jr2075/mlbviewer_old.py |
Quote:
mlbrecord kc to record the kc game today mlbrecord kc 04062008 to record the game from the 4/6 mlbrecord to print out today's schedule This way I don't have to draw a curses (please wait blah blah seconds for your game to begin recording) when the game appears in 'W' but is not yet 'I' (or 'F') If you have audio support, I'll use that too as an option. By the way, I was able to watch the Dodgers game this morning even though the text wasn't printable. I'm also going to get mlbviewer working under cygwin and I'll post that on the howto. Speaking of the howto, let me know when you want mlbviewer posted on the howto. Right now I still only describe the firebug hack. http://www.eds.org/~straycat/mlblinux.php |
quick python question
If I open a file in mainloop, will its file descriptor be available to other classes? Would I have to pass that file descriptor as an argument? How would I do that? Does python support pointers or can I pass by name directly? I hacked up the original mlbviewer to add in some basic logging support so I could see what mlbviewer knows and when it knows it, but I wouldn't mind providing a patch to mlbviewer (separate from my mlbrecord project) to include a debug log feature. Thanks! |
Well python mixes oop and procedural. mainloop isn't in a class, but it introduces instances of the other two classes. That wasn't very clear... With what I think you want to do, though, you would have to return the file descriptor. However, that's not really what mainloop is for -- it's mainly made the way it is in order to do the necessary redraws for curses.
What I would actually suggest doing is creating a new file, mlbrecord.py, in the same directory and at the top of it: import mlbviewer This will make the classes in mlbviewer available to your script, under the mlbviewer namespace. So you could then initialize a class in your new script: sched = mlbviewer.MLBSchedule() or whatever. Same with mlbviewer.GameStream(). So you don't have to hack up a workflow which might is mainly suitable for an interface that you don't have much need for. |
Also, if you've already downloaded the new version (pre 4pm ET), you'll have to download it again.
Or you could just find the line that says 'mp_login_register' on line 242 and change it to 'mp_login' |
Quote:
I have a basic hack of your old script that just uses the curses menu to select a game to record, generates a filename based off date and gameid, and calls mplayer with the necessary arguments to record. I did a couple of quick tests yesterday and I have to say, it was awfully cool to be able to pause and seek through the file. I'm recording the Dodgers game right now. The other question is when I was trying to figure out why things were going wrong, I inserted my own logging in various places. This meant moving the file i/o calls from mainloop to deeper into the classes until I could figure out exactly how far the script was getting and what it knew at the time before it crapped out on me. Eventually, I figured out it wasn't the script at all but the Clientform library. But still, it might be nice to have some optional debug logging that says where it is and what it knows. Then again, it might not be necessary since most of the problems encountered so far have been outside of the script's code (mlb.com's problems or clientform problems.) |
Sounds like the recording feature could be used to make something of a baseball DVR. When watching live TV, MythTV records the stream to disk and plays it back, creating the DVR functionality. It would be pretty nice to be able to do that with baseball games, too. Save the stream to disk and immediately begin playing back the stream. Then yes, seeking should be possible and buffer problems wouldn't cause a complete failure of the player window.
And if you came in late, you can watch it from the beginning and "catch up" during commercials. I like it! |
Quote:
|
Quote:
But yeah, it will be pretty nice when it's working. I was recording the Dodgers game until my router timed out my connection :-( I might keep the curses interface after all just so I can print a time counter and mb counter to keep the session active while I'm at work. [EDIT: I remember where I was going with that thought. I have part of a Dodgers game recorded. I was able to fast forward through the commercial breaks and pause it when I got a phone call. I had to come back for work but I can seek back to where I left off when I get home again. Try that with an archived stream.] I'm still learning python and not putting a whole lot of time into this yet. I might have a very alpha version available by next Monday. |
I have it now working under cygwin...almost. The archived games work about 80% of the time. The live games aren't working yet. I've tested with both Windows Media Player and the cygwin-ized mplayer. Mplayer definitely behaves better (and provides more information.) In the process, I've started some basic work on putting debugging information into mlbviewer using the curses interface.
This is really just informational, jkr. Unless I run into a problem that is also present on Linux, I don't expect you to support the cygwin version. But if I can get it working, I like this a lot better than navigating the web site. ;-) |
All times are GMT -5. The time now is 08:47 PM. |