2016-03-06, 01:12
(2016-03-05, 22:46)Evers Wrote: Thanks for the addon, I enjoy it very much.
Would it be possible to add links for the content at this page http://www.cbc.ca/player/news/Canada/NL/...0Broadcast and this one http://www.cbc.ca/player/news/Canada/NL/...0Broadcast ?
They're the latest broadcasts of local news from Newfoundland.
The urls are constantly changing and custom requests are never ending, so I don't want to put this in the supported version.
You can do it yourself very easily:
in default.py find the following:
Code:
def getAddonMenu(self,url,ilist):
infoList = {}
html = self.getRequest('http://www.cbc.ca/player/tv')
html = re.compile('<section class="section-cats full">(.+?)</section>', re.DOTALL).search(html).group(1)
shows = re.compile('<a href="(.+?)">(.+?)</a>', re.DOTALL).findall(html)
shows.append(('/player/news','News'))
shows.append(('/player/Sports','Sports'))
shows.append(('/player/news/TV%20Shows/The%20National/Latest%20Broadcast','The National - Latest Broadcast'))
Just add the following line immediately after the above - making sure you align the line indentation with the one above.
Code:
shows.append(('/player/news/Canada/NL/Here%20and%20Now%20Late%20Night/Latest%20Broadcast','Here and Now Late Night - Latest Broadcast'))
and any other urls (note it starts at /player/) and titles that ypou want in teh same fashion. Save the file and re-run the addon. It should display the new shows you added and clicking will display the latest videos.
Your final code should look like:
Code:
def getAddonMenu(self,url,ilist):
infoList = {}
html = self.getRequest('http://www.cbc.ca/player/tv')
html = re.compile('<section class="section-cats full">(.+?)</section>', re.DOTALL).search(html).group(1)
shows = re.compile('<a href="(.+?)">(.+?)</a>', re.DOTALL).findall(html)
shows.append(('/player/news','News'))
shows.append(('/player/Sports','Sports'))
shows.append(('/player/news/TV%20Shows/The%20National/Latest%20Broadcast','The National - Latest Broadcast'))
shows.append(('/player/news/Canada/NL/Here%20and%20Now%20Late%20Night/Latest%20Broadcast','Here and Now Late Night - Latest Broadcast'))