LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 04-15-2008, 12:51 AM   #346
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35

Quote:
Originally Posted by daftcat View Post
With all games or just some games?
I get that error with all today's games, whether live or "archived." All of yesterday's games play back fine all the time.
 
Old 04-15-2008, 01:05 AM   #347
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
I'm watching the Giants game right now, but as I said, I just cut and pasted a url that didn't work a moment before. This is really mysterious. And annoying.

On the whole, this was possibly the worst day to release a version for testing. We'll see, maybe tomorrow will work like normal again.
 
Old 04-15-2008, 01:11 AM   #348
dmandell
Member
 
Registered: Apr 2008
Posts: 30

Rep: Reputation: 15
Quote:
Originally Posted by jkr View Post
On the whole, this was possibly the worst day to release a version for testing. We'll see, maybe tomorrow will work like normal again.
Just so you don't get *too* down, the audio part of the script works fantastically... which I really appreciate, so thanks for that, it'll be nice not to have to figure out whether the Cubs are at home or away before I try to listen to a game.

d
 
Old 04-15-2008, 01:17 AM   #349
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
Sorry to top post but it's easier to read for this post.

I understand that the listings have all the information we need. As a newbie Python programmer, I'm still having trouble wrapping my head around all the dictionary syntax.

Here's what I started on.

Instead of defining the gameid at dct['video'][url['speed']] in the listings, I'm going to expand this to include all items in url['url'].

So accessing the gameid will now be:

dct['video'][url['speed']][id]

and so on for the other elements which won't be trimmed. Then I think gameid should become gameid[] which will be a url entry from dct['video'][url['speed']] and all it's subkeys and values. Assuming I can figure out how to do this.

Like I said, if you have a better way, please let me know. While I have experience with many other scripting languages, this dictionary concept and syntax is very powerful and very confusing. Online documentation is very sparse and terse about it all and *every* Python book at the library is checked out. That's gotta say something about the complexity of the language....

Quote:
Originally Posted by jkr View Post
use_default_colors() isn't strictly necessary, but it makes it look a lot nicer, it can have transparent terminals, etc. I know it's a relatively new feature in the python curses implementation. If you're getting that error, what version are you using?

daftcat -- GameStream can have access to everything in the JSP file. Here's a sample game from today's schedule. But there's a lot of information. That's why we have the trimList step -- get the parts that are helpful. Of course, more can be added at that stage (as with audio), it will still be trimmer.

