Thursday, September 19, 2013

XBMC Free Cable CBS

As I've mentioned earlier, I like XBMC and the Free Cable plugin,
but it looks like the CBS python script is in a bad place right now.

It's the inevitable future of all HTML scraping code, to be broken.

Attempting to navigate to the CBS channel has a script error with:

File "...\XBMC\addons\\resources\lib\", line 66, in rootlist
AttributeError: 'NoneType' object has no attribute 'findAll'
The CBS script is looking for a specific element id (daypart_nav) for the menu to build the directory listing options using the 'a' elements under it.

But the page now redirects to with a completely different layout.
So none of the expected elements are found and thus errors.

I looked back in the Wayback Machine archive, to see the original HTML matching the current script (from a month ago).
Since the page has completely changed, the CBS script seems like it needs a major rewrite.

Fall TV shows are starting up soon, so I spent a little time trying to get it working.
So far I did some HTML tree traversal hacking in the python script and got the initial menus.

Listings of episodes are now working in this version of the script:

UPDATE 9/20:
Apparently I've missed the latest updates on the forum here.
The Free Cable scripts including are being maintained and I was able to update to another working version.
At, I grabbed, under the link for repository.xbmcplus.xbmc-plugins.
Then I just needed to Install from Zip under System - Add-ons, and then update Free Cable (replacing older).

This version includes a loading dialog instead of just hanging while loading the episode list.
But what I don't like is the episode list itself.
For one of the newer CBS shows, I see all episodes listed even though most are not able to play. This same Full Episodes list contains clips (I removed these by checking type and duration starting with 0).
And the display names include 0x0 (I avoided adding if either is 0). Which is partly a problem of where the data is coming from (not from the JSON, but from page parsing). CBS removes videos from being playable (now only through third parties) and their urls redirect back to the show's homepage. Ideally the page parsing would determine if the video is actually playable before adding to listing.

UPDATE Mar 29 2014:
Free Cable is gone, as mentioned on the Free Cable forum, it is now the USTV VoD plugin. Go grab it.

UPDATE Sept 9 2014:
I was using an old version of the xbmcplus addon repository, causing USTV VoD plugin to not be updating (stuck at version 1.0.2).
To fix VoD, I upgraded to the latest xbmcplus repo version from here: