• 1
  • 2
  • 3(current)
  • 4
  • 5
  • 9
[Release] CBC.ca News
#31
This add-on stopped working last week on my FireTV Stick 4k running Kodi 18.2. When running the add-on, it says "CBC.ca News Error: Check the log for more information"

When using the Kodi Log Viewer add-on, i found the following script error:

T:10904 Error GetDirectory Error Getting plugin://plugin.video.cbcnews/?mode=GS%url=%2fplayer%2fnews%2fLive

Any help would be much appreciated.
Reply
#32
I am also getting some new errors with CBC News. I wonder if CBC has changed something with their streams.... I ran into some issues a couple weeks ago with their audio streams for CBC Radio breaking.

I've included a snip from my log file in case it proves useful for anyone.  FWIW this is a great plugin which I use very often, I appreciate all the work that has gone in to it.

Cheers!

2019-10-07 19:29:04.530 T:1901613920 ERROR: Control 55 in window 10025 has been asked to focus, but it can't
2019-10-07 19:29:06.034 T:1140847328 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/home/pi/.kodi/addons/plugin.video.cbcnews/default.py", line 12, in <module>
ma.processAddonEvent()
File "/home/pi/.kodi/addons/script.module.t1mlib/lib/t1mlib.py", line 231, in processAddonEvent
if mode== None: self.procDir(self.getAddonMenu, p('url'), 'files', 'default_view')
File "/home/pi/.kodi/addons/script.module.t1mlib/lib/t1mlib.py", line 156, in procDir
ilist = dirFunc(url, ilist)
File "/home/pi/.kodi/addons/plugin.video.cbcnews/resources/lib/scraper.py", line 24, in getAddonMenu
html = re.compile('<section class="section-cats full">(.+?)</section', re.DOTALL).search(html).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
-->End of Python script error report<--
2019-10-07 19:29:06.234 T:1117774560 ERROR: GetDirectory - Error getting plugin://plugin.video.cbcnews/
2019-10-07 19:29:06.238 T:1901613920 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.cbcnews/) failed
Reply
#33
Bump.. Stopped working for me as well
Reply
#34
Me too 🙁
Reply
#35
How to Patch CBC News Add-on:

NOTE:  This post has been edited to remove content that is no longer valid.
Reply
#36
(2019-10-22, 23:35)kodaksmith Wrote: I tried the patch. the addon is now working except there's no news video subsections now.

ie I used to use this to watch the daily evening news show here in Nova Scotia. No sections anymore for the different cbc news broadcasts in the provinces.

Any chance this can be fixed ?



How to Patch CBC News Add-on:

NOTE: This patch enables playing videos, but does not support closed captions. If someone knows how to add closed caption support please feel free to do so.

The following steps assume that you have the CBC News 3.0.2 video add-on already installed on your Kodi computer.
 
  1. Create a replacement plugin.video.cbcnews/resources/lib/scraper.py file using the file contents listed lower in this post.

    For example, open a text editor, copy the scraper.py file contents listed below (hover mouse over code and click the pop-up Copy button), paste into text editor, save the file with name scraper.py, and exit the text editor.

  2. Determine the location of the Kodi addons folder where plugin.video.cbcnews is installed on your Kodi computer.

    For example:
     
    • /storage/.kodi/addons/plugin.video.cbcnews/ for LibreELEC on Raspberry Pi.
    • ~/.kodi/addons/plugin.video.cbcnews/ for Kodi on Ubuntu where ~ is your home directory.

    Note that the location of the addons folder should be similar to the userdata folder.

  3. Copy the new scraper.py file over top of the existing plugin.video.cbcnews/resources/lib/scraper.py file.

    For example on a Raspberry Pi with LibreELEC 8.2.5 installed I used the following command:

    scp -p scraper.py [email protected]:/storage/.kodi/addons/plugin.video.cbcnews/resources/lib/

    Note that you would need to substitute the IP address for your Raspberry Pi (see System -> System Info).

'Hope that helps. :-)

----- Beginning of file -----
python:

# -*- coding: utf-8 -*-
# KodiAddon (CBC News)
#
from t1mlib import t1mAddon
import json
import re
import urllib
import urllib2
import xbmcplugin
import xbmcgui
import HTMLParser
import sys
import xbmc