Code:
{
	condensed_video: null,
	gameid: '2008/04/15/anamlb-texmlb-1',
	teams: [{
			isHome: false,
			runs: null,
			code: 'ana'
		}, {
			isHome: true,
			runs: null,
			code: 'tex'
		}],
	status: 'P',
	event_time: ' 2:05 PM',
	home_audio: {
		blackout: 'local',
		text: 'KRLD',
		media_type: 'audio',
		urls: [{
				blackout: 'local',
				speed: '12',
				url: {
					w: 'http://web.servicebureau.net/conf/meta?i=1112958373&c=1234&m=was&u=/w2.xsl',
					w_id: '621432',
					v: '2',
					login: 'Y',
					authorization: 'Y',
					mid: '200803172433159',
					pid: 'mlb_ga',
					fid: 'h12',
					url: 'http://web.servicebureau.net/conf/meta?i=1112958373&c=1234&m=was&u=/w2.xsl',
					id: '621432',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: null
			}],
		is_free: false,
		state: 'audio_pregame'
	},
	away_audio: {
		blackout: 'local',
		text: 'KLAA',
		media_type: 'audio',
		urls: [{
				blackout: 'local',
				speed: '12',
				url: {
					w: 'http://web.servicebureau.net/conf/meta?i=1112953247&c=1234&m=was&u=/w2.xsl',
					w_id: '621434',
					v: '2',
					login: 'Y',
					authorization: 'Y',
					mid: '200803172433160',
					pid: 'mlb_ga',
					fid: 'a12',
					url: 'http://web.servicebureau.net/conf/meta?i=1112953247&c=1234&m=was&u=/w2.xsl',
					id: '621434',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: null
			}],
		is_free: false,
		state: 'audio_pregame'
	},
	extended_highlights: null,
	alt_away_audio: {
		blackout: 'local',
		text: 'KWKW',
		media_type: 'audio',
		urls: [{
				blackout: 'local',
				speed: '12',
				url: {
					w: 'http://web.servicebureau.net/conf/meta?i=1112998065&c=1234&m=was&u=/w2.xsl',
					w_id: '621438',
					v: '2',
					login: 'Y',
					authorization: 'Y',
					mid: '200803172433162',
					pid: 'mlb_ga',
					fid: 'aa12',
					url: 'http://web.servicebureau.net/conf/meta?i=1112998065&c=1234&m=was&u=/w2.xsl',
					id: '621438',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: null
			}],
		is_free: false,
		state: 'audio_pregame'
	},
	alt_home_audio: {
		blackout: 'local',
		text: 'KFLC',
		media_type: 'audio',
		urls: [{
				blackout: 'local',
				speed: '12',
				url: {
					w: 'http://web.servicebureau.net/conf/meta?i=1112971037&c=1234&m=was&u=/w2.xsl',
					w_id: '621436',
					v: '2',
					login: 'Y',
					authorization: 'Y',
					mid: '200803172433161',
					pid: 'mlb_ga',
					fid: 'ha12',
					url: 'http://web.servicebureau.net/conf/meta?i=1112971037&c=1234&m=was&u=/w2.xsl',
					id: '621436',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: null
			}],
		is_free: false,
		state: 'audio_pregame'
	},
	event_date: '04/15/2008',
	gametype: 'R',
	game_wrapup: null,
	top_play_index: null,
	mlbtv: {
		blackout: 'local',
		text: '04-15-2008 : Los Angeles Angels of Anaheim at Texas Rangers | MLB.TV',
		media_type: 'video',
		urls: [{
				blackout: 'local',
				speed: '400',
				url: {
					w: 'null',
					w_id: '645751',
					v: '3',
					login: 'Y',
					authorization: 'Y',
					mid: '200804122520838',
					pid: 'mlb_lg',
					fid: 'mlb_lg400',
					url: 'null',
					id: '645751',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: 'video_off'
			}, {
				blackout: 'local',
				speed: '800',
				url: {
					w: 'null',
					w_id: '645752',
					v: '3',
					login: 'Y',
					authorization: 'Y',
					mid: '200804122520838',
					pid: 'mlb_lg',
					fid: 'mlb_lg800',
					url: 'null',
					id: '645752',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: 'video_off'
			}, {
				blackout: 'local',
				speed: '1200',
				url: {
					w: 'null',
					w_id: '645753',
					v: '3',
					login: 'Y',
					authorization: 'Y',
					mid: '200804122520838',
					pid: 'mlb_lg',
					fid: 'mlb_lg1200',
					url: 'null',
					id: '645753',
					gid: '2008/04/15/anamlb-texmlb-1'
				},
				state: 'video_off'
			}],
		is_free: true,
		state: 'video_off'
	},
	seriescode: null,
	tbd: false
}
 
Old 04-15-2008, 01:20 AM   #350
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
If you think it's just a timing issue, I can use mlbgameid to fetch the url and my mlbplay to play it. I'll test that on several games. If it's a timing issue, we can try poll() instead of wait(). I'll run some tests and let you know.

(I'm so glad I wrote that mlbgameid script. It's turning out to be a powerful test tool for the network code.)
 
Old 04-15-2008, 01:29 AM   #351
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
I think you just got lucky.

I ran some tests just grabbing the url or using poll or whatever and they all ended in tragedy.
 
Old 04-15-2008, 01:47 AM   #352
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
There's two pages worth of complaints on the Mosaic Forum about problems with live games. Now I don't feel quite so bad.

I think I'll upgrade my Mosaic client and see how it does it. I hope we get this figured out before my Trial license on HTTP Analyzer runs out because the other tools I've tried are not nearly as useful.

jkr

Mind if I add a x_display option to the config file? I know I may be the only weirdo who launches this remotely and needs to set the DISPLAY variable to :0.0, but it's kind of annoying when I finally snag a stream and realize that DISPLAY wasn't set.

If it's okay with you, put these lines wherever you think is most appropriate:

Code:
if cfg['x_display']:
    os.environ['DISPLAY'] = cfg['x_display']
Test it for me with your setup to make sure it doesn't cause problems for people who run it locally. Default x_display to None to make it transparent to everyone else.

Also, we should probably make it a cfg override to disable the curses.use_default_colors() call:

Code:
if cfg['cursesbug'] is None:
   curses.use_default_colors()
 
Old 04-15-2008, 02:25 AM   #353
dmandell
Member
 
Registered: Apr 2008
Posts: 30

Rep: Reputation: 15
I just wanted to let you guys know that as of 11:20pm or so I can view all of the archived games. Maybe it was just a temporary problem on the server side?
 
Old 04-15-2008, 02:50 AM   #354
Wolfvorkian
Member
 
Registered: Sep 2007
Distribution: Arch
Posts: 108

Rep: Reputation: 15
Quote:
Originally Posted by dmandell View Post
I just wanted to let you guys know that as of 11:20pm or so I can view all of the archived games. Maybe it was just a temporary problem on the server side?
Thanks, I just checked again at around 10:30pm ADT (2:30am EDT) & the archived games are fine. When I couldn't get anything, I thought it was Mplayer crashing. I kept getting a message about some dll in /usr/something...win32codecs/... Well, Mplayer was crashing but it isn't now.... so whatever the problem was, it no longer exist.

Wonder if this daftcat is related to the very famous straycat who was topdog on some Usenet warez group around a decade ago? If so, I want his autograph.
 
Old 04-15-2008, 02:51 AM   #355
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
Quote:
Originally Posted by dmandell View Post
I just wanted to let you guys know that as of 11:20pm or so I can view all of the archived games. Maybe it was just a temporary problem on the server side?
Great news!

Some games I'm still having trouble with but most I can snag. It looks like they just had a terrible night. Hopefully tomorrow will be better.

It looks like it's not just the Tigers who are still trying to find their stride. ;-) But that a was a very nice comeback they mounted tonight. Maybe there's hope for MLB.com too.
 
Old 04-15-2008, 02:54 AM   #356
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
Quote:
Originally Posted by Wolfvorkian View Post
Thanks, I just checked again at around 10:30pm ADT (2:30am EDT) & the archived games are fine. When I couldn't get anything, I thought it was Mplayer crashing. I kept getting a message about some dll in /usr/something...win32codecs/... Well, Mplayer was crashing but it isn't now.... so whatever the problem was, it no longer exist.

Wonder if this daftcat is related to the very famous straycat who was topdog on some Usenet warez group around a decade ago? If so, I want his autograph.
Heh, no. But that's funny because straycat is another handle I go by.

Weird. I have a doppleganger.

<Insert Twilight Zone music>

Maybe all straycats go daft given long enough.
 
Old 04-15-2008, 03:34 AM   #357
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,767

Rep: Reputation: 76
Oh good! There's some day games tomorrow. I should take a real sick day tomorrow since today wasn't all that restful. It'll be nice to cozy up with the Angels and Rangers and some good herb tea.
 
Old 04-15-2008, 08:15 AM   #358
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
daftcat

Quote:
So accessing the gameid will now be:

dct['video'][url['speed']][id]

and so on for the other elements which won't be trimmed. Then I think gameid should become gameid[] which will be a url entry from dct['video'][url['speed']] and all it's subkeys and values. Assuming I can figure out how to do this.

Like I said, if you have a better way, please let me know.
Okay, I see -- yeah, that sounds like it should work great. Just to make sure I understand: you want all of the following information in the dictionary that getListings() uses, in order to pass on to GameStream to make a more realistic url:

Code:
w: 'null',
w_id: '645752',
v: '3',
login: 'Y',
authorization: 'Y',
mid: '200804122520838',
pid: 'mlb_lg',
fid: 'mlb_lg800',
url: 'null',
id: '645752',
gid: '2008/04/15/anamlb-texmlb-1'
Right? Yeah -- this would be fine. So I take it that you're basically suggesting holding off the index call on ['id'] until the next step. So instead of

Code:
for url in elem['mlbtv']['urls']:
    dct['video'][url['speed']] = url['url']['id']
you would have

Code:
for url in elem['mlbtv']['urls']:
    dct['video'][url['speed']] = url['url']
Then in trimList, t, t['video']['800'] would be a dictionary, and you could call all of the above attributes.

I'm just saying, very slowly for my own early morning benefit, that yes, this would work absolutely fine.

EDIT: if you're having trouble getting it to do exactly what you want, write out explicitly what you'd like trimlist to look like, for a specific game, and I'd be happy to suggest how to get there.

Last edited by jkr; 04-15-2008 at 08:52 AM.
 
Old 04-15-2008, 08:29 AM   #359
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
daftcat The x_display config sounds like a good idea. I'll put it in somewhere, or, if you get a chance to play with it, you can also commit it.

As for curses.use_default_colors(), since it seemed to produce a _curses.error, I'll just put it inside of a try/except. That should handle python 2.4 and forward. I'll also put it inside of an

if hasattr(curses, 'use_default_colors')

That should catch most errors transparently.

EDIT: in fact, I just committed it.

quonset

If you get a chance, could you try this out: where it said

Code:
-    
curses.use_default_colors()
(the code you commented out) could you try replacing that with

Code:
if hasattr(curses, 'use_default_colors'):
    try:
        curses.use_default_colors()
    except _curses.error:
        pass
and let me know if it just works? Thanks.

Last edited by jkr; 04-15-2008 at 08:32 AM.
 
Old 04-15-2008, 08:35 AM   #360
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
And all the archived games work fine for me too now. Let's just cross our fingers till that day game.
 
  


Reply

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:16 PM
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 11:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 11:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 03:49 PM


All times are GMT -5. The time now is 10:29 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration