Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think I worded the question wrong...I was wondering what tells the program that the stream is active, because a) it was the time it was supposed to start and b) the stream was working, but it wasn't bold on there, it still said "Not Yet Available".
I think I worded the question wrong...I was wondering what tells the program that the stream is active, because a) it was the time it was supposed to start and b) the stream was working, but it wasn't bold on there, it still said "Not Yet Available".
Ah, we make a request for the TV / Radio schedule when we first start up. Whenever you started the mlbviewer, your listings are frozen in that moment of time. In other words, if you started mlbviewer at 5 ET and the game starts at 8 ET, and you came back at 8 ET, your listings view would be 3 hours old. We don't update that listings view except in a few occasions:
Left/Right Navigate one day forward or back
j Jump to a date
p Toggle speed (does not change config file)
r Refresh listings
I implemented Top Plays and Game Recap support (same screen) by highlighting a game and pressing 't'. This opens the Top Plays screen. Up and Down are as you expect them and Enter selects the highlight.
Here are a couple of things to note about Top Plays feature:
A new configuration file option top_plays_player was added so you don't have to overkill on cache for a short clip. If you don't specify this option in your config file, it will default to your video_player option. I use a 4 mb cache for a normal game but that's way too much for a 20 second clip so I have the all the same options in my top_plays_player except I changed the cache to 1024.
Certain features are disabled in the Top Plays view including any feature that would allow you to change days (Left, Right, Jump.) Basically, it doesn't make sense to navigate across days except by using the Listings view. Speed toggling and Gameday Audio also aren't supported in Top Plays screen. Basically, you'll get an error message saying, "That key is not supported in this screen..." if the feature is disabled for Top Plays screen.
All Top Plays are 400K streams so the speed indicator will automatically change to 400K to visually remind you of this fact. It will change back to whatever value you use for games when you return to the listings view.
If you don't have an MLB.com account, you can still use Top Plays feature. You still need to specify user= and pass= in the config file but you can leave the value blank. For MLB.TV subscribers, we don't login for Top Plays but we still do for games and audio.
You can get this code from svn. I need people to test the heck out of it before I feel comfortable about making it part of the next official release. (Coming soon!) I tried to cover all the scenarios, including some weird cases, but no code is ever bug free (except maybe a hello world script.)
Svn instructions are on the previous page. Please post your experiences here--good or bad.
If you encounter any Tracebacks, please post the entire Traceback here.
$ python mlbviewer.py
Traceback (most recent call last):
File "mlbviewer.py", line 543, in <module>
curses.wrapper(mainloop, mycfg.data)
File "/usr/lib/python2.5/curses/wrapper.py", line 44, in wrapper
return func(stdscr, *args, **kwds)
File "mlbviewer.py", line 313, in mainloop
cfg['audio_follow'])
File "/home/onip/mlbviewer/MLBviewer/mlbtv.py", line 288, in getListings
self.getData()
File "/home/onip/mlbviewer/MLBviewer/mlbtv.py", line 191, in getData
self.data = self.__jsonToPython()
File "/home/onip/mlbviewer/MLBviewer/mlbtv.py", line 186, in __jsonToPython
return simplejson.loads(self.__scheduleToJson())
File "/usr/lib/python2.5/site-packages/simplejson/__init__.py", line 262, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 251, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 268, in raw_decode
obj, end = self._scanner.iterscan(s, **kw).next()
File "/usr/lib/python2.5/site-packages/simplejson/scanner.py", line 50, in iterscan
rval, next_pos = action(m, context)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 171, in JSONArray
value, end = iterscan(s, idx=end, context=context).next()
File "/usr/lib/python2.5/site-packages/simplejson/scanner.py", line 50, in iterscan
rval, next_pos = action(m, context)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 138, in JSONObject
value, end = iterscan(s, idx=end, context=context).next()
File "/usr/lib/python2.5/site-packages/simplejson/scanner.py", line 50, in iterscan
rval, next_pos = action(m, context)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 148, in JSONObject
raise ValueError(errmsg("Expecting , delimiter", s, end - 1))
ValueError: Expecting , delimiter: line 1 column 66499 (char 66499)
This happens when I try to change date ( I wanted to try TopPlays from yesterday's games ), both with left key and by pressing 'j'.
I get the same ValueError with ALL VERSIONS (not just the latest svn.) Since the error is coming from simplejson (the JSON parser library), it may be that MLB.com has a badly formed JSP for today's listings. I'm not sure which MLB.com pages or applications use this page, so I don't know if and when they'll fix today's jsp. Hopefully they will.
In the meantime, I've caught the ValueError exception and print a "There was a parser problem with listings page" error to the status line.
The bad news is that until they fix this or until I can find where and how it's broken, today's listings will not be available.
The good news is that every other day that has well-formed jsp will be available including yesterday's top plays.
Please re-pull from svn to get this latest fix. Let me know if you encounter that error again with the newest svn.
$ python mlbviewer.py
Traceback (most recent call last):
File "mlbviewer.py", line 543, in <module>
curses.wrapper(mainloop, mycfg.data)
File "/usr/lib/python2.5/curses/wrapper.py", line 44, in wrapper
return func(stdscr, *args, **kwds)
File "mlbviewer.py", line 313, in mainloop
cfg['audio_follow'])
File "/home/onip/mlbviewer/MLBviewer/mlbtv.py", line 288, in getListings
self.getData()
File "/home/onip/mlbviewer/MLBviewer/mlbtv.py", line 191, in getData
self.data = self.__jsonToPython()
File "/home/onip/mlbviewer/MLBviewer/mlbtv.py", line 186, in __jsonToPython
return simplejson.loads(self.__scheduleToJson())
File "/usr/lib/python2.5/site-packages/simplejson/__init__.py", line 262, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 251, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 268, in raw_decode
obj, end = self._scanner.iterscan(s, **kw).next()
File "/usr/lib/python2.5/site-packages/simplejson/scanner.py", line 50, in iterscan
rval, next_pos = action(m, context)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 171, in JSONArray
value, end = iterscan(s, idx=end, context=context).next()
File "/usr/lib/python2.5/site-packages/simplejson/scanner.py", line 50, in iterscan
rval, next_pos = action(m, context)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 138, in JSONObject
value, end = iterscan(s, idx=end, context=context).next()
File "/usr/lib/python2.5/site-packages/simplejson/scanner.py", line 50, in iterscan
rval, next_pos = action(m, context)
File "/usr/lib/python2.5/site-packages/simplejson/decoder.py", line 148, in JSONObject
raise ValueError(errmsg("Expecting , delimiter", s, end - 1))
ValueError: Expecting , delimiter: line 1 column 66499 (char 66499)
This happens when I try to change date ( I wanted to try TopPlays from yesterday's games ), both with left key and by pressing 'j'.
Upgraded to latest svn and I get the same messages (same line numbers and everything) when trying to change dates as well.
I guess I'll get more testers of the latest code than I hoped for since the badly formed jsp (at least that's what I assume it is) hoses every earlier version of mlbviewer including the last official release.
Please re-pull from svn to get this latest fix. Let me know if you encounter that error again with the newest svn.
After update, I receive following when going to 4/22 games:
Code:
Traceback (most recent call last):
File "mlbviewer.py", line 606, in <module>
curses.wrapper(mainloop, mycfg.data)
File "curses/wrapper.py", line 44, in wrapper
File "mlbviewer.py", line 339, in mainloop
cfg['audio_follow'])
File "/home/mike/progs/mlbview/mlbviewer/trunk/MLBviewer/mlbtv.py", line 295, in getListings
listings = self.trimList()
File "/home/mike/progs/mlbview/mlbviewer/trunk/MLBviewer/mlbtv.py", line 203, in trimList
raise MLBJsonError
MLBviewer.mlbtv.MLBJsonError
However [j]umping to 4/21 works ok. And the top play support is awesome.
Last edited by ilikerobots; 04-23-2008 at 10:17 AM.
Oh, by the way, regarding the discussion about whether MLB would approve or not: my guess is their main concern with unauthorized clients is that it can allow people to circumvent their advertising (never mind that I use adblock). In this case, though, it's not a matter of us linux users using a client we like more than MLB's; but rather that MLB's client doesn't work at all for us.
So we wouldn't be getting any of the advertising anyway, and at least this way they still get our money for subscriptions.
I can't tell you what happened with today's schedule page that we get from mlb.com. A library call outside of our own code is telling us that it is very likely mlb.com posted a badly formed jsp page. I just don't have the time this morning to look deeply into this. Unfortunately, the JSON to Python code is jkr's domain, but I guess I'll have to learn fast.
To update to the latest svn:
Code:
svn co https://mlbviewer.svn.sourceforge.net/svnroot/mlbviewer/trunk mlbviewer
from your favorite terminal program. You will need the subversion package if you don't have the svn command.
The bad news:
Every previous version of mlbviewer is affected by this.
Today's games may be unavailable from mlbviewer.
The good news:
Every other day (those without badly formed jsp schedules) should be available and you get the new Top Plays feature support.
How to watch today's games:
If the jsp isn't fixed by mlb.com or I'm not able to figure out how to correct for it on our end, you can still watch today's games using the mlbgameid.py script in the test directory:
First, find the stream id for the game, gameday audio, or top play you want to watch/listen to from the jsp page:
Within a particular listing there are home_audio, away_audio, mlbtv, top_play_index, and game_wrapup sections.
This is an example of a mlbtv listing:
Code:
mlbtv: {
blackout: 'local',
text: '04-23-2008 : Los Angeles Angels of Anaheim at Boston Red Sox | MLB.TV',
media_type: 'video',
urls: [{
blackout: 'local',
speed: '400',
url: {
w: 'null',
w_id: '653960',
v: '3',
login: 'Y',
authorization: 'Y',
mid: '200804192553485',
pid: 'mlb_lg',
fid: 'mlb_lg400',
url: 'null',
id: '653960',
gid: '2008/04/23/anamlb-bosmlb-1'
},
The speed: entry says this is a 400k stream. There will be another entry for 800k that I didn't paste above. From this listing, copy the six digit number in id: and use that as an argument to mlbgameid.py
Code:
test/mlbgameid.py 653960
This is meant to be a testing only tool so it produces a lot of output but it should eventually start playing the stream for you based on your config file player commands.
I just uploaded one more fix into svn for the mlbgameid.py script to autodetect whether it should use the video_player or audio_player config file option based on the stream url type. You'll have to check out from svn once more for this fix.
I apologize for releasing the workarounds in multiple svn's this morning. I honestly don't have time for these problems this morning but I'd rather not leave you all high and dry until tonight. If I have some more time before tonight, I'll track down the root cause of today's problems.
After update, I receive following when going to 4/22 games:
Code:
Traceback (most recent call last):
File "mlbviewer.py", line 606, in <module>
curses.wrapper(mainloop, mycfg.data)
File "curses/wrapper.py", line 44, in wrapper
File "mlbviewer.py", line 339, in mainloop
cfg['audio_follow'])
File "/home/mike/progs/mlbview/mlbviewer/trunk/MLBviewer/mlbtv.py", line 295, in getListings
listings = self.trimList()
File "/home/mike/progs/mlbview/mlbviewer/trunk/MLBviewer/mlbtv.py", line 203, in trimList
raise MLBJsonError
MLBviewer.mlbtv.MLBJsonError
However [j]umping to 4/21 works ok. And the top play support is awesome.
Good catch. I was copying the six or so lines of new protection code everywhere I called getListings and pasting it after the unprotected calls. I thought I removed all the unprotected calls but I guess I missed one.
Please checkout from svn once more and tell if you still get an MLBJsonError (or ValueError for that matter.)
I can look deeper into the issue later, but I want to make sure you all can watch archived games and top plays until this is fixed properly (which will probably have to come from mlb.com fixing their jsp.)
I just pulled from svn and... nice! Top plays support = fabulous.
I'm able to see today's schedule, it's yesterday's (4/22) that I have problems with. It says "There was a parser problem with the listings page." Previous days work fine, though.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.