h = HTMLParser.HTMLParser()
uqp = urllib.unquote_plus
UTF8 = 'utf-8'

class myAddon(t1mAddon):


 def getAddonMenu(self,url,ilist):
   html  = self.getRequest('http://www.cbc.ca/player/news')
   html = re.compile('<div class="section-nav" role="navigation">(.+?)</div', re.DOTALL).search(html).group(1)
   shows = re.compile('<option value="(.+?)">(.+?)<', re.DOTALL).findall(html)
   shows.append(('/news/TV%20Shows/The%20National/Latest%20Broadcast ', 'The National / Latest Broadcast'))
   for url, name in shows:
      if name != 'Home':
         infoList = {}
         infoList['mediatype'] = 'tvshow'
         infoList['Title'] = name
         infoList['TVShowTitle'] = name
         ilist = self.addMenuItem(name, 'GS', ilist, url, self.addonIcon, self.addonFanart, infoList, isFolder=True)
   return(ilist)

 def getAddonShows(self,url,ilist):
   self.defaultVidStream['width']  = 1280
   self.defaultVidStream['height'] = 720
   html  = self.getRequest('http://www.cbc.ca/player%s' % url)
   if url.find('Latest%20Broadcast') > 0:
      cat = 'Latest Broadcast'
   else:
      cat = url.replace('/','').capitalize()  # E.g., "/news" --> "News"
   jdata = re.compile('window.__PRELOADED_STATE__ = (.+?)\s+?</script>', re.DOTALL).search(html).group(1)
   a = json.loads(jdata)
   # Locate exact category name
   for b in a['categoryClips']:
       if re.search(cat+"$", b):  # category must be at end of string
          idxcat = b
   for b in a['categoryClips'][idxcat]:
      name = b['title'].replace(u"\u2018", "'").replace(u"\u2019", "'").encode('ascii', 'xmlcharrefreplace')
      plot = b['description'].replace(u"\u2018", "'").replace(u"\u2019", "'").encode('ascii', 'xmlcharrefreplace')
      vurl = b['assetDescriptors'][0]['key']
      thumb = b['thumbnail']
      fanart = thumb
      infoList = {}
      infoList['mediatype'] = 'tvshow'
      infoList['Title'] = name
      infoList['TVShowTitle'] = name
      infoList['Plot'] = plot
      infoList['Duration'] = b['duration']
      ilist = self.addMenuItem(name, 'GV', ilist, vurl, thumb, fanart, infoList, isFolder=False)
   return(ilist)

 def getAddonVideo(self,url):
      u = url.split('/meta.smil',1)[0]
      u = u + '?mbr=true&manifest=m3u&feed=Player%20Selector%20-%20Prod'
      #html = self.getRequest(u)
      #xbmc.log("html: "+html, xbmc.LOGNOTICE)
      #u = re.compile('RESOLUTION=1280x720.+?\n(http.+?)\?', re.DOTALL).search(html).group(1)
      #if u is None:
      #     return
      #xbmc.log("  u2: "+u, xbmc.LOGNOTICE)
      liz = xbmcgui.ListItem(path = u.strip())
      xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)


----- End of file ----- 
Reply
#37
@Tybie can you find the missing sections on the CBC web site?  If so let me know where these are and I might be able to include these.

I had never used the add-on previously so I don't know what it looked like before it stopped working.
Reply
#38
(2019-10-24, 00:55)kodaksmith Wrote: @Tybie can you find the missing sections on the CBC web site?  If so let me know where these are and I might be able to include these.

I had never used the add-on previously so I don't know what it looked like before it stopped working.

Thanks for looking at this!
I think after the first section is selected (eg News), another set of folders should be shown (eg Canada, World)
And then if you select Canada, another set of folders should be shown (eg Calgary, BC, Manitoba)
And then if you select Calgary, the videos should be shown\filtered for Calgary only
Reply
#39
The add-on is parsing the website now, but when i try to play a file i get:

