Kodi Community Forum

Full Version: HGTV Canada Video Addon - Canada Only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
(2018-08-12, 06:59)hgtv Wrote: [ -> ]debugging latest 3.0.2 version, i find that the getAddonVideo() can be more direct now, and works  if you comment out all except two lines:
  def getAddonVideo(self,url):
    liz = xbmcgui.ListItem(path = url)
    xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

hye, 

for some reason after the changes it's still not working for me.
wood love to get some help.

here's the log:
https://paste.kodi.tv/nusakajuve.kodi/

thank you!
(2019-07-02, 02:25)neriyaa Wrote: [ -> ]
(2018-08-12, 06:59)hgtv Wrote: [ -> ]debugging latest 3.0.2 version, i find that the getAddonVideo() can be more direct now, and works  if you comment out all except two lines:
  def getAddonVideo(self,url):
    liz = xbmcgui.ListItem(path = url)
    xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

hye, 

for some reason after the changes it's still not working for me.
wood love to get some help.

here's the log:
https://paste.kodi.tv/nusakajuve.kodi/

thank you! 

log:
2019-07-02 03:28:04.043 T:21288  NOTICE: VideoPlayer::OpenFile: plugin://plugin.video.hgtv.canada/?mode=GV&url=http%3A%2F%2Flink.theplatform.com%2Fs%2FdtjsEC%2FvyJHkDmoeIkw%3Fmanifest%3Dm3u%26feed%3DHGTV%2520Main%2520Feed%26mbr%3Dtrue
2019-07-02 03:28:04.919 T:21288   ERROR: CCurlFile::Stat - Failed: HTTP response code said error(22) for http://link.theplatform.com/s/dtjsEC/vyJ...d&mbr=true
2019-07-02 03:28:04.921 T:19028  NOTICE: Creating InputStream
2019-07-02 03:28:05.334 T:19028   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
2019-07-02 03:28:05.334 T:19028   ERROR: CCurlFile::Open failed with code 403 for http://link.theplatform.com/s/dtjsEC/vyJ...d&mbr=true:
2019-07-02 03:28:05.795 T:19028   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
2019-07-02 03:28:05.795 T:19028   ERROR: CCurlFile::Open failed with code 403 for http://link.theplatform.com/s/dtjsEC/vyJ...d&mbr=true:
2019-07-02 03:28:05.795 T:19028   ERROR: XFILE::CFileCache::Open - failed to open source <http://link.theplatform.com/s/dtjsEC/vyJHkDmoeIkw?manifest=m3u&feed=HGTV%20Main%20Feed&mbr=true>
2019-07-02 03:28:05.796 T:19028   ERROR: CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.hgtv.canada/?mode=GV&url=http%3A%2F%2Flink.theplatform.com%2Fs%2FdtjsEC%2FvyJHkDmoeIkw%3Fmanifest%3Dm3u%26feed%3DHGTV%2520Main%2520Feed%26mbr%3Dtrue]
2019-07-02 03:28:05.796 T:19028  NOTICE: CVideoPlayer::OnExit()
2019-07-02 03:28:05.809 T:21288  NOTICE: CVideoPlayer::CloseFile()
2019-07-02 03:28:05.809 T:21288  NOTICE: VideoPlayer: waiting for threads to exit
2019-07-02 03:28:05.809 T:21288  NOTICE: VideoPlayer: finished waiting
2019-07-02 03:28:28.322 T:21288  NOTICE: Stopping player
@neriyaa the change you referred to was for an earlier version of the HGTV Canada video add-on.  This change was already included in HGTV Canada 3.0.3.

A recent improvement to version 3.0.3 was suggested by @Veers01 in post #117.

If you have difficulty applying the improvement then let me know and I can post instructions on how to replace the scraper.py file.
Hi ,

Am running Kodi on my Nvidia Shield TV with HGTV Canada add on 3.0.3. I have followed suggestions from @Veers01 in post #117, I did modify my scraper.py file and replace the one on my Nvidia shield but still I can't seem to play any of the videos. Am I missing something ? Apologies, totally noob in this area.
Steps to Update HGTV Canada video add-on

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

    IMPORTANT: Use pop-up COPY button. When copying the code below be sure to move the mouse pointer over the code and click the pop-up COPY button in the upper right-hand corner of the code section. This will ensure that invisible URL encoded space characters (percent-two-zero, or %20) are copied to the clipboard.

    For example, open a text editor, copy the scraper.py file contents listed below, 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.hgtv.canada is installed on your Kodi computer.

    For example:
     
    • /storage/.kodi/addons/plugin.video.hgtv.canada/ for LibreELEC on Raspberry Pi.
    • ~/.kodi/addons/plugin.video.hgtv.canada/ 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.hgtv.canada/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]92.168.1.103:/storage/.kodi/addons/plugin.video.hgtv.canada/resources/lib/

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

'Hope that helps.

The credit for this improvement belongs to @Veers01.

----- Beginning of file -----

# -*- coding: utf-8 -*-
# HGTV Canada Kodi Video Addon
#
from t1mlib import t1mAddon
import json
import re
import os
import datetime
import urllib
import urllib2
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):
url = 'http://common.farm1.smdg.ca/Forms/PlatformVideoFeed?platformUrl=http%3A//feed.theplatform.com/f/dtjsEC/EAlt6FfQ_kCX/categories%3Fpretty%3Dtrue%26byHasReleases%3Dtrue%26range%3D1-1000%26sort%3DfullTitle&callback='
html = self.getRequest(url)
a = json.loads(html[1:len(html)-1])['items']
wewait = True
for b in a:
if b['title'] == 'Shows' and wewait == True:
wewait = False
continue
if wewait == False:
if b['depth'] == 2:
name = b['title']
url = b['id'].rsplit('/',1)[1]
ilist = self.addMenuItem(name,'GC', ilist, url, self.addonIcon, self.addonFanart, {}, isFolder=True)
return(ilist)

def getAddonCats(self,url,ilist):
self.defaultVidStream['width'] = 640
self.defaultVidStream['height'] = 360
geurl = uqp(url)
url = 'http://common.farm1.smdg.ca/Forms/PlatformVideoFeed?platformUrl=http%3A//feed.theplatform.com/f/dtjsEC/EAlt6FfQ_kCX/categories%3Fpretty%3Dtrue%26byHasReleases%3Dtrue%26range%3D1-1000%26sort%3DfullTitle&callback='
html = self.getRequest(url)
a = json.loads(html[1:len(html)-1])['items']
pid = 'http://data.media.theplatform.com/media/data/Category/%s' % geurl
wewait = True
for b in a:
if b['parentId'] == pid:
if wewait == True:
if b['title'] == 'Full Episodes':
wewait = False
pid = b['id']
if b['hasReleases'] == False: continue
if wewait == False and b['hasReleases'] == True:
name = b['title']
url = b['id'].rsplit('/',1)[1]
ilist = self.addMenuItem(name,'GE', ilist, url, self.addonIcon, self.addonFanart, {}, isFolder=True)
return(ilist)


def getAddonEpisodes(self,url,ilist):
self.defaultVidStream['width'] = 640
self.defaultVidStream['height'] = 360
geurl = uqp(url)
url = 'http://feed.theplatform.com/f/dtjsEC/EAlt6FfQ_kCX?count=true&byCategoryIDs=%s&startIndex=1&endIndex=100&sort=pubDate|desc&callback=' % geurl
html = self.getRequest(url)
a = json.loads(html)['entries']
if len(a) == 0:
url = 'http://common.farm1.smdg.ca/Forms/PlatformVideoFeed?platformUrl=http%3A//feed.theplatform.com/f/dtjsEC/EAlt6FfQ_kCX/categories%3Fpretty%3Dtrue%26byHasReleases%3Dtrue%26range%3D1-1000%26sort%3DfullTitle&callback='
html = self.getRequest(url)
a = json.loads(html[1:len(html)-1])['items']
pid = 'http://data.media.theplatform.com/media/data/Category/%s' % geurl
wewait = True
for b in a:
if b['parentId'] == pid:
if wewait == True:
if b['title'] == 'Full Episodes':
wewait = False
pid = b['id']
if b['hasReleases'] == False: continue
if wewait == False and b['hasReleases'] == True:
name = b['title']
url = b['id'].rsplit('/',1)[1]
ilist = self.addMenuItem(name,'GE', ilist, url, self.addonIcon, self.addonFanart, {}, isFolder=True)

