Pbs.py

From MythTV Official Wiki
Revision as of 15:27, 28 April 2011 by Comocom (talk | contribs) (Synopsis)

Jump to: navigation, search

Synopsis

The MythNetvision PBS grabber (pbs.py) supports a search and creates treeviews of videos from various PBS media sources (e.g. NOVA).
Treeview user customizations:

  • speed up slow computer
  • Enable/Disable shows [1]
  • Control the maximum number of items that can be added to directories globally or for a single subdirectory [2]
  • Alter the frequency that the user preference file show list is updated [3]

Country Restrictions

  • Some Videos can only be viewed in the US. Older show episodes tend to have no restrictions. Enough of the videos are viewable in any country for this grabber to be valuable out side of the US.

Special Notes

  • The PBS Flash configuration has a bug which is sometimes triggered when you try to use the control bar. The video will freeze but the audio will continue. This bug happens on the PBS Web site and it is not a Netvision or MythBrowser issue. Simply put do not use the Flash control bar and all will be well.

Search

The PBS search restricts its scope to the items in the PBS treeview. If you do not subscribe to the PBS Treeview you will not see this search when subscribing. There are a large number of items returned in the PBS treeview so this search makes finding videos on a specific PBS topic convenient. Unfortunately PBS's own Web page search is very poor so assuming you have not disabled a large number of the PBS sources then this alternative search yields far better results.

Treeview Customization Instructions

Initialization steps

  1. You need to enable this treeview from the Media Library menu, select the Browse Internet Video menu option and press MENU (M). Select Scan/Manage Subscriptions, then Manage Site Subscriptions. Now subscribe to the "PBS" grabber.
  2. You will need to download the treeview. To do so, select MENU (M). Select Scan/Manage Subscriptions, then Update Site Maps. The update process can take several minutes. Once this is complete the PBS will contain a subdirectory for each available PBS show (e.g "Nature"). These are not necessarily the shows you want but have been enabled to provide you something to view until you specify your preferences.

Customization

Important.png Note: Customization of this grabber is entirely optional. You only need to customize the grabber if you wish to change which items appear in the tree.

When you updated the treeview in Initialization step #2 a user configuration file was created at:
"~/.mythtv/MythNetvision/userGrabberPrefs/pbs.xml". To customize the Treeview open the "pbs.xml" file with a text editor and make changes according to the instructions below. After you have made your changes and saved the "pbs.xml" file, update your subscriptions again (Initialization step #2).

Enable/Disable shows

The shows are split into subdirectories which represent the PBS shows.

To enable a show you must change a "sourceURL" element's "enabled" attribute to 'true'. When you change the attribute to 'true' that source will be added to the PBS tree view. Of course you can disable any subdirectory by changing its 'sourceURL' element's 'enabled' attribute to 'false'.

When the PBS Tree view is created it will have links to the Flash videos which will playback in a full browser window.

In this example the "American Experience" shows is enabled while the "American Masters" show is disabled.

 <subDirectory name="American Experience">
   <sourceURL enabled="true" name="American Experience" type="xml" xsltFile="pbsRSS_item" url="http://video.pbs.org/program/979359091/rss/"/>
 </subDirectory>
 <subDirectory name="American Masters">
   <sourceURL enabled="false" name="American Masters" type="xml" xsltFile="pbsRSS_item" url="http://video.pbs.org/program/1009784659/rss/"/>
 </subDirectory>

Controlling the number of items included in a subdirectory

You can optionally control the number of items added to a subdirectory through two attributes:

  • "globalmax" - Limits the number of items included for all subdirectories. A value of zero (0) means there are no limits.
  • "max" - Limits the number of items included for an individual subdirectory. This value will override the "globalmax" setting. A value of zero (0) means there are no limits.

In this example any "subDirectory" without their own maximum setting will not exceed 25 items but the "Blueprint America" sub-directory will be specifically restricted to no more than 5 items:

<directory name="PBS" globalmax="25">
 <subDirectory name="Bill Moyers">
   <sourceURL enabled="true" name="Bill Moyers" type="xml" xsltFile="pbsRSS_item" url="http://video.pbs.org/program/1113570149/rss/"/>
 </subDirectory>
 <subDirectory name="Blueprint America" max="5">
   <sourceURL enabled="true" name="Blueprint America" type="xml" xsltFile="pbsRSS_item" url="http://video.pbs.org/program/1113214386/rss/"/>
 </subDirectory>
<directory

Alter show list refreshing

Your "pbs.xml" file will be refreshed every X number of days as specified in the "updateDuration" element. The default is every three days. You can alter that duration to any positive integer. If a show is added the show will be automatically enabled. Your personal settings will be preserved if the show is still present on PBS site.
Example of a "pbs.xml" file which is refreshed every 10 days.

<updateDuration>10</updateDuration>