LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MLB.TV in Linux (https://www.linuxquestions.org/questions/linux-software-2/mlb-tv-in-linux-432479/)

daftcat 04-14-2008 02:59 AM

jkr

Check your email. I uploaded code to my server.

Day finally rolled over to show tomorrow's games. I tried a few and got null url's as I expected. No concurrency errors all day.

Looking good.

jkr 04-14-2008 07:15 AM

Quote:

available[current_cursor][2] is the event_time, but it's a string. How can I convert this to a struct_time? Specifically, the hour is not zero-padded so I can't use strptime() on it. Should I regex it and zero pad it myself before calling strptime() or is there an easier way?

This question is specifically for the mlbrecord project. I would like to convert event_time and localtime to utc for games in the future and calculate the number of seconds I should sleep before beginning a recording.
Not an issue now. New code parses the time, and available presents a datetime.time object. I haven't added tzinfo to it, but I will soon. That object can then be converted based on the tz in the user's machine or, alternately, to an explicit setting (which might be necessary if the machine's time zone setting is screwed up, i.e. if the user set up the local time as UTC and just isn't converting).

jkr 04-14-2008 07:17 AM

Quote:

Check your email. I uploaded code to my server.
Great. I have a few questions, which it might be more efficient to discuss over email. But this is great.

Everyone else, look forward to an announcement this evening or tomorrow.

--Jesse

Theophile 04-14-2008 09:38 AM

Quote:

Originally Posted by jkr (Post 3120718)
Everyone else, look forward to an announcement this evening or tomorrow.

Oh, don't worry. I am!

Cogs 04-14-2008 11:36 AM

Quote:

Originally Posted by daftcat (Post 3120226)
As for cookie support, I'm thinking about creating a new cookie jar each time gamestream is instantiated, but I'll load cookies from the cookie files. There are several cookies that don't contain the discard flag but the session one does.

Hi guys, nice job with this project so far. I started working on getting mlbtv to work in Linux but you've made more progress that I did. I'm an experienced programmer but I don't know Python (yet). I wrote a Perl script a while back to play "Beat the Streak" on mlb.com and figured out how to get around the login issue. I create a cookie jar, ignore all discards, and save the cookies to a file in my home directory. I check if the cookies are valid by hitting enterworkflow.do and seeing if I get the login prompt. If you get the login prompt, you must login. Otherwise, your session is still valid.

Hope it helps. I've had dreams of making a MythTV plugin for mlbtv. Oh, and I'm a White Sox fan.

Code:

#!/usr/bin/perl
use LWP;
use HTTP::Cookies;
use Crypt::SSLeay;

#Login information
#------------------------------------------------------------------------------
$username=shift;
$password=shift;

#create a browser and load mlb cookies from
#------------------------------------------------------------------------------
my $browser = LWP::UserAgent->new;
$cookie_jar = HTTP::Cookies->new(
        file=>"$ENV{'HOME'}/.mlb.cookies",
        autosave=>1,
        ignore_discard=>1);
$cookie_jar->load;
$browser->cookie_jar($cookie_jar);

#If not already logged in, log in
#------------------------------------------------------------------------------
my $authenticateURL="https://secure.mlb.com/authenticate.do";
my $loginURL="https://secure.mlb.com/enterworkflow.do?flowId=registration.wizard&c_id=mlb";

my $response=$browser->get($loginURL);

if ($response->content=~/Login\ or\ Register/){
  print "Attempting to log in...";
  my $loginResponse=$browser->post($authenticateURL,
  [
    "login_reg"=>"Login",
    "uri"=>"\/account\/login_register.jsp",
    "registrationAction"=>"identify",
    "emailAddress"=>"$username",
    "password"=>"$password"
  ],
  );

  if ($loginResponse->content=~/Authentication\ Error/){
    print "authentication error!\n";
  }
  else{
    print "success!\n";
  }
}
else{
  print "Already logged in!\n";
}


daftcat 04-14-2008 11:46 AM

Quote:

Originally Posted by Cogs (Post 3120936)
Hi guys, nice job with this project so far. I started working on getting mlbtv to work in Linux but you've made more progress that I did. I'm an experienced programmer but I don't know Python (yet). I wrote a Perl script a while back to play "Beat the Streak" on mlb.com and figured out how to get around the login issue. I create a cookie jar, ignore all discards, and save the cookies to a file in my home directory. I check if the cookies are valid by hitting enterworkflow.do and seeing if I get the login prompt. If you get the login prompt, you must login. Otherwise, your session is still valid.

Hope it helps. I've had dreams of making a MythTV plugin for mlbtv. Oh, and I'm a White Sox fan.

That was how we used to do it. A lot of users were getting messages saying they had concurrent sessions and this would block them from being able to watch live games for an hour.

The new code which I wrote this weekend (and I hope it works because I'm just a sample size of one), hits the login page first to get the session key, then logs in against authenticate.do, saving whatever cookies we get from there, and then finally hits enterworkflow.do for the media url. After we've hit that page, we log out and save only the cookies that don't have discard to disk while clearing the jar of the rest.

I was able to open five live games at once yesterday (I ran out of live games or I would have gone for more) so it seems like I've got the problem licked.

daftcat 04-14-2008 11:47 AM

Oh, and my code doesn't work for White Sox fans. ;-)

Go Royals!

daftcat 04-14-2008 03:42 PM

It's been awfully quiet in here. Either people aren't using it anymore or they're not having problems with it.

Or they're sick of complaining about concurrent login issues. :-|

When live games start up again tonight, I'm going to see if I can top six concurrent games (which is what Mosaic supports.) My previous record was five because there weren't six live games when I tested.

For those of you annoyed with the "helpful" beta error message, that's going away in the next release. Hopefully, you'll never see what replaced it. ;-)

astram 04-14-2008 04:10 PM

Quote:

Originally Posted by daftcat (Post 3121176)
It's been awfully quiet in here. Either people aren't using it anymore or they're not having problems with it.

Or they're sick of complaining about concurrent login issues. :-|

When live games start up again tonight, I'm going to see if I can top six concurrent games (which is what Mosaic supports.) My previous record was five because there weren't six live games when I tested.

For those of you annoyed with the "helpful" beta error message, that's going away in the next release. Hopefully, you'll never see what replaced it. ;-)

i've been anonymously watching this thread, just registered an account to reply to you.

i haven't been able to get the script to work, have been running the april 11th version. once i select a game, i get the friendly message, "There was an error (I will be more helpful in the beta)". I emailed jkr about this, and he said it's probably the same problem you guys were running to.

Where can i find a more recent version?

jkr 04-14-2008 04:53 PM

The more recent version, with daftcat's great work and audio support, will be this evening or tomorrow.

I did respond to your email, though, suggesting you try out the debug version to get to the bottom of your problem. I never heard back. Did you try it, and if so, what did it tell you?

turf212 04-14-2008 05:30 PM

Kudos
 
Just wanted to give my thanks for the continued development of this. I had been getting very frustrated not being able to watch any games. Since I live in the UK TV coverage isnt the best and I certainly dont get to watch my team as much as I'd like.

Looking forward to the update when it comes out.

Now I just need to upgrade to the faster service.

daftcat 04-14-2008 05:56 PM

jkr

I checked out the trunk code earlier today and merged my changes into it locally. I sent you an email on what all I did and where to find the merged files. My merges should be ready for release now (except for a couple minor things I mention in the email) unless you want to hold off on release for audio. Personally, I'm a little nervous that we keep hitting the servers with a "python/urllib" User-Agent so I'd like to release my code without audio support tonight. You and I could test and review the audio code over the next day or two before we release that. Does that sound good?

daftcat 04-14-2008 06:07 PM

What's the syntax for multiple team blackout? My blackout teams are sf and oak, but if I try:

blackout=sf,oak
blackout=sf , oak
blackout=sf oak

None of these work for blacking out both teams. Of course, my new code would catch the blackout message, but sometimes it's nice just to be reminded that there are indeed two teams in the Bay Area. ;-)

daftcat 04-14-2008 06:10 PM

Quote:

Originally Posted by daftcat (Post 3121280)
What's the syntax for multiple team blackout? My blackout teams are sf and oak, but if I try:

blackout=sf,oak
blackout=sf , oak
blackout=sf oak

None of these work for blacking out both teams. Of course, my new code would catch the blackout message, but sometimes it's nice just to be reminded that there are indeed two teams in the Bay Area. ;-)

Ah, I need two blackout lines to get this to work.

blackout=sf
blackout=oak

dmandell 04-14-2008 06:17 PM

Quote:

Originally Posted by daftcat (Post 3121176)
It's been awfully quiet in here. Either people aren't using it anymore or they're not having problems with it.

I just wanted to say that I'm definitely keeping an eye on this, waiting for your release w/ audio support. The lack of chatter on my end isn't from lack of interest, believe me.

Thanks and keep up the amazing work,

d


All times are GMT -5. The time now is 05:54 AM.