LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-01-2013, 11:51 PM   #4261
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86

Quote:
Originally Posted by chrisVV View Post
Thanks!

Looks like I am forgetting to set postseason with 'P' screen. I can fix that next chance I get to test it.

I think I'll change the option name to "international" for 2014. If it works right now, I'm not going to touch it.

If you are international and can catch a live postseason game, can you post a successful-1.xml and successful-2.xml (or email them to me at yahoo address in the README)? I would like to see if there are additional pieces of information I can key in on besides blackout.
 
Old 10-05-2013, 04:46 PM   #4262
charlie460
LQ Newbie
 
Registered: Aug 2011
Posts: 29

Rep: Reputation: Disabled
Anyone else having issues with MLBviewer crashing with a urllib 404 error when trying to watch TB/BOS today? (I am in France, no blackouts)

Code:
$ ./mlbviewer.py
Traceback (most recent call last):
  File "./mlbviewer.py", line 1047, in <module>
    curses.wrapper(mainloop, mycfg, mykeys)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "./mlbviewer.py", line 896, in mainloop
    mediaUrl = mediaStream.prepareMediaStreamer(mediaUrl)
  File "/home/charlie/mlb2013/MLBviewer/mlbMediaStream.py", line 419, in prepareMediaStreamer
    game_url = self.parseFmsCloudResponse(game_url)
  File "/home/charlie/mlb2013/MLBviewer/mlbMediaStream.py", line 396, in parseFmsCloudResponse
    handle = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
 
Old 10-06-2013, 01:22 AM   #4263
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Quote:
Originally Posted by charlie460 View Post
Anyone else having issues with MLBviewer crashing with a urllib 404 error when trying to watch TB/BOS today? (I am in France, no blackouts)

Code:
$ ./mlbviewer.py
Traceback (most recent call last):
  File "./mlbviewer.py", line 1047, in <module>
    curses.wrapper(mainloop, mycfg, mykeys)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "./mlbviewer.py", line 896, in mainloop
    mediaUrl = mediaStream.prepareMediaStreamer(mediaUrl)
  File "/home/charlie/mlb2013/MLBviewer/mlbMediaStream.py", line 419, in prepareMediaStreamer
    game_url = self.parseFmsCloudResponse(game_url)
  File "/home/charlie/mlb2013/MLBviewer/mlbMediaStream.py", line 396, in parseFmsCloudResponse
    handle = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
Looking at where it is in the code, that's pretty late in the program flow. Probably not my fault. Maybe. Can you email me your ~/.mlb/successful-1.xml and ~/.mlb/successful-2.xml files the next time that it happens? Those get overwritten every time so you'll have to save them somewhere else as soon as you get that error again. My email is in the README (grep yahoo README)

Normally, I would ask for the unsuccessful xml's but this is actually late in a successful request.

In the meantime, try the nexdef stream.
 
Old 10-06-2013, 05:53 AM   #4264
chrisVV
Member
 
Registered: Aug 2010
Posts: 548

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by charlie460 View Post
Anyone else having issues with MLBviewer crashing with a urllib 404 error when trying to watch TB/BOS today? (I am in France, no blackouts)
Yes I had the same but it later corrected itself by around the 5th inning. Nexdef using mlbviewer also was not working for a period (it hung rather than crashed). Curiously, the flash plugin was working, both with standard and nexdef streams. Maybe there have been changes to URLs, or maybe it was just a problem at the MLB.TV servers. Or maybe I needed to click through on flash once in the evening in order to satisfy it about something.
 
Old 10-06-2013, 11:56 PM   #4265
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Quote:
Originally Posted by chrisVV View Post
Yes I had the same but it later corrected itself by around the 5th inning. Nexdef using mlbviewer also was not working for a period (it hung rather than crashed). Curiously, the flash plugin was working, both with standard and nexdef streams. Maybe there have been changes to URLs, or maybe it was just a problem at the MLB.TV servers. Or maybe I needed to click through on flash once in the evening in order to satisfy it about something.
Looking at the code and the line number in the crash, locateMedia() returns a URL from the servers and that URL is then used in prepareMediaStreamer() (further down in parseFmsCloudResponse() where the error actually occurred) to get the final URL for mplayer. It is within the parseFmsCloudResponse() that the 404 occurred. And the URL used for that routine is the one that is specifically returned and unaltered by locateMedia() (and the one that appears in the url: section of the media response written to successful-2.xml.)

Put another way, locateMedia() is like consulting the operator for a phone number of a business/person you want to reach. parseFmsCloudResponse() is like letting the operator connect you to that number. There are no alterations in between one response and the next request. It could be that the operator returned the wrong number or it could be that the equipment at the final destination was having problems. But where that error is in the code is most likely something I have no control over and probably cannot fix.

However, bugs do happen (as do network issues.) So send me the ~/.mlb/successful-2.xml file the next time this error happens. Since this isn't a problem with looking up the media url, it doesn't get flagged in the unsuccessful.xml code.
 
Old 10-07-2013, 12:00 AM   #4266
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
That code is also difficult for me to test because I'm in the US and subject to blackouts. The US postseason code follows a similar path but returns different media URLs so it's not quite the same thing. At the very least, I can try to wrap those lines up in some error message but I'm still not sure I can do anything about that particular error itself.
 
Old 10-07-2013, 12:09 PM   #4267
charlie460
LQ Newbie
 
Registered: Aug 2011
Posts: 29

Rep: Reputation: Disabled
I'll pass that data along to you next time it happens, but as the previous poster said, it came back around the 5th inning and I haven't had any issues since.

Watching DET/OAK now in standard mode with no problems.
 
Old 10-08-2013, 03:54 AM   #4268
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
SVN revision 542: Various bug fixes

Bug fixes:

- WP/LP was appearing on wrong lines in master scoreboard because scores were being compared as string rather than integer.

- Added "Retrieving..." status to Postseason so it doesn't look like 'P' was ignored

- Added error message for Sunday's issue. Honestly not sure if there's anything else that can be done but at least it shouldn't crash now.
 
Old 10-28-2013, 03:40 AM   #4269
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
SVN revision 543: MLB Classic Games

A little treat in time for the off-season....

I have added mlbclassics.py for watching MLB Classics content from YouTube. The content comes from MLBClassics and ClassicMLB11 users from YouTube. If you know of other users with classic content, let me know and I'll see if they can be merged into mlbclassics.py.

You will need youtube-dl and python-gdata in order to watch content from mlbclassics.py. You won't need any MLB or YouTube credentials.

This is mostly experimental code that may (or may not) get improved upon over the offseason. Google API does a lot of the work for me so there's also little room for improvement. Mostly program flow and maybe content if I can find more user feeds.

Some of the content you will find on mlbclassics is classic All-Star, LCS, and World Series games, history making games, Monday Night Baseball (MNB), Game Of the Week (GOW) and classic episodes of This Week in Baseball (TWIB.)

There are also some Japanese broadcast content (mostly Ichiro, Nomo, Matsui, Dice-K.) So if you see some funny characters in your display, that's not a bug.

Finally, since most of the content is lower quality (lower bitrates), mlbclassics.py will use top_plays_player= (e.g. highlights player) from ~/.mlb/config first. If that's not present, it will use video_player=.
 
Old 10-28-2013, 06:39 PM   #4270
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Checked in a patch to filter out Japanese results. I'll likely add in a config file option to disable the filtering if people really want the Japanese results.

Also, I have discovered that GetYouTubeVideoFeed() is only returning 25 entries at a time. I have figured out to request the next 25. I have not yet decided how to make the changes. In other words, more classic content is coming soon.

EDIT: Found more classic content and I have overcome the 25 items per page problem. Some of the new MLB History lists are empty. Sorry. Can't do anything about that without pre-fetching the lists (which takes too long.) However, these lists are empty of YouTube as well so at least it's bug-for-bug compatible.

I am also now sorting the lists on title text. This is great for World Series where the year is the first word in the title. It is not so great for the lists where the year is part of a mm/dd/yy string. However, in due time, I can expand the individual item retrieval to search the title string and make a best guess on the year of the content. From there, I can sort the list on my homebrewed year tag.

I also have plans to add an 'i' key similar to 'z' key debug which will display all the information I can learn from the results including duration and video description.

Last edited by daftcat; 10-28-2013 at 07:53 PM.
 
Old 10-29-2013, 04:51 AM   #4271
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
SVN revision 552: Lots of improvements to mlbclassics

As you can tell by the revision numbers, lots of improvements went into mlbclassics today/tonight.

- The original UI showed playlists first, then the contents of the playlists. Lots of videos have been uploaded that are not classified into a playlist and so these were getting missed. Now the UI has an "All Uploads by..." playlist. These are also in bold to make it easier to find them among the playlists. There is a lot of content in these "All uploads..." lists that are not classified into playlists. For example, mlbclassic1122 has 66 videos alone that are not classified into any playlist other than the "All Uploads..." list.

- Both playlist summary (Menu) and the individual playlist screen have cursor counter in the status (e.g. "1 of 309") so you know how many playlists and entries in the playlists. Both screens also show the "author" (upload username).

- The individual playlist screen shows video duration in the status.

- Extra users have been added. We're now up to 790 videos from 6 users (MLBClassics, ClassicMLB11, classicmlb1122, TheMLBHistory, TheBaseballHall, and PhilliesClassics.) That is a lot of classic content! That should keep us busy over the off-season.

- classics_users= config file option has been added. You can add one user per classics_users= line but you can have multiple classics_users= lines in your config file. Use this option to add additional YouTube users with classic content. (To-do: create a classics_exclude_users= option to allow you to remove default content providers that don't interest you.)

I don't know about the rest of you, but I am really excited about having all this classic content at my finger tips and so much easier than using YouTube (no ads! and no annoying annotations!)

Also on the to-do list is to create some way to play an entire playlist (or start from the highlighted video) instead of just individual videos. That's about the only thing I miss from YouTube interface.
 
Old 11-02-2013, 07:24 PM   #4272
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
SVN revision 555: accept gzip encoding for most MLBviewer classes; some mlbclassics improvements

So I have a few improvements planned for the offseason.

The first improvement is to make http requests with "Accept-Encoding: gzip" to allow mlb.com to send us gzipped responses. I have implemented this for most of the classes in this revision. You probably won't see a difference but it's there. A typical mlbstats response is compressed from 38K to 8K. Even mlb.com may not notice the difference but it's good manners.

The next planned improvement is to implement "If-Modified-Since" request header. For most web requests, I'll populate this header with the "Last-Modified" header value from the last response we received. This allows mlb.com to respond with a 304 if the content hasn't been updated since the last request. Bandwidth savings for both client and server.

On the mlbclassics improvements, I implemented an 'i' key media information screen which lists title, author, duration, and description for a video.

I hope some of you have tried mlbclassics by now.
 
Old 11-02-2013, 11:01 PM   #4273
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
SVN revision 559: implemented http response caching, 304 handling

It interested me/bothered me enough to implement it today.

For each http request made through MLBHttp.getUrl() method (same method used for accept-encoding: gzip), the last-modified header from the response and content of the response itself is stored in a cache (in memory only.) For the next request to a URL already in the cache, the "if-modified-since" header in the request is populated with the "last-modified" from the previous response. If the content hasn't changed, the server will respond with 304 and the cached response will be used. Now you can refresh line score, box score, master scoreboard, listings (checking for "archived" status) as often as you want. When the content changes, the server will give us new content. Otherwise, cached content will be used.
 
Old 11-04-2013, 12:58 PM   #4274
larshenric
Member
 
Registered: Aug 2012
Location: Flensburg, Germany
Distribution: several
Posts: 90

Rep: Reputation: Disabled
Hi!

As the season went perfectly for me with mlbviewer (thanks so much again for all this project!!!) I didn't have to report here for a long time... :-)
Now I'm interested in this classic stuff, so I did this:

lars@X64V:~$ svn checkout svn://svn.code.sf.net/p/mlbviewer/code/trunk mlbviewer2013
A mlbviewer2013/test
A mlbviewer2013/test/nexdef.py
A mlbviewer2013/test/nexdefdl.py
A mlbviewer2013/test/gdaudio.py
A mlbviewer2013/test/mediaxml.py
A mlbviewer2013/test/mlbgame.py
A mlbviewer2013/test/mlbgamedl.py
A mlbviewer2013/mlbstats.py
A mlbviewer2013/mlbviewer.py
A mlbviewer2013/REQUIREMENTS-2013.txt
A mlbviewer2013/MLBPLAY-HELP
A mlbviewer2013/mlbclassics.py
A mlbviewer2013/milblistings.py
A mlbviewer2013/mlbplay.py
A mlbviewer2013/MLBviewer
A mlbviewer2013/MLBviewer/LIRC.py
A mlbviewer2013/MLBviewer/mlbClassicsPlistWin.py
A mlbviewer2013/MLBviewer/mlbPostseason.py
A mlbviewer2013/MLBviewer/mlbStats.py
A mlbviewer2013/MLBviewer/mlbMasterScoreboard.py
A mlbviewer2013/MLBviewer/__init__.py
A mlbviewer2013/MLBviewer/mlbClassics.py
A mlbviewer2013/MLBviewer/milbSchedule.py
A mlbviewer2013/MLBviewer/mlbConfig.py
A mlbviewer2013/MLBviewer/mlbDailyMenuWin.py
A mlbviewer2013/MLBviewer/mlbClassicsMenuWin.py
A mlbviewer2013/MLBviewer/mlbDailyVideoWin.py
A mlbviewer2013/MLBviewer/mlbDefaultKeyBindings.py
A mlbviewer2013/MLBviewer/mlbDailyVideos.py
A mlbviewer2013/MLBviewer/mlbConstants.py
A mlbviewer2013/MLBviewer/mlbStatsWin.py
A mlbviewer2013/MLBviewer/mlbProcess.py
A mlbviewer2013/MLBviewer/mlbHttp.py
A mlbviewer2013/MLBviewer/mlbTopWin.py
A mlbviewer2013/MLBviewer/mlbLog.py
A mlbviewer2013/MLBviewer/mlbBoxScore.py
A mlbviewer2013/MLBviewer/mlbStatsKeyBindings.py
A mlbviewer2013/MLBviewer/mlbStatsHelpWin.py
A mlbviewer2013/MLBviewer/mlbRssWin.py
A mlbviewer2013/MLBviewer/mlbOptionWin.py
A mlbviewer2013/MLBviewer/mlbListWin.py
A mlbviewer2013/MLBviewer/mlbStandings.py
A mlbviewer2013/MLBviewer/mlbMediaStream.py
A mlbviewer2013/MLBviewer/mlbSchedule.py
A mlbviewer2013/MLBviewer/mlbInningWin.py
A mlbviewer2013/MLBviewer/mlbLineScoreWin.py
A mlbviewer2013/MLBviewer/mlbBoxScoreWin.py
A mlbviewer2013/MLBviewer/milbMediaStream.py
A mlbviewer2013/MLBviewer/mlbKeyBindings.py
A mlbviewer2013/MLBviewer/mlbHelpWin.py
A mlbviewer2013/MLBviewer/mlbLogin.py
A mlbviewer2013/MLBviewer/mlbStandingsWin.py
A mlbviewer2013/MLBviewer/mlbMasterScoreboardWin.py
A mlbviewer2013/MLBviewer/mlbDailyStream.py
A mlbviewer2013/MLBviewer/mlbClassicsStream.py
A mlbviewer2013/MLBviewer/milbLogin.py
A mlbviewer2013/MLBviewer/mlbLineScore.py
A mlbviewer2013/MLBviewer/mlbError.py
A mlbviewer2013/README
A mlbviewer2013/LICENSE.txt
A mlbviewer2013/TOOLS
A mlbviewer2013/milbplay.py
A mlbviewer2013/INSTALL
A mlbviewer2013/QUICK-START
A mlbviewer2013/MiLB-HELP
A mlbviewer2013/mlbvideos.py
A mlbviewer2013/mlblistings.py
Ausgecheckt, Revision 560.
lars@X64V:~$ cd mlbviewer2013
lars@X64V:~/mlbviewer2013$ python mlbviewer.py
Missing dependency: python-gdata required for mlbclassics
lars@X64V:~/mlbviewer2013$

What do I have to do now...? ;-)
Greetings from Germany! :-)
 
Old 11-04-2013, 11:42 PM   #4275
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Hi Germany!

You'll need python-gdata and youtube-dl for mlbclassics.py.

Try these first:

Code:
sudo apt-get install python-gdata
sudo apt-get install youtube-dl
If those don't work, you can download them from here:

 
  


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