LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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-03-2008, 08:47 PM   #91
cwatson
LQ Newbie
 
Registered: Apr 2008
Posts: 1

Rep: Reputation: 0

So I wrote a greasemonkey script to fix the gameday audio to work. It finds the url for the audio stream from the appropriate webpage and opens it in a new window. Hopefully, you have a plugin that can handle the format of the stream (at least totem on ubuntu for me does). You can download the script from userscripts.org if you search for "mlb on linux". It probably does nothing for the video, though.
 
Old 04-04-2008, 01:34 AM   #92
Hoth
LQ Newbie
 
Registered: Jan 2007
Location: Northern California
Distribution: Kubuntu 8.10
Posts: 26

Rep: Reputation: 15
In enterworkflow.do for a 400k video I see:
Code:
 try{
 window.top.mlbMediaUtils.postLogin({ url:"mms://a1369.v108697.c10869.g.vm.akamaistream.net/7/1369/10869/v0004/mlb.download.akamai.com/10869/2008/mlb_!/mlbam/2008/04/03/mlbtv_tornya_400k.wmv?auth=ca.aUa1cFajd2d1a9cMduaAa1a4cKbhaza1-bh9Cer-bA-1egwgKez-m9j3lfmejcjfjclek9jhjej9jalajkm7mcjclbmdjc&aifp=v0004&ct5=04-Apr-08&ct1=&ct3=291713&ct7=638724&ct4=mlb&ct6=76.246.46.81&ct8=1", type:"w", ads:"null" });
 }
 catch(e){
 if(window.top["slMediaPlayer"]){
 window.top.slPostWorkflow({ url:"mms://a1369.v108697.c10869.g.vm.akamaistream.net/7/1369/10869/v0004/mlb.download.akamai.com/10869/2008/mlb_!/mlbam/2008/04/03/mlbtv_tornya_400k.wmv?auth=ca.aUa1cFajd2d1a9cMduaAa1a4cKbhaza1-bh9Cer-bA-1egwgKez-m9j3lfmejcjfjclek9jhjej9jalajkm7mcjclbmdjc&aifp=v0004&ct5=04-Apr-08&ct1=&ct3=291713&ct7=638724&ct4=mlb&ct6=76.246.46.81&ct8=1", type:"w", ads:"null" });
 }
 else{
 window.top["mplayerObj"].postWorkflow({ url:"mms://a1369.v108697.c10869.g.vm.akamaistream.net/7/1369/10869/v0004/mlb.download.akamai.com/10869/2008/mlb_!/mlbam/2008/04/03/mlbtv_tornya_400k.wmv?auth=ca.aUa1cFajd2d1a9cMduaAa1a4cKbhaza1-bh9Cer-bA-1egwgKez-m9j3lfmejcjfjclek9jhjej9jalajkm7mcjclbmdjc&aifp=v0004&ct5=04-Apr-08&ct1=&ct3=291713&ct7=638724&ct4=mlb&ct6=76.246.46.81&ct8=1", type:"w", ads:"null" });
 }
 }
It seems like this or something else in the firebug info should be indicative of a way to write a greesemonkey script for video. I've very clumsily edited cwatson's script (which does work great for audio) to this to try to make it handle video:
Code:
// ==UserScript==
// @name           mlb
// @namespace      mlb
// @description    mlb fix
// @include        http://www.mlb.com/enterworkflow.do*
// ==/UserScript==
var patt1 = /mms:[^"]*/g;
media_url=document.getElementsByTagName('script')[2].innerHTML.match(patt1);
window.open(media_url);
With that I get "Firefox doesn't know how to open this address, because the protocol (mms) isn't associated with any program." Is that progress? So, how do I associate mplayer with the mms protocol? Sorry for being stupid, it's probably obvious, but I'm an Opera user normally.

As an aside, firebug shows that /scripts/mediaplayer/mlb_player.js contains this:
Code:
arlPrependWMP : "mms://a1503.v108692.c10869.g.vm.akamaistream.net/7/1503/10869/v0001/mlb.download.akamai.com/10869/",
arlPrependLiveReal : "rtsp://a1503.l10869[PORT].c10869.g.lr.akamaistream.net/live/D/1503/10869/v0001/reflector:[PORT]",
arlPrependLiveWMP : "mms://a1503.l10869[PORT].c10869.g.lm.akamaistream.net/D/1503/10869/v0001/reflector:[PORT]",
Funny they have something for live RealVideo streams in there when they haven't offered them for several years. If only they would again -- realplayer is at least genuinely cross-platform.

Last edited by Hoth; 04-04-2008 at 01:46 AM.
 
Old 04-04-2008, 01:46 AM   #93
jlo_sandog
Member
 
Registered: Jul 2005
Location: USA
Distribution: F10 (x86_64)
Posts: 549

Rep: Reputation: 31
Hi,
This link tells how to register a protocol.
http://kb.mozillazine.org/Register_protocol
 
Old 04-04-2008, 01:55 AM   #94
Hoth
LQ Newbie
 
Registered: Jan 2007
Location: Northern California
Distribution: Kubuntu 8.10
Posts: 26

Rep: Reputation: 15
Thanks. Setting /usr/bin/mplayer as the associated app, however, it gives me this prompt but then does nothing (except remove the prompt) when I click "launch application". Maybe I need to get it to add proper quoting of the URL somehow? Or maybe that endless URL is the wrong endless URL?

Last edited by Hoth; 04-04-2008 at 02:03 AM.
 
Old 04-04-2008, 02:03 AM   #95
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,748

Rep: Reputation: 76
Hi!

You might want to single quote the url but it looks like it still handled it alright. So that's probably not your problem. The next thing I'd try is installing the w32codecs package. If it installs in /usr/lib/win32, mplayer should pick it up automatically. If that works for you, let me know and I'll update the mini-howto. If you fix the problem through whatever means, let me know and I'll update it.

Thanks,
Matthew

Quote:
Originally Posted by mr_e_uss View Post
Now that I've found this thread, I feel like I am so close to getting this to work. However, mplayer crashes. Any ideas?

$ mlbplay "mUrl:mms://a92.l1086917572.c10869.g.lm.akamaistream.net/D/92/10869/v0001/reflector:17572?auth=ca.cUa2agaDbLbba3ccdacBa2cydgcdc4ad-bh9xkg-bA-1ehulKex-k7j7lbm7lkjalgmblal8jflhj7jcjfklk4jblbmclajalhmh&aifp=v0004&ct5=03-Apr-08&ct1=mlb&ct3=4281702&ct7=638721&ct4=mlb&ct6=76.119.147.186&ct8=1"
MPlayer 2:1.0~rc1-0ubuntu13.2+medibuntu1 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.

Playing mms://a92.l1086917572.c10869.g.lm.akamaistream.net/D/92/10869/v0001/reflector:17572?auth=ca.cUa2agaDbLbba3ccdacBa2cydgcdc4ad-bh9xkg-bA-1ehulKex-k7j7lbm7lkjalgmblal8jflhj7jcjfklk4jblbmclajalhmh&aifp=v0004&ct5=03-Apr-08&ct1=mlb&ct3=4281702&ct7=638721&ct4=mlb&ct6=76.119.147.186&ct8=1.
STREAM_ASF, URL: mms://a92.l1086917572.c10869.g.lm.akamaistream.net/D/92/10869/v0001/reflector:17572?auth=ca.cUa2agaDbLbba3ccdacBa2cydgcdc4ad-bh9xkg-bA-1ehulKex-k7j7lbm7lkjalgmblal8jflhj7jcjfklk4jblbmclajalhmh&aifp=v0004&ct5=03-Apr-08&ct1=mlb&ct3=4281702&ct7=638721&ct4=mlb&ct6=76.119.147.186&ct8=1
Resolving a92.l1086917572.c10869.g.lm.akamaistream.net for AF_INET6...
Couldn't resolve name for AF_INET6: a92.l1086917572.c10869.g.lm.akamaistream.net
Resolving a92.l1086917572.c10869.g.lm.akamaistream.net for AF_INET...
Connecting to server a92.l1086917572.c10869.g.lm.akamaistream.net[64.86.71.157]: 1755...
Connected


MPlayer interrupted by signal 13 in module: open_stream
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.
 
Old 04-04-2008, 12:21 PM   #96
ilikerobots
LQ Newbie
 
Registered: Apr 2008
Posts: 17

Rep: Reputation: 0
Quote:
Originally Posted by cwatson View Post
So I wrote a greasemonkey script to fix the gameday audio to work.
Works great with the audio. Thanks! Reminder to others to remember adblock has to be off on that page for this script to work.
 
Old 04-04-2008, 05:13 PM   #97
mr_e_uss
LQ Newbie
 
Registered: Apr 2008
Posts: 20

Rep: Reputation: 0
Quote:
Originally Posted by daftcat View Post
Hi!

You might want to single quote the url but it looks like it still handled it alright. So that's probably not your problem. The next thing I'd try is installing the w32codecs package. If it installs in /usr/lib/win32, mplayer should pick it up automatically. If that works for you, let me know and I'll update the mini-howto. If you fix the problem through whatever means, let me know and I'll update it.

Thanks,
Matthew
Thanks Matt. I already had the w32codecs installed, so (unfortunately) it must be something else. Also, I tried using single quotes instead of double quotes -- but that didn't help either. I'll keep poking away at it.

Thanks.
 
Old 04-04-2008, 07:01 PM   #98
krock923
Member
 
Registered: Jul 2004
Posts: 171

Rep: Reputation: 30
Hey thanks for that info, jkr. My perl is actually pretty good. If you can't find anyone else to do it, I'd help out.
 
Old 04-04-2008, 07:29 PM   #99
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
Okay, folks, as I promised, I've whipped up a little program to let you access games. It parses the day's schedule (just the current day for now), pulls down the active and archived games, and gives you a curses interface in the terminal. Just select a game and it will play in your preferred player. Controls are up and down arrows, return to play, and r to refresh the list.

EDIT: I've changed the URL on this to old version

http://www.columbia.edu/~jr2075/mlbviewer_old.py

EDIT: The below no longer applies to the new version. That is available at
post #171 in this thread.

A few notes (please read!):

1. This requires a few python libraries you might not have. Notably: ClientForm, ClientCookie, and simplejson. They're all in debian/ubuntu -- I imagine they shouldn't be hard to find in fedora-land either.

2. You need to make an authorization file in your $HOME, called .mlbtv. It should just have two lines:

user: me@myself.i
pass: mypassword

3. Players and speed (set for mplayer and 400) are configurable in the script. There are options there for vlc and higher speeds as well.

4. This is still *very* preliminary, but it works, so I wanted to share it. I haven't put a lot of thought into security yet, so if you're worried about how your password is travelling, you should take a closer look at it. I will be rewriting the networking parts soon with urllib2, I think, to get rid of external library dependencies, and then I'll pay a bit more attention. You are, of course, welcome to rewrite it yourself.

5. Did I mention it's preliminary? Nothing fails gracefully. I'll make the errors more meaningful in the future. In the meantime, if something fails and you want to pass it along, just make sure to note the line number.

6. Because it's very preliminary, I wanted to give it to the baseball fans here to play around with and offer suggestions on, but I'd prefer if you didn't send it around all that much right now. If you make improvements, feel free to send those out, or back to me, but I don't want to be responsible for a wide circle of folks having to deal with any problems that might come out of this.

Anyway, enjoy, and feel free to send any suggestions or improvements along. I'll try to get some improvements in during the next couple of weeks, as time permits.

Last edited by jkr; 04-09-2008 at 10:26 AM.
 
Old 04-04-2008, 09:35 PM   #100
squigoh
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Rep: Reputation: 0
jkr, thank you, thank you.

Installed your script and it worked without a hitch. Got my mlb.tv back before the free period of the television package runs out this Sunday
 
Old 04-04-2008, 11:33 PM   #101
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
Fantastic. Incredible. Superlative.

It works. I say again, it works. Now MLB.com can do whatever they want with the website and it doesn't matter, so long as the backend stuff stays the same. This is really, really great. Thanks jkr, you're a life saver. I can't wait to see if this can get integrated into MythTV.
 
Old 04-05-2008, 12:51 AM   #102
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
While waiting until someone smarter than me whips up a MythTV plugin, I've gone ahead and created a button in MythTV that will launch jkr's script.

I put mlbviewer.py in /usr/bin/ and modified it to play the 800k stream using mplayer with the '-fs' switch for fullscreen.

Then I modified /usr/share/mythtv/mainmenu.xml and inserted this:
Code:
   <button>
     <type>GAME</type>
     <text>Watch Baseball</text>
     <action>EXEC konsole -e /usr/bin/mlbviewer.py</action>
   </button>
Between the first and second entries. Now I have a "Watch Baseball" menu entry which will launch the script in a terminal, which in turn will launch mplayer fullscreen.

I use an RF keyboard with MythTV so those using a remote and lirc will have to see if you can navigate a terminal emulator with your remote. Also, you'll have to make sure you change it to use your installed terminal. If using GNOME, it would be 'gnome-terminal -x' instead of 'konsole -e'.
 
Old 04-05-2008, 02:07 AM   #103
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
Myth button looks cool. I'll try it out. Also, not to get anybody's hopes up, but I've been in touch with the developer of MythStream and sometime soon he's going to extend it to run python parsers. So when he does, I should be able to adapt this for mythstream without too much trouble. I'll let you all know when that happens.
 
Old 04-05-2008, 03:13 AM   #104
Hoth
LQ Newbie
 
Registered: Jan 2007
Location: Northern California
Distribution: Kubuntu 8.10
Posts: 26

Rep: Reputation: 15
I'm getting this curious mplayer output when running mlbviewer.py. It just continues scrolling through endless iterations of saying that it's playing until closed.

Tried VLC and got "Unable to open 'mms://a871.v108695.c10869.g.vm.akamaistream.net/7/871/10869/v0004/mlb.download.akamai.com/10869/2008/mlb_!/mlbam/2008/04/04/mlbtv_bostor_400k.wmv?auth=ca.atbVaPcdcybwd0dCcUcMbmd0aobzd5b7-bh9ZBc-bA-4fkugM8y-k8m4mflklekem8jck7mjkkjckejalel7kbmdmbljle'"

And when I do the python launch from an external xterm, the xterm shows this:
Code:
VLC media player 0.8.6c Janus
X Error: BadDevice, invalid or uninitialized input device 158
  Major opcode:  150
  Minor opcode:  3
  Resource id:  0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 158
  Major opcode:  150
  Minor opcode:  3
  Resource id:  0x0
Failed to open device
[00000286] access_mms access error: error while asking for file -1
[00000286] access_mms access error: error while asking for file -1
[00000286] access_mms access error: cannot connect to server
[00000286] access_mms access error: error: HTTP/1.0 401 Unauthorized
[00000283] main input error: no suitable access module for `mms://a871.v108695.c10869.g.vm.akamaistream.net/7/871/10869/v0004/mlb.download.akamai.com/10869/2008/mlb_!/mlbam/2008/04/04/mlbtv_bostor_400k.wmv?auth=ca.atbVaPcdcybwd0dCcUcMbmd0aobzd5b7-bh9ZBc-bA-4fkugM8y-k8m4mflklekem8jck7mjkkjckejalel7kbmdmbljle'
[00000278] main playlist: nothing to play
signal 2 received, terminating vlc - do it again in case it gets stuck
Some sort of authorization error it seems, but nothing like the authorization error I get when I use an incorrect password.

Last edited by Hoth; 04-05-2008 at 03:30 AM.
 
Old 04-05-2008, 09:01 AM   #105
jkr
Member
 
Registered: Apr 2008
Posts: 115

Rep: Reputation: 15
How strange. The url looks valid -- it has the authentication part in it. I just tried out that same game (Boston-at Toronto) and it worked fine. And you could clearly log in, or else you wouldn't have gotten the authorization code. Hmm... Do the urls you get through the firebug or workflow methods work for you?
 
  


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 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


All times are GMT -5. The time now is 01:45 AM.

Main Menu
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