Anithest / bluecop-xbmc-repo

Automatically exported from code.google.com/p/bluecop-xbmc-repo
0 stars 0 forks source link

Patch for trunk/plugin.video.free.cable/resources/lib/cbs.py #211

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
CBS has added a non-javascript Grammy menu item without element 'onclick'. This 
causes Python to generate an exception because a non-existing element "onclick' 
is attempting to be accessed. Since CBS self describes the Grammy 
non-javascript element as a hack and since Grammy programs are available under 
Specials anyway, let's skip all non-javascript menu items.

CBS has an incorrect link to the Late Late show with Jimmy Fallon. As as 
result, we need to add this show to the list of special cases where we need to 
provide the url.

---  trunk/plugin.video.free.cable/resources/lib/cbs.py
+++  trunk/plugin.video.free.cable/resources/lib/cbs.py
@@ -60,9 +60,10 @@
     menu=tree.find(attrs={'id' : 'daypart_nav'})
     categories=menu.findAll('a')
     for item in categories:
-        catid = item['onclick'].replace("showDaypart('",'').replace("');",'')
-        name = catid.title()
-        common.addDirectory(name, 'cbs', 'shows', catid)
+        if item['href'].find('javascript') == 0:
+           catid = 
item['onclick'].replace("showDaypart('",'').replace("');",'')
+           name = catid.title()
+           common.addDirectory(name, 'cbs', 'shows', catid)
     common.setView('seasons')

 def shows(catid = common.args.url):
@@ -84,6 +85,8 @@
                     url = url.replace('daytime/lets_make_a_deal','shows/lets_make_a_deal')
                 elif 'cbs_evening_news/video/' in url:
                     url = 'http://www.cbs.com/shows/cbs_evening_news/video/'
+                elif 'late_night/late_late_show/video/' in url:
+                    url = 'http://www.cbs.com/shows/late_late_show/video/'
                 elif 'shows/dogs_in_the_city/' in url:
                     url+='video/'
                 elif '/shows/partners/' in url:

Original issue reported on code.google.com by vernon...@gmail.com on 10 Feb 2013 at 2:36

GoogleCodeExporter commented 8 years ago
Meant to say late late show with Craig Ferguson not Jimmy Fallon. Sorry

Original comment by vernon...@gmail.com on 10 Feb 2013 at 5:54