else:
for b in a:
url = b['content'][0]['url'].replace('manifest=f4m','manifest=m3u')
name = h.unescape(b['title'])
thumb = b.get('defaultThumbnailUrl')
fanart = self.addonFanart
infoList = {}
infoList['Duration'] = int(b['content'][0]['duration'])
infoList['Title'] = name
infoList['Studio'] = b.get('pl1$network')
infoList['Date'] = datetime.datetime.fromtimestamp(b['pubDate']/1000).strftime('%Y-%m-%d')
infoList['Aired'] = infoList['Date']
infoList['Year'] = int(infoList['Date'].split('-',1)[0])
mpaa = re.compile('ratings="(.+?)"',re.DOTALL).search(html)
if mpaa is not None: infoList['MPAA'] = mpaa.group(1).split(':',1)[1]
episode = b.get('pl1$episode')
if episode is not None: infoList['Episode'] = int(episode)
season = b.get('pl1$season')
if season is not None: infoList['Season'] = int(season)
else: infoList['Season'] = 1
infoList['Plot'] = h.unescape(b["description"])
infoList['TVShowTitle'] = b['pl1$show']
infoList['mediatype'] = 'episode'
ilist = self.addMenuItem(name,'GV', ilist, url, thumb, fanart, infoList, isFolder=False)
return(ilist)



def getAddonVideo(self,url):
# durl = url
# html = self.getRequest(url) #needs proxy
# url = re.compile('video src="(.+?)"', re.DOTALL).search(html)
# if url is None:
# url = durl
# suburl = None
# else:
# url = url.group(1)
# suburl = re.compile('textstream src="(.+?)"', re.DOTALL).search(html)
# html = self.getRequest(url) #needs proxy
# url = re.compile('http(.+?)\n', re.DOTALL).search(html).group(0).strip()
liz = xbmcgui.ListItem(path = url)
# if suburl is not None:
# suburl=suburl.group(1).replace('.ttml','.vtt')
# liz.setSubtitles([suburl])
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

----- End of file -----
(2019-08-05, 18:02)kodaksmith Wrote: [ -> ]Steps to Update HGTV Canada video add-on

The following steps assume that you have the HGTV Canada 3.0.3 video add-on already installed on your Kodi computer.
 
  1. Download the replacement plugin.video.hgtv.canada/resources/lib/scraper.py file and save it as scraper.py

    To Download I highlighted all the lines in the HasteBin web page excluding the line numbers,
    copied and pasted into a text editor and saved the file.


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

    For example:
     
    • /storage/.kodi/addons/plugin.video.hgtv.canada/ for LibreELEC on Raspberry Pi.
    • ~/.kodi/addons/plugin.video.hgtv.canada/ 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.hgtv.canada/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.hgtv.canada/resources/lib/

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

'Hope that helps.

The credit for this improvement belongs to @Veers01
Thank's a lot  @kodaksmith , I have tried your instructions but,  videos are still not playing. sigh :-(
I am able to successfully play episodes using even the unmodified official HGTV Canada 3.0.3 video add-on on my up-to-date NVidia Shield TV.  For example I played the show Toughest Client To Date listed under Full Episodes for the TV series One Bryk at a Time.

Note that the update instructions I listed above are an improvement that lists additional episodes for some shows (see previous history).

I think that HGTV Canada is GEO-Restricted to Canada Only.  My guess is that your IP address is not recognized as Canadian, or there is something else wrong with the setup on your NVidia Shield TV.  Unfortunately I have no further suggestions for the problem you are experiencing.
(2019-08-06, 19:23)kodaksmith Wrote: [ -> ]I am able to successfully play episodes using even the unmodified official HGTV Canada 3.0.3 video add-on on my up-to-date NVidia Shield TV.  For example I played the show Toughest Client To Date listed under Full Episodes for the TV series One Bryk at a Time.

Note that the update instructions I listed above are an improvement that lists additional episodes for some shows (see previous history).

I think that HGTV Canada is GEO-Restricted to Canada Only.  My guess is that your IP address is not recognized as Canadian, or there is something else wrong with the setup on your NVidia Shield TV.  Unfortunately I have no further suggestions for the problem you are experiencing.
Thanks again. really appreciate it @kodaksmith . Am currently in the Philippines and am using SmartDNSProxy to access Netflix US and the likes. Will probably try to reach out to the SmartDNSProxy people about this.
@pauls13 note that the Kodi forums do not provide support for the discussion of bypassing GEO-Locking as stated in the Official VPN Policy.
(2019-08-07, 19:12)kodaksmith Wrote: [ -> ]@pauls13 note that the Kodi forums do not provide support for the discussion of bypassing GEO-Locking as stated in the Official VPN Policy.

Thanks @kodaksmith this is duly noted and again appreciate the help
The above posted patch for this add-on has been re-edited to re-introduce the code indentation which is critical for Python programs.
Pages: 1 2 3 4 5 6 7 8 9