summaryrefslogtreecommitdiff
path: root/plugin.video.ustvnow
diff options
context:
space:
mode:
authorLunatixz <Kgraer@gmail.com>2017-08-05 17:23:01 -0400
committerLunatixz <Kgraer@gmail.com>2017-08-05 17:23:01 -0400
commit115d6e7a9b45782d6822de33f8ac19b81cc3ef1c (patch)
treefeec4afd62595be5cfc2a2bd523417904f8ef591 /plugin.video.ustvnow
parent6eb9233080bcd52d34aba3c1beed982fa1f6e9e6 (diff)
[plugin.video.ustvnow] 2017.8.5
Diffstat (limited to 'plugin.video.ustvnow')
-rw-r--r--plugin.video.ustvnow/addon.xml4
-rw-r--r--plugin.video.ustvnow/default.py44
2 files changed, 33 insertions, 15 deletions
diff --git a/plugin.video.ustvnow/addon.xml b/plugin.video.ustvnow/addon.xml
index 6cfbfd8..473d8a3 100644
--- a/plugin.video.ustvnow/addon.xml
+++ b/plugin.video.ustvnow/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.ustvnow" name="USTVnow" provider-name="Lunatixz" version="2017.8.2">
+<addon id="plugin.video.ustvnow" name="USTVnow" provider-name="Lunatixz" version="2017.8.5">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.simplecache" version="1.0.0"/>
@@ -15,7 +15,7 @@
<source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.ustvnow</source>
<website>http://ustvnow.com</website>
<forum>http://forum.kodi.tv/showthread.php?tid=233135</forum>
- <news>2017.4.7[CR]-100% new code base, written from scratch for your enjoy!!, DVR Recording and Playback Untested.[CR]2017.4.7a[CR]- Added "Featured"[CR]- Fixed DVR support.[CR]2017.7.26[CR]- Corrected version format.[CR]- Changed "Featured" and "Guide" click behavior.[CR]- Improved Error handling.[CR]2017.7.31[CR]- Fixed login issues.[CR]- Added fallback token generation[CR]- Added initial support for uEPG module[CR]2017.8.2[CR]- Fixed paid subscription channels and dvr control.</news>
+ <news>[CR]2017.8.5[CR]- Fixed encoding error.[CR]2017.8.2[CR]- Fixed paid subscription channels and dvr control.[CR]2017.7.31[CR]- Fixed login issues.[CR]- Added fallback token generation[CR]- Added initial support for uEPG module.[CR]2017.7.26[CR]- Corrected version format.[CR]- Changed "Featured" and "Guide" click behavior.[CR]- Improved Error handling.[CR]2017.4.7a[CR]- Added "Featured"[CR]- Fixed DVR support.2017.4.7[CR]-100% new code base, written from scratch for your enjoy!!, DVR Recording and Playback Untested.</news>
<assets>
<icon>resources/images/icon.png</icon>
<fanart>resources/images/fanart.jpg</fanart>
diff --git a/plugin.video.ustvnow/default.py b/plugin.video.ustvnow/default.py
index b02b0f0..91f24b4 100644
--- a/plugin.video.ustvnow/default.py
+++ b/plugin.video.ustvnow/default.py
@@ -75,14 +75,24 @@ FILE_PARAMS = ["title", "artist", "albumartist", "genre", "year", "rating", "al
PVR_PARAMS = ["title","plot","plotoutline","starttime","endtime","runtime","progress","progresspercentage","genre","episodename","episodenum","episodepart","firstaired","hastimer","isactive","parentalrating","wasactive","thumbnail","rating","originaltitle","cast","director","writer","year","imdbnumber","hastimerrule","hasrecording","recording","isseries"]
ART_PARAMS = ["thumb","poster","fanart","banner","landscape","clearart","clearlogo"]
+
+def uni(string, encoding = 'utf-8'):
+ if isinstance(string, basestring):
+ if not isinstance(string, unicode):
+ string = unicode(string, encoding)
+ elif isinstance(string, unicode):
+ string = string.encode('ascii', 'replace')
+ return string
+
def unescape(string):
try:
parser = HTMLParser.HTMLParser()
- return parser.unescape(string)
+ return (parser.unescape(string))
except:
return string
def log(msg, level=xbmc.LOGDEBUG):
+ msg = msg.encode("utf-8")
if DEBUG == True:
if level == xbmc.LOGERROR:
msg += ' ,' + traceback.format_exc()
@@ -307,6 +317,8 @@ class USTVnow():
d = datetime.datetime.utcnow()
now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
+ if self.channels is None:
+ xbmc.executebuiltin("Container.Refresh")
for channel in self.channels:
try:
name = CHAN_NAMES[channel['stream_code']]
@@ -317,14 +329,16 @@ class USTVnow():
if endtime > now and startime <= now:
label, url, liz = self.buildChannelListItem(name, channel)
self.addLink(label, url, 9, liz, len(self.channels))
- except:
- xbmc.executebuiltin("Container.Refresh")
+ except Exception,e:
+ log('browseLive, failed ' + str(e), xbmc.LOGERROR)
def browseRecordings(self, recorded=False):
log('browseRecordings')
d = datetime.datetime.utcnow()
- now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
+ now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
+ if self.recorded is None:
+ xbmc.executebuiltin("Container.Refresh")
for channel in self.recorded:
try:
startime = datetime.datetime.fromtimestamp(channel['ut_start'])
@@ -338,15 +352,17 @@ class USTVnow():
if mode == 21:
liz.setProperty("IsPlayable","false")
self.addLink(label, url, mode, liz, len(self.recorded))
- except:
- xbmc.executebuiltin("Container.Refresh")
-
+ except Exception,e:
+ log('browseRecordings, failed ' + str(e), xbmc.LOGERROR)
+
def browseGuide(self, name=None, upcoming=False):
log('browseGuide')
d = datetime.datetime.utcnow()
now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
+ if self.channels is None:
+ xbmc.executebuiltin("Container.Refresh")
if name is None and upcoming == False:
collect = []
for channel in self.channels:
@@ -379,8 +395,8 @@ class USTVnow():
if mode == 21:
liz.setProperty("IsPlayable","false")
self.addLink(label, url, mode, liz, len(self.channels))
- except:
- xbmc.executebuiltin("Container.Refresh")
+ except Exception,e:
+ log('browseGuide, failed ' + str(e), xbmc.LOGERROR)
def browseFeatured(self):
@@ -388,6 +404,8 @@ class USTVnow():
d = datetime.datetime.utcnow()
now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
+ if self.upcoming is None:
+ xbmc.executebuiltin("Container.Refresh")
for channel in self.upcoming:
try:
name = CHAN_NAMES[channel['sname']]
@@ -397,8 +415,8 @@ class USTVnow():
label, url, liz = self.buildChannelListItem(name, channel, feat=True)
liz.setProperty("IsPlayable","false")
self.addLink(label, url, 21, liz, len(self.upcoming))
- except:
- xbmc.executebuiltin("Container.Refresh")
+ except Exception,e:
+ log('browseFeatured, failed ' + str(e), xbmc.LOGERROR)
def buildChannelListItem(self, name, channel=None, feat=False):
@@ -569,7 +587,7 @@ class USTVnow():
def addLink(self, name, u, mode, liz, total=0):
log('addLink, name = ' + name)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(uni(name))
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
@@ -585,7 +603,7 @@ class USTVnow():
liz.setArt({'thumb':ICON,'fanart':FANART})
else:
liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(uni(name))
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)