The branch, frodo has been updated
via f79b410c8201217d52c6330e7b4225a376536498 (commit)
via b5186d62560bdcd1613f155dba4e8eb874427e24 (commit)
from 9bf9e67e4369e3c684503aad1e2a3f2dc38754c4 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=f79b410c8201217d52c6330e7b4225a376536498
commit f79b410c8201217d52c6330e7b4225a376536498
Author: beenje <[email protected]>
Date: Mon Jan 14 21:39:37 2013 +0100
[plugin.video.pbs] updated to version 3.0.9
diff --git a/plugin.video.pbs/addon.xml b/plugin.video.pbs/addon.xml
index 7b70f90..3726fc2 100644
--- a/plugin.video.pbs/addon.xml
+++ b/plugin.video.pbs/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.pbs"
name="PBS"
- version="2.0.8"
+ version="3.0.9"
provider-name="stacked">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
diff --git a/plugin.video.pbs/addonfunc.py b/plugin.video.pbs/addonfunc.py
index a011d25..efb539a 100644
--- a/plugin.video.pbs/addonfunc.py
+++ b/plugin.video.pbs/addonfunc.py
@@ -1,18 +1,23 @@
'''
Addon Functions
-date: 12-29-2012
-version: 0.0.2
+__author__ = 'stacked <[email protected]>'
+__url__ = 'http://code.google.com/p/plugin/'
+__date__ = '01-12-2013'
+__version__ = '0.0.6'
'''
-import xbmc, xbmcgui, xbmcaddon, xbmcplugin, urllib2, sys, time, datetime,
buggalo
+import xbmc, xbmcgui, xbmcaddon, xbmcplugin, urllib, urllib2, sys, time,
datetime, buggalo
settings = sys.modules["__main__"].settings
plugin = sys.modules["__main__"].plugin
useragent = 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101
Firefox/17.0'
def addListItem(label, image, url, isFolder, infoLabels = False, fanart =
False, duration = False):
listitem = xbmcgui.ListItem(label = label, iconImage = image,
thumbnailImage = image)
- if not isFolder: listitem.setProperty('IsPlayable', 'true')
- if fanart: listitem.setProperty('fanart_image', fanart)
+ if not isFolder:
+ if settings.getSetting('download') == '' or
settings.getSetting('download') == 'false':
+ listitem.setProperty('IsPlayable', 'true')
+ if fanart:
+ listitem.setProperty('fanart_image', fanart)
if infoLabels:
listitem.setInfo(type = 'video', infoLabels = infoLabels)
if duration:
@@ -20,9 +25,10 @@ def addListItem(label, image, url, isFolder, infoLabels =
False, fanart = False,
listitem.addStreamInfo('video', { 'duration':
int(duration) })
else:
listitem.setInfo(type = 'video', infoLabels = {
'duration': str(datetime.timedelta(milliseconds=int(duration)*1000)) } )
- u = sys.argv[0] + '?'
- for key, value in url.items():
- u += key + '=' + value + '&'
+ if url['mode']:
+ u = sys.argv[0] + '?' + urllib.urlencode(url)
+ else:
+ u = url['url']
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u,
listitem = listitem, isFolder = isFolder)
return ok
@@ -86,12 +92,14 @@ def getPage(url, gzip = False):
data['error'] = str(e)
return data
-def setViewMode(id):
+def setViewMode(id, type = False):
+ if type == False: type = 'episodes'
if xbmc.getSkinDir() == 'skin.confluence':
- xbmcplugin.setContent(int( sys.argv[1] ), 'episodes')
- xbmc.executebuiltin('Container.SetViewMode(' + id + ')')
+ xbmcplugin.setContent(int( sys.argv[1] ), type)
+ if settings.getSetting('view') == 'true':
+ xbmc.executebuiltin('Container.SetViewMode(' + id + ')')
-#From CommonFunctions.py in parsedom
+#From http://wiki.xbmc.org/index.php?title=Add-on:Parsedom_for_xbmc_plugins
def getParameters(parameterString):
commands = {}
splitCommands = parameterString[parameterString.find('?') + 1:].split('&')
@@ -103,7 +111,7 @@ def getParameters(parameterString):
commands[key] = value
return commands
-#Original from
http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+#From
http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
def retry(ExceptionToCheck, tries = 10, delay = 3, backoff = 1, logger = None):
def deco_retry(f):
def f_retry(*args, **kwargs):
@@ -117,6 +125,7 @@ def retry(ExceptionToCheck, tries = 10, delay = 3, backoff
= 1, logger = None):
mtries, mdelay = tries, delay
else:
ok = dialog.ok(plugin,
settings.getLocalizedString( 30051 ))
+ buggalo.addExtraData('error',
str(e))
raise Exception("retry Error")
try:
return f(*args, **kwargs)
diff --git a/plugin.video.pbs/changelog.txt b/plugin.video.pbs/changelog.txt
index 31cfc18..3917b52 100644
--- a/plugin.video.pbs/changelog.txt
+++ b/plugin.video.pbs/changelog.txt
@@ -1,3 +1,11 @@
+[B]Version 3.0.9[/B]
+
+- Version bump for Frodo
+- Fixed 'listitem' is not defined error
+- Fixed play back error in rtmp steams
+- Added setting for preferred video quality (720p on Frodo only)
+- Added setting for default view in Confluence skin
+
[B]Version 2.0.8[/B]
- Updated code to be compatible with Requests v1.0.4
diff --git a/plugin.video.pbs/default.py b/plugin.video.pbs/default.py
index 45978e1..eb10c4c 100644
--- a/plugin.video.pbs/default.py
+++ b/plugin.video.pbs/default.py
@@ -5,8 +5,8 @@ from urllib2 import Request, urlopen, URLError, HTTPError
plugin = "PBS"
__author__ = 'stacked <[email protected]>'
__url__ = 'http://code.google.com/p/plugin/'
-__date__ = '12-29-2012'
-__version__ = '2.0.8'
+__date__ = '12-30-2012'
+__version__ = '3.0.9'
settings = xbmcaddon.Addon( id = 'plugin.video.pbs' )
buggalo.SUBMIT_URL = 'http://www.xbmc.byethost17.com/submit.php'
dbg = False
@@ -26,6 +26,14 @@ common.plugin = plugin + ' ' + __version__
from addonfunc import addListItem, playListItem, getUrl, setViewMode,
getParameters, retry
+try:
+ if common.getXBMCVersion() >= 12.0:
+ HIGH = 'iPad'
+ else:
+ HIGH = 'MP4 1200k'
+except:
+ HIGH = 'MP4 1200k'
+
def clean( string ):
list = [( '&', '&' ), ( '"', '"' ), ( ''', '\'' ), (
'\n','' ), ( '\r', ''), ( '\t', ''), ( '</p>', '' ), ( '<br />', ' ' ),
( '<br/>', ' ' ), ( '<b>', '' ), ( '</b>', '' ), (
'<p>', '' ), ( '<div>', '' ), ( '</div>', '' ), ( '<strong>', ' ' ),
@@ -34,6 +42,13 @@ def clean( string ):
for search, replace in list:
string = string.replace( search, replace )
return string
+
+def clean_type( string ):
+ if string == None: return 'None'
+ list = [( '-16x9', '' ), ( '-4x3', '' ), ( ' 16x9', '' ), ( ' 4x3','' )]
+ for search, replace in list:
+ string = string.replace( search, replace )
+ return string
def build_main_directory():
main=[
@@ -103,7 +118,7 @@ def build_programs_directory( name, page ):
thumb = programs_thumb
program_id = re.compile(
'/cove/v1/programs/(.*?)/' ).findall( results['resource_uri'] )[0]
infoLabels = { "Title":
results['title'].encode('utf-8'), "Plot": clean(results['long_description']) }
- u = { 'mode': '0', 'name':
urllib.quote_plus( results['title'].encode('utf-8') ), 'program_id':
urllib.quote_plus( program_id ) }
+ u = { 'mode': '0', 'name':
results['title'].encode('utf-8'), 'program_id': program_id }
addListItem(label = results['title'],
image = thumb, url = u, isFolder = True, infoLabels = infoLabels, fanart =
fanart)
# if ( len(data) ) == 200:
# u = { 'mode': '1', 'page': str( int( page ) + 1 ) }
@@ -120,7 +135,7 @@ def build_topics_directory():
item = None
for results in data:
if item != results['name']:
- u = { 'mode': '0', 'name': urllib.quote_plus(
results['name'] ), 'topic': urllib.quote_plus( 'True' ) }
+ u = { 'mode': '0', 'name': results['name'], 'topic':
'True' }
addListItem(label = results['name'], image =
topics_thumb, url = u, isFolder = True, infoLabels = False, fanart = fanart)
item = results['name']
xbmcplugin.addSortMethod( handle = int(sys.argv[1]), sortMethod =
xbmcplugin.SORT_METHOD_NONE )
@@ -153,7 +168,7 @@ def build_search_directory( url, page ):
item_count = 0
for title, id, thumb in title_id_thumb:
infoLabels = { "Title": clean( title ) , "Director": "PBS",
"Studio": clean( program[item_count] ), "Plot": clean( plot[item_count][0] ) }
- u = { 'mode': '0', 'name': urllib.quote_plus( clean(
program[item_count] ) ), 'program_id': urllib.quote_plus( id.rsplit('/')[4] ),
'topic': urllib.quote_plus( 'False' ) }
+ u = { 'mode': '0', 'name': clean( program[item_count] ),
'program_id': id.rsplit('/')[4], 'topic': 'False' }
addListItem(label = clean( title ), image = thumb, url = u,
isFolder = False, infoLabels = infoLabels, fanart = fanart)
item_count += 1
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_STUDIO )
@@ -161,7 +176,7 @@ def build_search_directory( url, page ):
if page == 0:
build_programs_directory( save_url.replace( '%20', ' ' ), 0 )
if ( int( video_count[0] ) - ( 10 * int( page ) ) ) > 10:
- u = { 'mode': '6', 'page': str( int( page ) + 1 ), 'url':
urllib.quote_plus( save_url ) }
+ u = { 'mode': '6', 'page': str( int( page ) + 1 ), 'url':
save_url }
addListItem(label = '[Next Page (' + str( int( page ) + 2 ) +
')]', image = next_thumb, url = u, isFolder = True, infoLabels = False, fanart
= fanart)
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_STUDIO )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_LABEL )
@@ -170,6 +185,10 @@ def build_search_directory( url, page ):
@retry(TypeError)
def find_videos( name, program_id, topic, page ):
+ if settings.getSetting("quality") == '0':
+ type = ['MPEG-4 500kbps', 'MP4 800k', HIGH]
+ else:
+ type = [HIGH, 'MP4 800k', 'MPEG-4 500kbps' ]
start = str( 200 * page )
url = 'None'
backup_url = None
@@ -193,34 +212,26 @@ def find_videos( name, program_id, topic, page ):
if len(data) <= 1:
data =
cove.videos.filter(fields='associated_images,mediafiles',filter_program=program_id,order_by='-airdate',filter_availability_status='Available',limit_start=start)
for results in data:
- playable = None
+ encoding = {}
if results['associated_images'] != None and
len(results['associated_images']) > 0:
thumb = results['associated_images'][0]['url']
else:
thumb = 'None'
- count = 0
for videos in results['mediafiles']:
- if
results['mediafiles'][count]['video_encoding']['name'] == 'MPEG-4 500kbps':
- playable = count
- count += 1
- if playable == None:
- playable = count - 1
- if playable != -1:
- if results['mediafiles'][playable]['video_data_url'] !=
None:
- url =
results['mediafiles'][playable]['video_data_url']
- mode = '5'
- if
results['mediafiles'][playable]['video_download_url'] != None:
- backup_url =
results['mediafiles'][playable]['video_download_url']
- else:
- backup_url = 'None'
- elif results['mediafiles'][playable]['video_data_url']
== None and results['mediafiles'][playable]['video_download_url'] == None:
- url = 'None'
- mode = '5'
- else:
- url =
results['mediafiles'][playable]['video_download_url']
- mode = '7'
+ encoding[clean_type(videos['video_encoding']['name'])]
= { 'url': videos['video_data_url'], 'backup_url': videos['video_download_url']
}
+ cycle = 0
+ while cycle <= 2:
+ if type[cycle] in encoding:
+ url = str(encoding[type[cycle]]['url'])
+ backup_url =
str(encoding[type[cycle]]['backup_url'])
+ break
+ cycle += 1
+ if cycle == 3:
+ url = str(encoding.items()[0][1]['url'])
+ backup_url = str(encoding.items()[0][1]['backup_url'])
+ if len(results['mediafiles']) != 0:
infoLabels = { "Title":
results['title'].encode('utf-8'), "Director": "PBS", "Studio": name, "Plot":
results['long_description'].encode('utf-8'), "Aired":
results['airdate'].rsplit(' ')[0], "Duration":
str((int(results['mediafiles'][0]['length_mseconds'])/1000)/60) }
- u = { 'mode': mode, 'name': urllib.quote_plus(
results['title'].encode('utf-8') ), 'url': urllib.quote_plus( url ), 'thumb':
urllib.quote_plus( thumb ), 'plot': urllib.quote_plus(
results['long_description'].encode('utf-8') ), 'studio': urllib.quote_plus(
name ), 'backup_url': urllib.quote_plus( backup_url ) }
+ u = { 'mode': '5', 'name':
results['title'].encode('utf-8'), 'url': url, 'thumb': thumb, 'plot':
results['long_description'].encode('utf-8'), 'studio': name, 'backup_url':
backup_url }
addListItem(label = results['title'].encode('utf-8'),
image = thumb, url = u, isFolder = False, infoLabels = infoLabels, fanart =
fanart, duration = str(int(results['mediafiles'][0]['length_mseconds'])/1000))
if topic == 'False':
play_video( results['title'].encode('utf-8'), url, thumb,
results['long_description'].encode('utf-8'), name.encode('utf-8'), None,
backup_url )
@@ -230,7 +241,7 @@ def find_videos( name, program_id, topic, page ):
ok = dialog.ok( plugin , settings.getLocalizedString( 30012 ) +
' ' + name + '.' )
return
if ( len(data) ) == 200:
- u = { 'mode': '0', 'name': urllib.quote_plus( name ),
'program_id': urllib.quote_plus( program_id ), 'topic': urllib.quote_plus(
topic ), 'page': str( int( page ) + 1 ) }
+ u = { 'mode': '0', 'name': name, 'program_id': program_id,
'topic': topic, 'page': str( int( page ) + 1 ) }
addListItem(label = '[Next Page (' + str( int( page ) + 2 ) +
')]', image = next_thumb, url = u, isFolder = True, infoLabels = False, fanart
= fanart)
if topic == 'search':
build_programs_directory( name, 0 )
@@ -242,9 +253,17 @@ def find_videos( name, program_id, topic, page ):
def play_video( name, url, thumb, plot, studio, starttime, backup_url ):
if url == 'None':
- dialog = xbmcgui.Dialog()
- ok = dialog.ok( plugin , settings.getLocalizedString( 30008 ) )
- return
+ if backup_url != 'None':
+ if url.find('http://urs.pbs.org/redirect/') != -1:
+ play_video( name, backup_url, thumb, plot,
studio, None, 'None' )
+ else:
+ infoLabels = { "Title": name , "Studio": "PBS:
" + studio, "Plot": plot }
+ playListItem(label = name, image = thumb, path
= clean(backup_url), infoLabels = infoLabels, PlayPath = False)
+ return
+ else:
+ dialog = xbmcgui.Dialog()
+ ok = dialog.ok( plugin , settings.getLocalizedString(
30008 ) )
+ return
if url.find('http://urs.pbs.org/redirect/') != -1:
try:
import requests
@@ -262,8 +281,11 @@ def play_video( name, url, thumb, plot, studio, starttime,
backup_url ):
except Exception, e:
print 'PBS - Using backup_url'
if backup_url != 'None':
- infoLabels = { "Title": name , "Studio": "PBS:
" + studio, "Plot": plot }
- playListItem(label = name, image = thumb, path
= clean(backup_url), infoLabels = infoLabels, PlayPath = False)
+ if url.find('http://urs.pbs.org/redirect/') !=
-1:
+ play_video( name, backup_url, thumb,
plot, studio, None, 'None' )
+ else:
+ infoLabels = { "Title": name ,
"Studio": "PBS: " + studio, "Plot": plot }
+ playListItem(label = name, image =
thumb, path = clean(backup_url), infoLabels = infoLabels, PlayPath = False)
return
else:
dialog = xbmcgui.Dialog()
@@ -295,11 +317,15 @@ def play_video( name, url, thumb, plot, studio,
starttime, backup_url ):
pass
try:
base = re.compile( '<meta base="(.+?)" />' ).findall( data )[0]
+ src = re.compile( '<ref src="(.+?)" title="(.+?)" (author)?'
).findall( data )[0][0]
except:
print 'PBS - Using backup_url'
if backup_url != 'None':
- infoLabels = { "Title": name , "Studio": "PBS: " +
studio, "Plot": plot }
- playListItem(label = name, image = thumb, path =
clean(backup_url), infoLabels = infoLabels, PlayPath = False)
+ if url.find('http://urs.pbs.org/redirect/') != -1:
+ play_video( name, backup_url, thumb, plot,
studio, None, 'None' )
+ else:
+ infoLabels = { "Title": name , "Studio": "PBS:
" + studio, "Plot": plot }
+ playListItem(label = name, image = thumb, path
= clean(backup_url), infoLabels = infoLabels, PlayPath = False)
return
else:
dialog = xbmcgui.Dialog()
@@ -309,7 +335,6 @@ def play_video( name, url, thumb, plot, studio, starttime,
backup_url ):
buggalo.addExtraData('info', studio + ' - ' + name)
raise Exception("backup_url ERROR")
return
- src = re.compile( '<ref src="(.+?)" title="(.+?)" (author)?' ).findall(
data )[0][0]
# if src.find('m3u8') != -1:
# dialog = xbmcgui.Dialog()
# ok = dialog.ok( plugin , settings.getLocalizedString( 30008 )
)
@@ -322,15 +347,13 @@ def play_video( name, url, thumb, plot, studio,
starttime, backup_url ):
infoLabels = { "Title": name , "Studio": "PBS: " + studio,
"Plot": plot }
playListItem(label = name, image = thumb, path =
clean(base+src.replace('mp4:','')), infoLabels = infoLabels, PlayPath = False)
return
- elif src.find('.flv') != -1 or src.find('.mp4') != -1:
+ elif src.find('.flv') != -1 or base.find('http://') != -1:
rtmp_url = base + src
else:
rtmp_url = base
playpath = "mp4:" + src.replace('mp4:','')
- if playpath != None:
- listitem.setProperty("PlayPath", playpath)
infoLabels = { "Title": name , "Studio": "PBS: " + studio, "Plot": plot
}
- playListItem(label = name, image = thumb, path = clean( rtmp_url ),
infoLabels = infoLabels, PlayPath = playpath)
+ playListItem(label = name, image = thumb, path = rtmp_url, infoLabels =
infoLabels, PlayPath = playpath)
params = getParameters(sys.argv[2])
starttime = None
diff --git a/plugin.video.pbs/resources/language/English/strings.xml
b/plugin.video.pbs/resources/language/English/strings.xml
index 0a66229..17aea53 100644
--- a/plugin.video.pbs/resources/language/English/strings.xml
+++ b/plugin.video.pbs/resources/language/English/strings.xml
@@ -17,9 +17,13 @@
<string id="30014">PBS Kids</string>
<string id="30015">Sorry. You are not in a geographic region that
has</string>
<string id="30016">access to this content.</string>
+ <string id="30017">Preferred video quality:</string>
+ <string id="30018">2500k-1200k</string>
+ <string id="30019">800k-500k</string>
<string id="30050">There was a connection error:</string>
<string id="30051">If this problem persists, please submit the error
report.</string>
<string id="30052">Retry</string>
<string id="30053">Quit</string>
<string id="30054">There was an index error.</string>
+ <string id="30055">Enable default view for Confluence skin</string>
</strings>
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=b5186d62560bdcd1613f155dba4e8eb874427e24
commit b5186d62560bdcd1613f155dba4e8eb874427e24
Author: beenje <[email protected]>
Date: Mon Jan 14 21:39:31 2013 +0100
[plugin.video.tmz] updated to version 3.0.11
diff --git a/plugin.video.tmz/addon.xml b/plugin.video.tmz/addon.xml
index f6bd43c..4d54e63 100644
--- a/plugin.video.tmz/addon.xml
+++ b/plugin.video.tmz/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.tmz"
name="TMZ"
- version="2.0.10"
+ version="3.0.11"
provider-name="stacked">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
diff --git a/plugin.video.tmz/addonfunc.py b/plugin.video.tmz/addonfunc.py
index a011d25..efb539a 100644
--- a/plugin.video.tmz/addonfunc.py
+++ b/plugin.video.tmz/addonfunc.py
@@ -1,18 +1,23 @@
'''
Addon Functions
-date: 12-29-2012
-version: 0.0.2
+__author__ = 'stacked <[email protected]>'
+__url__ = 'http://code.google.com/p/plugin/'
+__date__ = '01-12-2013'
+__version__ = '0.0.6'
'''
-import xbmc, xbmcgui, xbmcaddon, xbmcplugin, urllib2, sys, time, datetime,
buggalo
+import xbmc, xbmcgui, xbmcaddon, xbmcplugin, urllib, urllib2, sys, time,
datetime, buggalo
settings = sys.modules["__main__"].settings
plugin = sys.modules["__main__"].plugin
useragent = 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101
Firefox/17.0'
def addListItem(label, image, url, isFolder, infoLabels = False, fanart =
False, duration = False):
listitem = xbmcgui.ListItem(label = label, iconImage = image,
thumbnailImage = image)
- if not isFolder: listitem.setProperty('IsPlayable', 'true')
- if fanart: listitem.setProperty('fanart_image', fanart)
+ if not isFolder:
+ if settings.getSetting('download') == '' or
settings.getSetting('download') == 'false':
+ listitem.setProperty('IsPlayable', 'true')
+ if fanart:
+ listitem.setProperty('fanart_image', fanart)
if infoLabels:
listitem.setInfo(type = 'video', infoLabels = infoLabels)
if duration:
@@ -20,9 +25,10 @@ def addListItem(label, image, url, isFolder, infoLabels =
False, fanart = False,
listitem.addStreamInfo('video', { 'duration':
int(duration) })
else:
listitem.setInfo(type = 'video', infoLabels = {
'duration': str(datetime.timedelta(milliseconds=int(duration)*1000)) } )
- u = sys.argv[0] + '?'
- for key, value in url.items():
- u += key + '=' + value + '&'
+ if url['mode']:
+ u = sys.argv[0] + '?' + urllib.urlencode(url)
+ else:
+ u = url['url']
ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u,
listitem = listitem, isFolder = isFolder)
return ok
@@ -86,12 +92,14 @@ def getPage(url, gzip = False):
data['error'] = str(e)
return data
-def setViewMode(id):
+def setViewMode(id, type = False):
+ if type == False: type = 'episodes'
if xbmc.getSkinDir() == 'skin.confluence':
- xbmcplugin.setContent(int( sys.argv[1] ), 'episodes')
- xbmc.executebuiltin('Container.SetViewMode(' + id + ')')
+ xbmcplugin.setContent(int( sys.argv[1] ), type)
+ if settings.getSetting('view') == 'true':
+ xbmc.executebuiltin('Container.SetViewMode(' + id + ')')
-#From CommonFunctions.py in parsedom
+#From http://wiki.xbmc.org/index.php?title=Add-on:Parsedom_for_xbmc_plugins
def getParameters(parameterString):
commands = {}
splitCommands = parameterString[parameterString.find('?') + 1:].split('&')
@@ -103,7 +111,7 @@ def getParameters(parameterString):
commands[key] = value
return commands
-#Original from
http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+#From
http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
def retry(ExceptionToCheck, tries = 10, delay = 3, backoff = 1, logger = None):
def deco_retry(f):
def f_retry(*args, **kwargs):
@@ -117,6 +125,7 @@ def retry(ExceptionToCheck, tries = 10, delay = 3, backoff
= 1, logger = None):
mtries, mdelay = tries, delay
else:
ok = dialog.ok(plugin,
settings.getLocalizedString( 30051 ))
+ buggalo.addExtraData('error',
str(e))
raise Exception("retry Error")
try:
return f(*args, **kwargs)
diff --git a/plugin.video.tmz/changelog.txt b/plugin.video.tmz/changelog.txt
index b07ea8f..707ff21 100644
--- a/plugin.video.tmz/changelog.txt
+++ b/plugin.video.tmz/changelog.txt
@@ -1,3 +1,10 @@
+[B]Version 3.0.11[/B]
+
+- Version bump for frodo
+- Fixed 'KeyError' in build_video_directory
+- Fixed ascii errors
+- Added setting for default view in Confluence skin
+
[B]Version 2.0.10[/B]
- Updated addon to support recent website changes.
diff --git a/plugin.video.tmz/default.py b/plugin.video.tmz/default.py
index 8cda23b..e67f856 100644
--- a/plugin.video.tmz/default.py
+++ b/plugin.video.tmz/default.py
@@ -5,8 +5,8 @@ import simplejson as json
plugin = 'TMZ'
__author__ = 'stacked <[email protected]>'
__url__ = 'http://code.google.com/p/plugin/'
-__date__ = '12-29-2012'
-__version__ = '2.0.10'
+__date__ = '01-13-2013'
+__version__ = '3.0.11'
settings = xbmcaddon.Addon( id = 'plugin.video.tmz' )
dbg = False
dbglevel = 3
@@ -36,7 +36,7 @@ def build_main_directory():
( settings.getLocalizedString( 30003 ), '0' )
]
for name, mode in main:
- u = { 'mode': mode, 'name': urllib.quote_plus(name) }
+ u = { 'mode': mode, 'name': name }
addListItem(label = name, image = icon, url = u, isFolder =
True, infoLabels = False, fanart = fanart)
xbmcplugin.addSortMethod( handle = int(sys.argv[1]), sortMethod =
xbmcplugin.SORT_METHOD_NONE )
setViewMode("515")
@@ -44,11 +44,11 @@ def build_main_directory():
@retry(IndexError)
def build_video_directory( name ):
- data = getUrl( 'http://www.tmz.com/videos/', True ).encode('ascii',
'ignore')
+ data = getUrl( 'http://www.tmz.com/videos/', True )
textarea = '[' + re.compile('{ name: \'' + name.upper() + '\',( )?\n
allInitialJson: {(.+?)},\n (slug|noPaging)?', re.DOTALL).findall(
data )[0][1].replace('\n', '').rsplit('[')[1].rsplit(']')[0] + ']'
- query = json.loads(textarea.decode('latin1').encode('utf8'))
+ query = json.loads(textarea)
for videos in query:
- title = clean(videos['title'].replace("\\", ""))
+ title = clean(videos['title'].replace("\\",
"")).encode('ascii', 'ignore')
duration = videos['duration'].replace("\\", "")
videoUrl = videos['videoUrl'].replace("\\", "")
thumb = videos['thumbnailUrl'].replace("\\", "") +
'/width/490/height/266/type/3'
@@ -58,7 +58,7 @@ def build_video_directory( name ):
else:
url = 'http://cdnapi.kaltura.com/p/' +
thumb.split('/')[4] + '/sp/' + thumb.split('/')[6] + '/playManifest/entryId/' +
videoUrl.split('_')[0].split('/')[-1:][0] + '_' + videoUrl.split('_')[1] +
'/flavorId/0_' + videoUrl.split('_')[3]
infoLabels = { "Title": title, "Plot": title,
"Duration": str(int(duration)/60) }
- u = { 'mode': '1', 'name': urllib.quote_plus(title),
'url': urllib.quote_plus(url), 'studio': urllib.quote_plus(name), 'thumb':
urllib.quote_plus(thumb) }
+ u = { 'mode': '1', 'name': title, 'url': url, 'studio':
name, 'thumb': thumb }
addListItem(label = title, image = thumb, url = u,
isFolder = False, infoLabels = infoLabels, fanart = fanart, duration = duration)
xbmcplugin.addSortMethod( handle = int(sys.argv[1]), sortMethod =
xbmcplugin.SORT_METHOD_NONE )
setViewMode("503")
@@ -94,7 +94,7 @@ def build_search_directory():
videoUrl = results['URL'].replace("\\", "")
thumb = results['thumbnailUrl'].replace("\\", "") +
'/width/490/height/266/type/3'
infoLabels = { "Title": title, "Plot": title }
- u = { 'mode': '3', 'name': urllib.quote_plus(title),
'url': urllib.quote_plus(videoUrl), 'thumb': urllib.quote_plus(thumb) }
+ u = { 'mode': '3', 'name': title, 'url': videoUrl,
'thumb': thumb }
addListItem(label = title, image = thumb, url = u,
isFolder = False, infoLabels = infoLabels, fanart = fanart)
xbmcplugin.addSortMethod( handle = int(sys.argv[1]), sortMethod =
xbmcplugin.SORT_METHOD_NONE )
setViewMode("503")
@@ -119,7 +119,7 @@ def play_video( name, url, thumb, studio ):
data = getUrl( url, True )
url = re.compile('<media
url=\"(.+?)\"').findall(data)[0]
except:
- url = 'http://www.tmz.com/videos/' + url.split('/')[9]
+ url = 'http://www.tmz.com/videos/' + thumb.split('/')[9]
data = getUrl( url, True )
url = common.parseDOM(data, "meta", attrs = { "name":
"VideoURL" }, ret = "content")[0]
infoLabels = { "Title": name , "Studio": "TMZ: " + studio, "Plot": name
}
diff --git a/plugin.video.tmz/resources/language/English/strings.xml
b/plugin.video.tmz/resources/language/English/strings.xml
index 1c14f79..568fdf8 100644
--- a/plugin.video.tmz/resources/language/English/strings.xml
+++ b/plugin.video.tmz/resources/language/English/strings.xml
@@ -15,4 +15,5 @@
<string id="30052">Retry</string>
<string id="30053">Quit</string>
<string id="30054">There was an index error.</string>
+ <string id="30055">Enable default view for Confluence skin</string>
</strings>
diff --git a/plugin.video.tmz/resources/settings.xml
b/plugin.video.tmz/resources/settings.xml
index 25ca008..4a7d81f 100644
--- a/plugin.video.tmz/resources/settings.xml
+++ b/plugin.video.tmz/resources/settings.xml
@@ -1,3 +1,4 @@
<settings>
<setting id="quality" type="enum" label="30004" lvalues="30005|30006"
default="1"/>
+ <setting id="view" type="bool" label="30055" default="true"/>
</settings>
-----------------------------------------------------------------------
Summary of changes:
plugin.video.pbs/addon.xml | 2 +-
plugin.video.pbs/addonfunc.py | 35 ++++---
plugin.video.pbs/changelog.txt | 8 ++
plugin.video.pbs/default.py | 105 ++++++++++++--------
.../resources/language/English/strings.xml | 4 +
plugin.video.pbs/resources/settings.xml | 4 +
plugin.video.tmz/addon.xml | 2 +-
plugin.video.tmz/addonfunc.py | 35 ++++---
plugin.video.tmz/changelog.txt | 7 ++
plugin.video.tmz/default.py | 18 ++--
.../resources/language/English/strings.xml | 1 +
plugin.video.tmz/resources/settings.xml | 1 +
12 files changed, 144 insertions(+), 78 deletions(-)
create mode 100644 plugin.video.pbs/resources/settings.xml
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons