[Release] Shout Factory TV
#1
Place holder. Watch here for news.
Reply
#2
Add-on is now available in the kodi.org repo.

Nearly every Gerry Anderson series available, including Thunderbirds in 1080. Secret Agent (Danger Man), The Saint, various old talk shows.
MST3K as well.
Reply
#3
Thanks @learningit for this add-on.  It mostly worked for me with LibreELEC 8.2.5 on a Raspberry Pi 2/3.  However I was unable to load the list of Thunderbirds episodes.  After some investigation I discovered the problem was due to a non-ASCII character in one of the episode titles.  Below are the steps to apply a fix.

The following steps assume that you have the Shout Factory TV 3.0.1 video add-on already installed on your Kodi computer.
 
  1. Create a replacement plugin.video.shoutfactorytv/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.shoutfactorytv is installed on your Kodi computer.

    For example:
     
    • /storage/.kodi/addons/plugin.video.shoutfactorytv/ for LibreELEC on Raspberry Pi.
    • ~/.kodi/addons/plugin.video.foodnetwork.canda/ 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.shoutfactorytv/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.shoutfactorytv/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 -----

# -*- coding: utf-8 -*-
# Shout Factory TV 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):
ilist = self.addMenuItem('Film','GC', ilist, '/film', self.addonIcon, self.addonFanart, {} , isFolder=True)
ilist = self.addMenuItem('TV','GC', ilist, '/tv', self.addonIcon, self.addonFanart, {} , isFolder=True)
return(ilist)

def getAddonCats(self,url,ilist):
html = self.getRequest('http://www.shoutfactorytv.com'+url)
html = re.compile('<div class="dropdown">.+?a href="'+url+'"(.+?)</div', re.DOTALL).search(html).group(1)
cats = re.compile('<a href="(.+?)">(.+?)<', re.DOTALL).findall(html)
if url =='/film':
mode = 'GM'
else:
mode = 'GS'
for url, name in cats:
ilist = self.addMenuItem(name, mode, ilist, url, self.addonIcon, self.addonFanart, {} , isFolder=True)
return(ilist)

def getAddonEpisodes(self,url,ilist, getFileData = False):
html = self.getRequest('http://www.shoutfactorytv.com%s' % (url))
html = re.compile('<div class="tabs-area(.+?)<div class="container add">', re.DOTALL).search(html).group(1)
epis=re.compile('<a href="(.+?)".+?alt="(.+?)".+?src="(.+?)".+?SeasonSad.+?)\n.+?EpisodeSad.+?)\n.+?</li',re.DOTALL).findall(html)
for url, name, thumb, season, episode in epis:
url = url.rsplit('/',1)[1]
infoList = {}
name = re.sub(r'[^\x00-\x7F]+','', name) # Strip non-ASCII chars
name = h.unescape(name)
infoList['Title'] = name
infoList['TVShowTitle'] = xbmc.getInfoLabel('ListItem.TVShowTitle')
season = season.strip(' ,')
if season.isdigit():
infoList['Season'] = int(season)
episode = episode.strip()
if episode.isdigit():
infoList['Episode'] = int(episode)
infoList['mediatype'] = 'episode'
if not getFileData:
contextMenu = [('Add To Library','XBMC.RunPlugin(%s?mode=DF&url=AM%s)' % (sys.argv[0], url))]
ilist = self.addMenuItem(name,'GV', ilist, url, thumb, self.addonFanart, infoList, isFolder=False, cm=contextMenu)
else:
ilist.append((infoList.get('Season',''), infoList.get('Episode',''), url))
return(ilist)

def getAddonMovies(self,url,ilist):
html = self.getRequest('http://www.shoutfactorytv.com%s' % (url))
movies=re.compile('<div class="img-holder">.+?href="(.+?)".+?alt="(.+?)".+?src="(.+?)"',re.DOTALL).findall(html)
movies = sorted(movies, key=lambda x: x[1])
for url, name, thumb in movies:
url = url.rsplit('/',1)[1]
infoList = {}
name = h.unescape(name).replace('?','')
infoList['Title'] = name
infoList['mediatype'] = 'movie'
contextMenu = [('Add To Library','XBMC.RunPlugin(%s?mode=DF&url=AM%s)' % (sys.argv[0], url))]
ilist = self.addMenuItem(name,'GV', ilist, url, thumb, self.addonFanart, infoList, isFolder=False, cm=contextMenu)
return(ilist)

def getAddonShows(self,url,ilist):
html = self.getRequest('http://www.shoutfactorytv.com%s' % (url))
shows=re.compile('<div class="img-holder">.+?href="(.+?)".+?alt="(.+?)".+?src="(.+?)"',re.DOTALL).findall(html)
shows = sorted(shows, key=lambda x: x[1])
for url, name, thumb in shows:
infoList = {}
name = h.unescape(name)
infoList['Title'] = name
infoList['TVShowTitle'] = name
infoList['mediatype'] = 'tvshow'
contextMenu = [('Add To Library','XBMC.RunPlugin(%s?mode=DF&url=AL%s)' % (sys.argv[0], url))]
ilist = self.addMenuItem(name,'GE', ilist, url, thumb, self.addonFanart, infoList , isFolder=True, cm=contextMenu)
return(ilist)

