LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-22-2008, 08:27 PM   #511
CartersAdvocate
Member
 
Registered: Sep 2003
Location: Columbus, OH
Distribution: Slackware 12.2
Posts: 166

Rep: Reputation: 30

Quote:
Originally Posted by daftcat View Post
There's a help screen if you press 'h'.

'r' will refresh the listings.
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".
 
Old 04-22-2008, 11:16 PM   #512
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Quote:
Originally Posted by j3ff3r View Post
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

We get our information from a page like this:


http://mlb.mlb.com/components/game/y...amesbydate.jsp


So it's possible MLB gave us stale information too. In that case, there's nothing we can do.
 
Old 04-23-2008, 03:48 AM   #513
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Top Plays and Game Recap support: Testers needed

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.

Cheers!
daftcat
 
Old 04-23-2008, 08:10 AM   #514
Onip
Member
 
Registered: Apr 2008
Posts: 36

Rep: Reputation: 15
Code:
$ 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'.
 
Old 04-23-2008, 09:22 AM   #515
hanophix
LQ Newbie
 
Registered: Apr 2008
Posts: 19

Rep: Reputation: 0
I got the same problem, different line numbers though. Just started doing this in the morning

Last edited by hanophix; 04-23-2008 at 09:25 AM. Reason: Similar to Onip
 
Old 04-23-2008, 10:04 AM   #516
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
TEMPORARY WORKAROUND FOR ValueError in simplejson

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.

Last edited by daftcat; 04-23-2008 at 10:06 AM.
 
Old 04-23-2008, 10:07 AM   #517
CartersAdvocate
Member
 
Registered: Sep 2003
Location: Columbus, OH
Distribution: Slackware 12.2
Posts: 166

Rep: Reputation: 30
Quote:
Originally Posted by Onip View Post
Code:
$ 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.
 
Old 04-23-2008, 10:08 AM   #518
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
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.
 
Old 04-23-2008, 10:11 AM   #519
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Quote:
Originally Posted by j3ff3r View Post
Upgraded to latest svn and I get the same messages (same line numbers and everything) when trying to change dates as well.
Can you update once more? I wonder if it's possible that you pulled before svn finished transmitting.

Or, can you grep MLBJsonError mlbviewer.py?

If that doesn't return at least half a dozen results, you pulled before I finished transmitting the fix.
 
Old 04-23-2008, 10:14 AM   #520
ilikerobots
LQ Newbie
 
Registered: Apr 2008
Posts: 17

Rep: Reputation: 0
Quote:
Originally Posted by daftcat View Post
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.
 
Old 04-23-2008, 10:32 AM   #521
ilikerobots
LQ Newbie
 
Registered: Apr 2008
Posts: 17

Rep: Reputation: 0
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.
 
Old 04-23-2008, 10:35 AM   #522
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Everyone Must Update To Latest Svn

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.

To verify that you have the workaround:

Code:
matthew@tango:~/mlbtv/svn/mlbviewer$ grep MLBJsonError mlbviewer.py
from MLBviewer import MLBJsonError
    except MLBJsonError:
            except MLBJsonError:
            except MLBJsonError:
            except MLBJsonError:
            except MLBJsonError:
                except MLBJsonError:
                    except MLBJsonError:
            except MLBJsonError:
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:

http://mlb.mlb.com/components/game/y...amesbydate.jsp

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.

Last edited by daftcat; 04-23-2008 at 10:44 AM.
 
Old 04-23-2008, 10:39 AM   #523
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Quote:
Originally Posted by ilikerobots View Post
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.)
 
Old 04-23-2008, 11:02 AM   #524
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Are we good for now?

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.)
 
Old 04-23-2008, 11:13 AM   #525
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
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.

Thanks for all the great work on this!!
 
  


Reply

Tags
help, install, installation, instructions, seek, vlc, windows



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mlb.com gameday audio stream statmobile Linux - Newbie 6 05-06-2008 10:16 PM
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration