You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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.

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.

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.

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.

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.

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

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.

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.

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.

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.

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$