2019-10-27 11:07:26.229 T:17960  NOTICE: VideoPlayer::OpenFile: plugin://plugin.video.cbcnews/?mode=GV&url=https%3A%2F%2Flink.theplatform.com%2Fs%2FExhSPC%2Fmedia%2Fguid%2F2655402169%2F1631021123943%2Fmeta.smil%3Ffeed%3DPlayer%2520Selector%2520-%2520Prod%26format%3Dsmil%26mbr%3Dtrue%26manifest%3Dm3u
2019-10-27 11:07:26.761 T:17960   ERROR: CCurlFile::Stat - Failed: HTTP response code said error(22) for https://link.theplatform.com/s/ExhSPC/me...eed=Player Selector - Prod
2019-10-27 11:07:26.761 T:5956  NOTICE: Creating InputStream
2019-10-27 11:07:26.999 T:5956   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 400
2019-10-27 11:07:26.999 T:5956   ERROR: CCurlFile::Open failed with code 400 for https://link.theplatform.com/s/ExhSPC/me...eed=Player Selector - Prod:
2019-10-27 11:07:27.129 T:5956   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 400
2019-10-27 11:07:27.129 T:5956   ERROR: CCurlFile::Open failed with code 400 for https://link.theplatform.com/s/ExhSPC/me...eed=Player Selector - Prod:
2019-10-27 11:07:27.129 T:5956   ERROR: XFILE::CFileCache::Open - failed to open source <https://link.theplatform.com/s/ExhSPC/media/guid/2655402169/1631021123943?mbr=true&manifest=m3u&feed=Player Selector - Prod>
2019-10-27 11:07:27.129 T:5956   ERROR: CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.cbcnews/?mode=GV&url=https%3A%2F%2Flink.theplatform.com%2Fs%2FExhSPC%2Fmedia%2Fguid%2F2655402169%2F1631021123943%2Fmeta.smil%3Ffeed%3DPlayer%2520Selector%2520-%2520Prod%26format%3Dsmil%26mbr%3Dtrue%26manifest%3Dm3u]
2019-10-27 11:07:27.129 T:5956  NOTICE: CVideoPlayer::OnExit()
2019-10-27 11:07:27.182 T:17960  NOTICE: CVideoPlayer::CloseFile()
2019-10-27 11:07:27.182 T:17960  NOTICE: VideoPlayer: waiting for threads to exit
2019-10-27 11:07:27.182 T:17960  NOTICE: VideoPlayer: finished waiting

Any ideas?
Reply
#40
Thanks for the navigation suggestions @maddskillz20.

NOTE:  This post has been edited to remove content that is no longer valid.
Reply
#41
Great work.. that looks better
.. but still having a problem playing the videos.. they won't start (Windows 10)
Reply
#42
(2019-10-27, 23:45)maddskillz20 Wrote: Great work.. that looks better
.. but still having a problem playing the videos.. they won't start (Windows 10)
Figured it out.. there's some extra spaces that need to be URL Encoded
Line 85 should be: u = u + '?mbr=true&manifest=m3u&feed=Player%20Selector%20-%20Prod'
Reply
#43
(2019-10-28, 00:38)maddskillz20 Wrote:
(2019-10-27, 23:45)maddskillz20 Wrote: Great work.. that looks better
.. but still having a problem playing the videos.. they won't start (Windows 10)
Figured it out.. there's some extra spaces that need to be URL Encoded
Line 85 should be: u = u + '?mbr=true&manifest=m3u&feed=Player%20Selector%20-%20Prod'  

Note that there are more URL encoded spaces in the source code section.  For some reason the forum software does not display the raw percent-two-zero (%20) values.  That is why I added the important note to use the COPY button that will pop up when the mouse pointer is hovered over the code.
Reply
#44
(2019-10-28, 17:30)kodaksmith Wrote: Note that there are more URL encoded spaces in the source code section.  For some reason the forum software does not display the raw percent-two-zero (%20) values.  That is why I added the important note to use the COPY button that will pop up when the mouse pointer is hovered over the code.
Thanks for reiterating that point.  Even though you clearly say that in your instructions, I was missing it (and not doing it).  Also on my laptop the copy button (in the top right corner of the post) is small and sometimes difficult to see, but once I figured it out, all became clear. 
Image
I am going to go back and redo some other patches to see if I was missing anything.  Thanks.  BTW addon works great!
Reply
#45
This patch adds four news shows:  Marketplace, Power & Politics, The Fifth Estate, and The Weekly.  Also added is support for closed captions in .srt format although there are extremely few episodes with these captions included.

NOTE:  This post has been edited to remove content that is no longer valid.
Reply
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 9

Logout Mark Read Team Forum Stats Members Help
[Release] CBC.ca News0