Thewb.py

From MythTV Official Wiki
Revision as of 14:42, 10 May 2010 by Iamlindoro (Talk | contribs)

Jump to: navigation, search

Synopsis

The MythNetvision TheWB.com grabber (thewb.py) searches and creates treeviews of the http://www.thewb.comsite.
Treeview user customizations:

  • Disable the standard RSS feed [1]
  • Add specific iPlayer RSS feeds that become their own directory [2]
  • Control the maximum number of items that can be added to directories globally or for a single directory [3]
  • Alter the frequency that the user preference file show list is updated [4]

Country Restrictions

  • Videos can only be played in the US

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 "TheWB.com" 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 TheWB.com will contain all shows (e.g. "Angel"). Some of these shows are not necessarily the shows you want but have just been enabled to provide you something to view until you specify your preferences.

Customization

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

Adding specific RSS feeds

Initially ALL shows from TheWB.com have been enabled. You will likely want to disable a number of these shows. You can enable or disable any show by changing their "enabled" element to "true" or "false" respectively.

<showDirectories>
 <url enabled="true" name="The Adventures Of Brisco County, Jr.">the-adventures-of-brisco-county-jr</url>
 <url enabled="false" name="Angel">angel</url>
 ...
 <url enabled="false" name="What I Like About You">what-i-like-about-you</url>
 <url enabled="true" name="Wonder Woman">wonder-woman</url>
</showDirectories>

Disabling the standard RSS feed

You can disable the display of the standard RSS feed by changing the "enabled" attribute to "false". Here is an example of a disabled RSS feed:

<treeviewURLS globalmax="0">
   <url enabled="true">http://www.thewb.com/shows/feed/new/</url>
</treeviewURLS>

Controlling the number of items included in a RSS feed directory

Some of the RSS feeds return a large number of video/audio items. You can optionally control both the standard RSS feeds and show RSS feeds through two attributes:

  • "globalmax" - Limits the number of items included per RSS feed for all "treeviewURLS" or "showDirectories" RSS feeds. A value of zero (0) means there are no limits.
  • "max" - Limits the number of items included for an individual RSS feed. This value will override the "globalmax" setting. A value of zero (0) means there are no limits.

In this example any "showDirectories" without their own maximum setting will not exceed 25 items but the "Angle" feed will be specifically restricted to no more than 5 items:

<showDirectories globalmax="25">
   <url enabled="true" max="5" name="Angel">angel</url>
</showDirectories>

Alter show list refreshing

Your "thewb.xml" file will be refreshed every X number of days as specified in the "updateDuration" element. The default is every five days. You can alter that duration to any positive integer. If a show is added the show will be automatically enabled. Your already enabled shows will be preserved if it is still present on TheWB.com site.
Example of a "thewb.xml" file which is refreshed every 10 days.

<updateDuration>10</updateDuration>