def doFunction(self, url):
func = url[0:2]
url = url[2:]
if func == 'AL':
name = xbmc.getInfoLabel('ListItem.Title').replace('?','')
profile = self.addon.getAddonInfo('profile').decode(UTF8)
moviesDir = xbmc.translatePath(os.path.join(profile,'TV Shows'))
movieDir = xbmc.translatePath(os.path.join(moviesDir, name))
if not os.path.isdir(movieDir):
os.makedirs(movieDir)
ilist = []
ilist = self.getAddonEpisodes(url, ilist, getFileData = True)
for season, episode, url in ilist:
se = 'S%sE%s' % (str(season), str(episode))
xurl = '%s?mode=GV&url=%s' % (sys.argv[0], qp(url))
strmFile = xbmc.translatePath(os.path.join(movieDir, se+'.strm'))
with open(strmFile, 'w') as outfile:
outfile.write(xurl)
elif func == 'AM':
name = xbmc.getInfoLabel('ListItem.Title').replace('?','')
profile = self.addon.getAddonInfo('profile').decode(UTF8)
moviesDir = xbmc.translatePath(os.path.join(profile,'Movies'))
movieDir = xbmc.translatePath(os.path.join(moviesDir, name))
if not os.path.isdir(movieDir):
os.makedirs(movieDir)
strmFile = xbmc.translatePath(os.path.join(movieDir, name+'.strm'))
with open(strmFile, 'w') as outfile:
outfile.write('%s?mode=GV&url=%s' %(sys.argv[0], url))
json_cmd = '{"jsonrpc":"2.0","method":"VideoLibrary.Scan", "params": {"directory":"%s/"},"id":1}' % movieDir.replace('\\','/')
jsonRespond = xbmc.executeJSONRPC(json_cmd)


def getAddonVideo(self,url):
if not url.startswith('http'):
url = 'https://player.zype.com/manifest/%s.m3u8?api_key=3PASB80DgKOdJoEdFmyaWw' % url
liz = xbmcgui.ListItem(path = url)
infoList ={}
infoList['mediatype'] = xbmc.getInfoLabel('ListItem.DBTYPE')
infoList['Title'] = xbmc.getInfoLabel('ListItem.Title')
infoList['TVShowTitle'] = xbmc.getInfoLabel('ListItem.TVShowTitle')
infoList['Year'] = xbmc.getInfoLabel('ListItem.Year')
infoList['Premiered'] = xbmc.getInfoLabel('Premiered')
infoList['Plot'] = xbmc.getInfoLabel('ListItem.Plot')
infoList['Studio'] = xbmc.getInfoLabel('ListItem.Studio')
infoList['Genre'] = xbmc.getInfoLabel('ListItem.Genre')
infoList['Duration'] = xbmc.getInfoLabel('ListItem.Duration')
infoList['MPAA'] = xbmc.getInfoLabel('ListItem.Mpaa')
infoList['Aired'] = xbmc.getInfoLabel('ListItem.Aired')
infoList['Season'] = xbmc.getInfoLabel('ListItem.Season')
infoList['Episode'] = xbmc.getInfoLabel('ListItem.Episode')
liz.setInfo('video', infoList)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

----- End of file -----
Reply
#4
Happy to find this add-on, no Shout Factory app for Android TV but now I'm watching Super Sentai Zyuranger without having to switch over to a Roku. Thanks!
Reply
#5
As I am going over my patched addons, kodiak can you check the Shout TV patch for the indented code issue, thanks
Reply
#6
@barney63 this patch had the same problem wherein the code indentation disappeared after I edited the post.  I don't know why this happens sometimes and othertimes not.  Anyways I have re-edited the post to re-introduce the code indentation.
Reply
#7
Working now thanks.  Two other patches I have but don't have the addons installed now are HGTV Canada and PBSThinkTV, can you have a look for the indented issue.

Great to have all these fixes so quickly today.

Scraper.py for CBC News, Food Network Canada, Shout Factory TV and TVO are all good, many thanks.
Reply
#8
Both HGTV Canada and PBS ThinkTV add-on patches contain the correct indentation so all there should be good to go.  :-)
Reply
#9
(2019-10-28, 23:33)kodaksmith Wrote: Both HGTV Canada and PBS ThinkTV add-on patches contain the correct indentation so all there should be good to go.  :-)
Great, thanks!
Reply
#10
Getting the "Check the log" error when trying to play something from the TV section.  Strangely, the Film section videos all play ok.  Can some folks check and see if they have the same issue.  Thanks.
Reply
#11
Just tested, seems to work fine for me on Windows and Shield.
Reply
#12
'Just tested and both movies and TV play properly on Raspberry Pi 3 with LibreELEC 8.2.5 and Kodi 17.6.
Reply
#13
Version 4.0.0 available in the Kodi v19 repo.
This version is py3 native and will only run on v19 or above.
Supports Save Movie to Library and Save Series to Library.
Reply
#14
FYI:  Recently on my RPi2 running LibreELEC 9.2.1 (Kodi 18.6) I discovered that the Shout Factory TV 3.0.1 add-on no longer lists shows when selecting either Film or TV.

Note that I do not have a Kodi 19 Matrix (Beta) install so have not tested version 4.0 of this add-on.
Reply
#15
(2020-08-20, 19:09)kodaksmith Wrote: FYI:  Recently on my RPi2 running LibreELEC 9.2.1 (Kodi 18.6) I discovered that the Shout Factory TV 3.0.1 add-on no longer lists shows when selecting either Film or TV.

Note that I do not have a Kodi 19 Matrix (Beta) install so have not tested version 4.0 of this add-on.

The v19 addon is working. I am dropping support for Kodi versions prior to v19 moving forward.
Reply



Logout Mark Read Team Forum Stats Members Help
[Release] Shout Factory TV0
This forum uses Lukasz Tkacz MyBB addons.