• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8
Release TV Ontario (TVO) Video Addon
#61
(2019-05-16, 18:00)kodaksmith Wrote:
(2019-05-15, 19:18)a2343 Wrote: I was able to find my plugin.video.tvo/resources/lib on my Intel htpc
Because you are able to find the location for the plugin.video.tvo/resources/lib/scraper.py file, I have provided a replacement file to make it easier to install.

  -  scraper.py replacement file to be placed in plugin.video.tvo/resources/lib/ folder.
  
Hi there. Is scraper.py still available? I tried the above link but the page it lead me to was blank. If there is somewhere where it can be obtained it'd be much appreciated.
Reply
#62
> Is scraper.py still available?

It appears that the pastebin link is now empty.  Perhaps pastebin only keeps the link and data valid for a limited time.

Following is a copy of the updated resources/lib/scraper.py file inline:

NOTE: This post has been edited to remove content that is no longer valid.
Reply
#63
(2019-09-26, 17:27)kodaksmith Wrote: > Is scraper.py still available?

It appears that the pastebin link is now empty.  Perhaps pastebin only keeps the link and data valid for a limited time.

Following is a copy of the updated resources/lib/scraper.py file inline:

----- beginning of file ------# -*- coding: utf-8 -*-
# TV Ontario Kodi Video Addon
#
from t1mlib import t1mAddon
import json
import re
import os
import urllib
import xbmc
import xbmcplugin
import xbmcgui
import HTMLParser
import sys

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


class myAddon(t1mAddon):

  def getAddonMenu(self,url,ilist):
      azurl = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1'
      for a in azurl:
          name = a
          plot = ''
          url  = a
          infoList = {}
          infoList['mediatype'] = 'tvshow'
          ilist = self.addMenuItem(name,'GS', ilist, url, self.addonIcon, self.addonFanart, infoList, isFolder=True)
      return(ilist)

  def getAddonShows(self,url,ilist):
      html = self.getRequest("https://www.tvo.org/documentaries/browse/filters/%s#title" % url)
      a = re.compile('content-list__first">.+?(?=img)img src="([^"]+?)".+?views-field-title">\n\s*<a href="/programs/([^"]+?)"[^>]+?>\n\s*([^<]+?)\s*</a>.+?(?=field--item)field--item">(.+?)</div>(.+?(?=views-row))',re.DOTALL).findall(html)
      for thumb,url,name,plot,seriesDetail in a:
          if "View Series" in seriesDetail:
              infoList = {}
              infoList['mediatype'] = 'tvshow'
              ilist = self.addMenuItem(name,'GE', ilist, url, self.addonIcon, self.addonFanart, infoList, isFolder=True)
          else:
              url = 'https://www.tvo.org/video/documentaries/' + url
              fanart = thumb
              infoList = {}
              infoList['Title'] = h.unescape(name)
              infoList['Studio'] = 'TV Ontario'
              infoList['Plot'] = plot
              infoList['TVShowTitle'] = h.unescape(name)
              infoList['mediatype'] = 'episode'
              ilist = self.addMenuItem(name,'GV', ilist, url, thumb, fanart, infoList, isFolder=False)
      return(ilist)

  def getAddonEpisodes(self,url,ilist):
      self.defaultVidStream['width']  = 640
      self.defaultVidStream['height'] = 480
      html = self.getRequest('https://www.tvo.org/programs/%s' % url)
      vids = re.compile('content-list__first">.+?(?=href)href="([^"].+?)".+?(?=img)img.+?(?=src)src="([^"]+?)".+?(?=season-filter)season-filter">([^<].+?)<.+?views-field-field-summary.+?field-content">([^<].+?)<',re.DOTALL).findall(html)
      if vids == []:
          vids = re.compile('"og:url" content="(.+?)".+?content="(.+?)".+?content="(.+?)".+?".+?content="(.+?)"',re.DOTALL).search(html).groups()
          vids = [(vids[0],vids[2],vids[1],vids[3])]
      TVShowTitle = re.compile('class="views-field views-field-title"><span class="field-content"><a[^>]*data-season-filter="season-filter">(.+?)<', re.DOTALL).search(html).group(1)
      for (url, thumb, name, plot) in vids:
          if not url.startswith('http'):
              url = 'https://www.tvo.org' + url
          fanart = thumb
          infoList = {}
          infoList['Title'] = h.unescape(name)
          infoList['Studio'] = 'TV Ontario'
          infoList['Plot'] = h.unescape(plot)
          infoList['TVShowTitle'] = TVShowTitle
          infoList['mediatype'] = 'episode'
          ilist = self.addMenuItem(name,'GV', ilist, url, thumb, fanart, infoList, isFolder=False)
      return(ilist)


  def getAddonVideo(self,url):
      html = self.getRequest(url)
      vid = re.compile('data-video-id="(.+?)"',re.DOTALL).search(html).group(1)
      url = 'https://secure.brightcove.com/services/viewer/htmlFederated?&width=1280&height=720&flashID=BrightcoveExperience&bgcolor=%23FFFFFF&playerID=756015080001&playerKey=AQ~~,AAAABDk7A3E~,xYAUE9lVY9-LlLNVmcdybcRZ8v_nIl00&isVid=true&isUI=true&dynamicStreaming=true&%40videoPlayer='+vid+'&secureConnections=true&secureHTMLConnections=true'
      html = self.getRequest(url)
      m = re.compile('experienceJSON = (.+?)\};',re.DOTALL).search(html)
      a = json.loads(html[m.start(1):m.end(1)+1])
      b = a['data']['programmedContent']['videoPlayer']['mediaDTO']['IOSRenditions']
      u =''
      rate = 0
      suburl = a['data']['programmedContent']['videoPlayer']['mediaDTO'].get('captions')
      if suburl is not None:
          suburl = suburl[0].get('URL')
      for c in b:
          if c['encodingRate'] > rate:
              rate = c['encodingRate']
              u = c['defaultURL']
          b = a['data']['programmedContent']['videoPlayer']['mediaDTO']['renditions']
          for c in b:
              if c['encodingRate'] > rate:
                 rate = c['encodingRate']
                 u = c['defaultURL']
Reply
#64
(2019-09-26, 17:27)kodaksmith Wrote: > Is scraper.py still available?

It appears that the pastebin link is now empty.  Perhaps pastebin only keeps the link and data valid for a limited time.

Following is a copy of the updated resources/lib/scraper.py file inline:
 
Thanks very much!
Reply
#65
Nothing is opening for me, I'm getting the check the log error, just wondering if this addon is working for others.  Can some folks please confirm if the addon is still ok for them.

I replaced scraper.py a while back and it was working fine, tried to watch a few things yesterday and I get the alphabetical list but no programs will play.

Thanks
Reply
#66
(2019-10-14, 20:54)barney63 Wrote: Nothing is opening for me, I'm getting the check the log error, just wondering if this addon is working for others.  Can some folks please confirm if the addon is still ok for them.

I replaced scraper.py a while back and it was working fine, tried to watch a few things yesterday and I get the alphabetical list but no programs will play.

Thanks
I just noticed it's not working for me either. This listings are fine with the replaced scraper.py but like you I can't get anything to play.
Reply
#67
How to Patch TVO 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 TV Ontario 3.0.8 video add-on already installed on your Kodi computer.

NOTE: This post has been edited to remove content that is no longer valid.
Reply
#68
Back in business, working again, thanks a lot!
Reply
#69
It's working again on mine. Thank you!
Reply
#70
Would someone please be kind enough to fix this add-on? Once one gets by the A-Z initial menu, all goes to pot.
I am using Leia 18.5 fwiw.
Reply
#71
Working ok for me, did you replace the scraper.py file as in the above posts?
Reply
#72
(2019-12-29, 07:54)barney63 Wrote: Working ok for me, did you replace the scraper.py file as in the above posts?

No, I haven't, but I will. It would be nice if someone patched the add-on and added it to the repository, though. Thanks.
Reply
#73
(2019-12-30, 05:35)AntiPontifex Wrote:
(2019-12-29, 07:54)barney63 Wrote: Working ok for me, did you replace the scraper.py file as in the above posts?

No, I haven't, but I will. It would be nice if someone patched the add-on and added it to the repository, though. Thanks. 

I couldn't figure this out. Unless someone can refer me to a patched version, I'll just have to wait for an official update like everyone else.
Thanks, anyway.
Reply
#74
(2019-12-30, 05:55)AntiPontifex Wrote: I couldn't figure this out. Unless someone can refer me to a patched version, I'll just have to wait for an official update like everyone else.
Thanks, anyway.
It's not that hard and being able to do it will help you fix some other addons as the procedure is the same.  Are you using Windows?

You only need to know two things, how to save the scraper.py file and where to put it.  The first part is easy, the second part is too once you've done it the first time.
Reply
#75
A pull request has been issued for Version 3.0.9. The add-on should update with a few days.

[EDIT] I didn't see the patch given by a user above previously. Thank you for helping support TVO users. V3.0.9 differs in coding from the given patch, but I believe has the same functionality.
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8

Logout Mark Read Team Forum Stats Members Help
TV Ontario (TVO) Video Addon0