The branch, frodo has been updated
via 56e178671e1ac8a3e91c51294ffe9f6f81249480 (commit)
from f1e5f583636148f14d520d1fc647799ded0545ac (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=56e178671e1ac8a3e91c51294ffe9f6f81249480
commit 56e178671e1ac8a3e91c51294ffe9f6f81249480
Author: beenje <bee...@xbmc.org>
Date: Sun Dec 1 22:39:32 2013 +0100
[plugin.video.cbsnews_com] updated to version 2.0.8
diff --git a/plugin.video.cbsnews_com/addon.xml
b/plugin.video.cbsnews_com/addon.xml
index 7278a2b..5a3a8af 100644
--- a/plugin.video.cbsnews_com/addon.xml
+++ b/plugin.video.cbsnews_com/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.cbsnews_com" name="CBSnews.com" version="2.0.7"
provider-name="AddonScriptorDE">
+<addon id="plugin.video.cbsnews_com" name="CBSnews.com" version="2.0.8"
provider-name="AddonScriptorDE">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
@@ -8,8 +8,13 @@
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
- <summary lang="en">Various news and shows (60 Minutes, 48 Hours, Face
the nation, ...)</summary>
+ <summary lang="en">Various news and shows (60 Minutes, 48 Hours,
...)</summary>
<language>en</language>
- <description lang="en">Various news and shows (60 Minutes, 48 Hours,
Face the nation, ...)</description>
+ <description lang="en">Various news and shows (60 Minutes, 48 Hours,
...)</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+
<source>https://github.com/AddonScriptorDE/plugin.video.cbsnews_com</source>
+ <forum>http://forum.xbmc.org/showthread.php?tid=136416</forum>
+ <email>AddonScriptorDE at yahoo dot de</email>
+ <website>http://www.cbsnews.com/videos</website>
</extension>
</addon>
diff --git a/plugin.video.cbsnews_com/changelog.txt
b/plugin.video.cbsnews_com/changelog.txt
index 40bb4c7..06bfa3a 100644
--- a/plugin.video.cbsnews_com/changelog.txt
+++ b/plugin.video.cbsnews_com/changelog.txt
@@ -1,5 +1,5 @@
1.0.0
-- First Try
+- Initial release
1.0.1
- Fixed small bug
1.0.2
@@ -15,3 +15,5 @@
1.0.7
- Changed navigation on 60 minutes and Evening news
- Fixed search
+2.0.8
+- Rewrote addon because of new video site layout
diff --git a/plugin.video.cbsnews_com/default.py
b/plugin.video.cbsnews_com/default.py
index 1b199c6..1a0ec8a 100644
--- a/plugin.video.cbsnews_com/default.py
+++ b/plugin.video.cbsnews_com/default.py
@@ -1,334 +1,212 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-import
urllib,urllib2,re,xbmcplugin,xbmcgui,sys,xbmcaddon,base64,httplib,socket,time
-
+import urllib
+import urllib2
+import socket
+import sys
+import re
+import json
+import xbmcplugin
+import xbmcgui
+import xbmcaddon
+
+addon = xbmcaddon.Addon()
socket.setdefaulttimeout(30)
pluginhandle = int(sys.argv[1])
-addon = xbmcaddon.Addon(id='plugin.video.cbsnews_com')
-translation = addon.getLocalizedString
-
-forceViewMode=addon.getSetting("forceViewMode")
-if forceViewMode=="true":
- forceViewMode=True
-else:
- forceViewMode=False
-viewMode=str(addon.getSetting("viewMode"))
+addonID = addon.getAddonInfo('id')
+icon = xbmc.translatePath('special://home/addons/'+addonID+'/icon.png')
+forceViewMode = addon.getSetting("forceView") == "true"
+viewIDVideos = str(addon.getSetting("viewIDVideos"))
+viewIDEpisodes = str(addon.getSetting("viewIDEpisodes"))
+urlMain = "http://www.cbsnews.com"
-maxBitRate=addon.getSetting("maxBitRate")
-qual=[500,1000,1500,2000,3000]
-maxBitRate=qual[int(maxBitRate)]
def index():
- content = getUrl("http://www.cbsnews.com/video/")
- spl=content.split('<li><h2><a href=')
- for i in range(1,len(spl),1):
- entry=spl[i]
- match=re.compile('"(.+?)"', re.DOTALL).findall(entry)
- nextUrl=match[0]
- match=re.compile('nodeid="(.+?)"', re.DOTALL).findall(entry)
- match2=re.compile('nodeId="(.+?)"', re.DOTALL).findall(entry)
- if len(match)>0:
- noteId=match[0]
- elif len(match2)>0:
- noteId=match2[0]
- match=re.compile('slug="(.+?)">(.+?)<', re.DOTALL).findall(entry)
- title=match[0][1]
- title=cleanTitle(title)
- match=re.compile('pagetype="(.+?)"', re.DOTALL).findall(entry)
- if len(match)>0:
- pageType=match[0]
- else:
- pageType="1611"
-
url="http://www.cbsnews.com/"+pageType+"-"+noteId+"_162-1.html?nomesh"
- if title=="Evening News":
- addDir(title,"",'listEveningMain',"")
- elif title=="60 Minutes":
- addDir(title,"",'list60MinutesMain',"")
- elif title=="48 Hours":
- addDir(title,nextUrl,'listVideos',"")
- else:
- addDir(title,url+"#"+nextUrl,'listLatest',"")
- addDir("Up To The
Minute","http://www.cbsnews.com/2076-3455_162-0.html",'listVideos',"")
- addDir(translation(30002),"",'search',"")
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
-
-def listEveningMain():
- addLink(translation(30004),"",'playEveningLatest',"")
-
addDir(translation(30005),"http://www.cbsnews.com/2003-503445_162-0.html",'listVideos',"")
-
addDir(translation(30006),"http://www.cbsnews.com/video/eveningnews/",'listVideos',"")
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
-
-def list60MinutesMain():
- content = getUrl("http://www.cbsnews.com/60-minutes/")
- match=re.compile('<strong
class="sideScrollerTitle"><span>(.+?)</span></strong>',
re.DOTALL).findall(content)
- for title in match:
- addDir(title,title,'list60Minutes',"")
-
addDir(translation(30007),"http://www.cbsnews.com/video/60minutes/",'listVideos',"")
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
-
-def list60Minutes(title):
- content = getUrl("http://www.cbsnews.com/60-minutes/")
- content = content[content.find('<strong
class="sideScrollerTitle"><span>'+title+'</span></strong>'):]
- content = content[:content.find('</ul>'):]
- match=re.compile('<li class="promoBox"> <a
href="(.+?)"(.+?)loadsrc="(.+?)"(.+?)class="assetTitle">(.+?)</a> <p
class="storySub">(.+?)</p> </li>', re.DOTALL).findall(content)
- for url, temp, thumb, temp2, title, date in match:
- fullDate=date
- date=date.strip().replace(",","")
- dateTemp = time.strptime(date, '%B %d %Y')
- dateShort = time.strftime("%m/%d", dateTemp)
- title=dateShort+" - "+title
- addLink(title,url,'playVideo',thumb,fullDate)
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
-
-def playEveningLatest():
- content = getUrl("http://www.cbsnews.com/2003-503445_162-0.html")
- match=re.compile('<li> <a href="(.+?)"(.+?)alt="(.+?)"',
re.DOTALL).findall(content)
- playVideo(match[0][0], match[0][2])
-
-def listLatest(url):
- spl=url.split("#")
- url=spl[0]
- nextUrl=spl[1]
- content = getUrl(url)
- spl=content.split('<li class="promoBox">')
- for i in range(1,len(spl),1):
- entry=spl[i]
- match=re.compile('href="(.+?)"', re.DOTALL).findall(entry)
- url=match[0]
- if url.find("/video/watch/")==0:
- url="http://www.cbsnews.com"+url
- match=re.compile('<p class="assetDek">(.+?)</p>',
re.DOTALL).findall(entry)
- desc=""
- if len(match)>0:
- desc=match[0]
- desc=cleanTitle(desc)
- match=re.compile('class="assetTitle">(.+?)</a>',
re.DOTALL).findall(entry)
- title=match[0]
- title=cleanTitle(title)
- match=re.compile('<span class="duration">(.+?)</span>(.+?)</p>',
re.DOTALL).findall(entry)
- length=""
- date=""
- if len(match)>0:
- length=match[0][0]
- length=str(int(length[:length.find(":")])+1)
- date=match[0][1]
- date=date[:date.find("|")].strip().replace(",","")
- dateTemp = time.strptime(date, '%B %d %Y')
- dateShort = time.strftime("%m/%d", dateTemp)
- title=dateShort+" - "+title
- desc=date+"\n"+desc
- match=re.compile('src="(.+?)"', re.DOTALL).findall(entry)
- thumb=match[0]
- addLink(title,url,'playVideo',thumb,desc,length)
- if nextUrl.find("/video/")>=0:
- addDir(translation(30003),nextUrl,'listVideos',"")
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
-
-def listVideos(url):
- if "http://" not in url:
- url="http://www.cbsnews.com"+url
- urlMain=url
- content = getUrl(url)
- tempTitle=""
- match=re.compile('http://www.cbsnews.com/video/(.+?)/',
re.DOTALL).findall(url)
- if len(match)>0:
- tempTitle=match[0]
- if content.find('<div style="background-image')>=0 and
"http://www.cbsnews.com/2003-503445_162-0" not in urlMain:
- spl=content.split('<div style="background-image')
- for i in range(1,len(spl),1):
- entry=spl[i]
- match=re.compile('<h2 class="storyTitle"><a
href="(.+?)">(.+?)</a></h2>', re.DOTALL).findall(entry)
- url=match[0][0]
- title=match[0][1]
- title=cleanTitle(title)
- match=re.compile('<p class="datestamp">(.+?)</p>',
re.DOTALL).findall(entry)
- date=""
- if len(match)>0:
- date=match[0].replace('<span class="separatorGrey">','')
- date=date[:date.find("|")].strip().replace(",","")
- dateTemp = time.strptime(date, '%B %d %Y')
- dateShort = time.strftime("%m/%d", dateTemp)
- title=dateShort+" - "+title
- match=re.compile('<p class="storyDek">(.+?)</p>',
re.DOTALL).findall(entry)
- desc=""
- if len(match)>0:
- desc=match[0]
- desc=cleanTitle(desc)
- if date!="":
- desc=date+"\n"+desc
- match=re.compile("url\\('(.+?)'\\)", re.DOTALL).findall(entry)
- thumb=match[0]
- addLink(title,url,'playVideo',thumb,desc)
- elif content.find('<li> <a
href="http://www.cbsnews.com/video/watch/')>=0 or content.find('<li> <a
href="/video/watch/')>=0:
- if content.find('<li> <a
href="http://www.cbsnews.com/video/watch/')>=0:
- spl=content.split('<li> <a
href="http://www.cbsnews.com/video/watch/')
- elif content.find('<li> <a href="/video/watch/')>=0:
- spl=content.split('<li> <a href="/video/watch/')
- for i in range(1,len(spl),1):
- entry=spl[i]
- match=re.compile('alt=(.+?)/>', re.DOTALL).findall(entry)
- title=match[0]
- title=cleanTitle(title).replace('"','')
- url="http://www.cbsnews.com/video/watch/"+entry[:entry.find('"')]
- match=re.compile('<p class="datestamp">(.+?)</p>',
re.DOTALL).findall(entry)
- date=""
- if len(match)>0:
- date=match[0].replace('<span class="separatorGrey">','')
- date=date[:date.find("|")].strip().replace(",","")
- dateTemp = time.strptime(date, '%B %d %Y')
- dateShort = time.strftime("%m/%d", dateTemp)
- if "http://www.cbsnews.com/2003-503445_162-0" not in urlMain:
- title=dateShort+" - "+title
- match=re.compile('<p class="storyDek">(.+?)</p>',
re.DOTALL).findall(entry)
- desc=""
- if len(match)>0:
- desc=match[0]
- desc=cleanTitle(desc)
- match=re.compile('src="(.+?)"', re.DOTALL).findall(entry)
- thumb=match[0]
- addLink(title,url,'playVideo',thumb,date+"\n"+desc)
- matchPage=re.compile('<li class="next"> <a href="(.+?)">',
re.DOTALL).findall(content)
- matchPage2=re.compile('<li class="next" section="next"><a href="(.+?)"
rel="next">', re.DOTALL).findall(content)
- urlNext=""
- if len(matchPage)>0:
- urlNext=matchPage[0]
- if len(matchPage2)>0:
- urlNext=matchPage2[0]
- if urlNext!="":
- if urlNext.find("/video//")>=0:
- urlNext=urlNext.replace("/video//","/video/"+tempTitle+"/")
- addDir(translation(30001),urlNext,'listVideos',"")
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
+ xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
+ addDir("- "+translation(30002), "", "search", icon)
+ content = getUrl(urlMain+"/videos")
+ match = re.compile('<a href="/videos/topics/(.+?)/">(.+?)</a>',
re.DOTALL).findall(content)
+ for id, title in match:
+ if id=="48-hours":
+ addDir(title, urlMain+"/latest/"+id+"/full-episodes/1",
'listEpisodes', icon)
+ elif id=="60-minutes":
+ addDir(title, id, 'list60MinutesMain', icon)
+ elif id=="evening-news":
+ addDir(title, id, 'listEveningNewsMain', icon)
+ else:
+ addDir2(title.replace("Popular","- Popular"), 'listVideos', icon,
"category", id.replace("popular",""), "0")
+ xbmcplugin.endOfDirectory(pluginhandle)
+
+
+def listVideos(type, value, offset):
+ xbmcplugin.setContent(pluginhandle, "episodes")
+ content =
getUrl(urlMain+"/videos/loadmore?type="+type+"&value="+value+"&offset="+offset)
+ content = json.loads(content)
+ for item in content:
+ video = content[item]
+ url = urlMain+"/videos/"+video["slug"]+"/"
+ #Does not work randomly: GetImageHash - unable to stat url ...
+ #thumb = video["image"]["full"]
+ thumb = video["image"]["path"]
+ if "?" in thumb:
+ thumb = thumb[:thumb.find("?")]
+ addLink(video["title"], url, 'playVideo', thumb, video["dek"],
video["date"].split(" ")[0], video["duration"], video["season"],
video["episode"])
+ addDir2(translation(30001), 'listVideos', "", type, value,
str(int(offset)+30))
+ xbmcplugin.endOfDirectory(pluginhandle)
+ if forceViewMode:
+ xbmc.executebuiltin('Container.SetViewMode('+viewIDVideos+')')
+
+
+def listEpisodes(url):
+ xbmcplugin.setContent(pluginhandle, "episodes")
+ content = getUrl(url)
+ content = content[content.find('<div class="media-list'):]
+ content = content[:content.find('</ul>')]
+ spl=content.split('<li>')
+ for i in range(1,len(spl),1):
+ entry=spl[i]
+ match=re.compile('href="(.+?)"', re.DOTALL).findall(entry)
+ urlEpisode=urlMain+match[0]
+ match=re.compile('<h3 class="title".+?>(.+?)</h3>',
re.DOTALL).findall(entry)
+ title=cleanTitle(match[0])
+ match=re.compile('<p class="dek">(.+?)</p>', re.DOTALL).findall(entry)
+ desc=cleanTitle(match[0])
+ match=re.compile('src="(.+?)"', re.DOTALL).findall(entry)
+ thumb=match[0]
+ match=re.compile('<span class="date">(.+?)</span>',
re.DOTALL).findall(entry)
+ date=match[0]
+ addLink(title, urlEpisode, 'playVideo', thumb, date+"\n"+desc)
+ currentPage = url.split("/")[-1]
+ nextPage = str(int(currentPage)+1)
+ addDir(translation(30001), url.replace("/full-episodes/"+currentPage,
"/full-episodes/"+nextPage), 'listEpisodes', "")
+ xbmcplugin.endOfDirectory(pluginhandle)
+ if forceViewMode:
+ xbmc.executebuiltin('Container.SetViewMode('+viewIDEpisodes+')')
+
+
+def list60MinutesMain(id):
+ addDir(translation(30003), urlMain+"/latest/"+id+"/full-episodes/1",
'listEpisodes', "")
+ addDir2(translation(30004), 'listVideos', "", "category", id, "0")
+ xbmcplugin.endOfDirectory(pluginhandle)
+
+
+def listEveningNewsMain(id):
+ addLink(translation(30005),"",'playEveningNewsLatest',"")
+ addDir(translation(30003), urlMain+"/latest/"+id+"/full-episodes/1",
'listEpisodes', "")
+ addDir2(translation(30004), 'listVideos', "", "category", id, "0")
+ xbmcplugin.endOfDirectory(pluginhandle)
+
+
+def playEveningNewsLatest():
+ content = getUrl(urlMain+"/latest/evening-news/full-episodes/1")
+ content = content[content.find('<div class="media-list'):]
+ content = content[:content.find('<ul>')]
+ spl=content.split('<li>')
+ entry=spl[1]
+ match=re.compile('href="(.+?)"', re.DOTALL).findall(entry)
+ url=urlMain+match[0]
+ match=re.compile('<h3 class="title".+?>(.+?)</h3>',
re.DOTALL).findall(entry)
+ title=cleanTitle(match[0])
+ match=re.compile('src="(.+?)"', re.DOTALL).findall(entry)
+ thumb=match[0]
+ playVideo(url, title, thumb)
+
+
+def playVideo(url, title="", thumb="DefaultVideo.png"):
+ content = getUrl(url)
+ match=re.compile('"mediaHlsURI":"(.+?)"', re.DOTALL).findall(content)
+ listitem = xbmcgui.ListItem(path=match[0].replace("\\",""),
thumbnailImage=thumb)
+ if title:
+ listitem.setInfo( type="Video", infoLabels={ "Title": title } )
+ xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
+
def search():
- keyboard = xbmc.Keyboard('', translation(30002))
- keyboard.doModal()
- if keyboard.isConfirmed() and keyboard.getText():
- search_string = keyboard.getText().replace(" ","+")
-
listSearchResults('http://www.cbsnews.com/1770-5_162-0.html?query='+search_string+'&searchtype=cbsSearch&pageType=14&rpp=30')
-
-def listSearchResults(url):
- content = getUrl(url)
- spl=content.split('<li section=')
- for i in range(1,len(spl),1):
- entry=spl[i]
- match=re.compile('<span class="date">(.+?)<',
re.DOTALL).findall(entry)
- date=match[0]
- match=re.compile('href="(.+?)"', re.DOTALL).findall(entry)
- url=match[0]
- match=re.compile('class="title">(.+?)<', re.DOTALL).findall(entry)
- title=match[0]
- title=cleanTitle(title)
- match=re.compile('src="(.+?)"', re.DOTALL).findall(entry)
- thumb=""
- if len(match)>0:
- thumb=match[0]
- addLink(title,url,'playVideo',thumb,date)
- xbmcplugin.endOfDirectory(pluginhandle)
- if forceViewMode==True:
- xbmc.executebuiltin('Container.SetViewMode('+viewMode+')')
-
-def playVideo(url,title=""):
- content = getUrl(url)
- match=re.compile('setVideoId\\("(.+?)"\\)', re.DOTALL).findall(content)
- match2=re.compile('setVideoId\\((.+?)\\)', re.DOTALL).findall(content)
- if len(match)>0:
- id=match[0]
- elif len(match2)>0:
- id=match2[0]
- content =
getUrl("http://api.cnet.com/rest/v1.0/video?videoId="+id+"&iod=videoMedia&players=Download,Streaming")
- spl=content.split('<VideoMedia id=')
- maxBitrateTemp=0
- finalUrl=""
- for i in range(1,len(spl),1):
- entry=spl[i]
- if entry.find("<DeliveryUrl>")>=0:
- match=re.compile('<BitRate>(.+?)</BitRate>',
re.DOTALL).findall(entry)
- bitrate=int(match[0])
- if bitrate>maxBitrateTemp and bitrate<=maxBitRate:
- maxBitrateTemp=bitrate
-
match=re.compile('<DeliveryUrl><!\\[CDATA\\[(.+?)\\]\\]></DeliveryUrl>',
re.DOTALL).findall(entry)
- finalUrl=match[0]
- if finalUrl!="":
- listitem = xbmcgui.ListItem(path=finalUrl)
- if title!="":
- listitem.setInfo( type="Video", infoLabels={ "Title": title } )
- xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
+ keyboard = xbmc.Keyboard('', translation(30002))
+ keyboard.doModal()
+ if keyboard.isConfirmed() and keyboard.getText():
+ search_string = keyboard.getText().replace(" ", "+")
+ listVideos("search", search_string, "0")
+
def cleanTitle(title):
-
title=title.replace("<","<").replace(">",">").replace("&","&").replace("'","'").replace(""","\"").replace("ß","Ã").replace("–","-")
-
title=title.replace("Ä","Ã").replace("Ü","Ã").replace("Ö","Ã").replace("ä","ä").replace("ü","ü").replace("ö","ö")
- title=title.strip()
- return title
+ title = title.replace("<", "<").replace(">", ">").replace("&",
"&").replace("'", "'").replace(""", "\"").replace("ß",
"Ã").replace("–", "-")
+ title = title.replace("Ä", "Ã").replace("Ü",
"Ã").replace("Ö", "Ã").replace("ä", "ä").replace("ü",
"ü").replace("ö", "ö")
+ title = title.strip()
+ return title
+
def getUrl(url):
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:16.0)
Gecko/20100101 Firefox/16.0')
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- return link
+ req = urllib2.Request(url)
+ req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:25.0)
Gecko/20100101 Firefox/25.0')
+ response = urllib2.urlopen(req)
+ link = response.read()
+ response.close()
+ return link
+
+
+def translation(id):
+ return addon.getLocalizedString(id).encode('utf-8')
+
def parameters_string_to_dict(parameters):
- ''' Convert parameters encoded in a URL to a dict. '''
- paramDict = {}
- if parameters:
- paramPairs = parameters[1:].split("&")
- for paramsPair in paramPairs:
- paramSplits = paramsPair.split('=')
- if (len(paramSplits)) == 2:
- paramDict[paramSplits[0]] = paramSplits[1]
- return paramDict
-
-def addLink(name,url,mode,iconimage,desc="",duration=""):
- u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png",
thumbnailImage=iconimage)
- liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": desc,
"Duration": duration } )
- liz.setProperty('IsPlayable', 'true')
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz)
- return ok
-
-def addDir(name,url,mode,iconimage,desc=""):
- u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
- liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": desc } )
-
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
- return ok
-
-params=parameters_string_to_dict(sys.argv[2])
-mode=params.get('mode')
-url=params.get('url')
-if type(url)==type(str()):
- url=urllib.unquote_plus(url)
+ ''' Convert parameters encoded in a URL to a dict. '''
+ paramDict = {}
+ if parameters:
+ paramPairs = parameters[1:].split("&")
+ for paramsPair in paramPairs:
+ paramSplits = paramsPair.split('=')
+ if (len(paramSplits)) == 2:
+ paramDict[paramSplits[0]] = paramSplits[1]
+ return paramDict
+
+
+def addLink(name, url, mode, iconimage, desc="", date="", duration="",
season="", episode=""):
+ u =
sys.argv[0]+"?mode="+urllib.quote_plus(mode)+"&url="+urllib.quote_plus(url)
+ ok = True
+ liz = xbmcgui.ListItem(name, iconImage="DefaultVideo.png",
thumbnailImage=iconimage)
+ liz.setInfo(type="Video", infoLabels={"title": name, "plot": desc,
"aired": date, "season": season, "episode": episode})
+ liz.setProperty('IsPlayable', 'true')
+ if duration:
+ liz.addStreamInfo('video', {'duration': int(duration)})
+ ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u,
listitem=liz)
+ return ok
+
+
+def addDir(name,url,mode,iconimage):
+ u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)
+ ok=True
+ liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
+ liz.setInfo( type="Video", infoLabels={ "Title": name } )
+
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+ return ok
+
+
+def addDir2(name, mode, iconimage, type="", value="", offset=""):
+ u =
sys.argv[0]+"?mode="+urllib.quote_plus(mode)+"&type="+urllib.quote_plus(type)+"&value="+urllib.quote_plus(value)+"&offset="+urllib.quote_plus(offset)
+ ok = True
+ liz = xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=iconimage)
+ liz.setInfo(type="Video", infoLabels={"Title": name})
+ ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u,
listitem=liz, isFolder=True)
+ return ok
+
+params = parameters_string_to_dict(sys.argv[2])
+mode = urllib.unquote_plus(params.get('mode', ''))
+url = urllib.unquote_plus(params.get('url', ''))
+type = urllib.unquote_plus(params.get('type', ''))
+value = urllib.unquote_plus(params.get('value', ''))
+offset = urllib.unquote_plus(params.get('offset', ''))
if mode == 'listVideos':
- listVideos(url)
-elif mode == 'listLatest':
- listLatest(url)
-elif mode == 'listEveningMain':
- listEveningMain()
+ listVideos(type, value, offset)
+elif mode == 'listEpisodes':
+ listEpisodes(url)
elif mode == 'list60MinutesMain':
- list60MinutesMain()
-elif mode == 'list60Minutes':
- list60Minutes(url)
-elif mode == 'listSearchResults':
- listSearchResults(url)
-elif mode == 'playEveningLatest':
- playEveningLatest()
+ list60MinutesMain(url)
+elif mode == 'listEveningNewsMain':
+ listEveningNewsMain(url)
+elif mode == 'playEveningNewsLatest':
+ playEveningNewsLatest()
elif mode == 'playVideo':
playVideo(url)
elif mode == 'search':
diff --git a/plugin.video.cbsnews_com/resources/language/English/strings.xml
b/plugin.video.cbsnews_com/resources/language/English/strings.xml
index 3c33265..3b14424 100644
--- a/plugin.video.cbsnews_com/resources/language/English/strings.xml
+++ b/plugin.video.cbsnews_com/resources/language/English/strings.xml
@@ -2,12 +2,10 @@
<strings>
<string id="30001">Next Page</string>
<string id="30002">Search</string>
- <string id="30003">All Videos</string>
- <string id="30004">Play latest episode</string>
- <string id="30005">Show all episodes</string>
- <string id="30006">Show all clips</string>
- <string id="30007">Older videos</string>
- <string id="30101">Maximum Bitrate</string>
- <string id="30102">Force View</string>
- <string id="30103">ViewID</string>
+ <string id="30003">Full episodes</string>
+ <string id="30004">All videos</string>
+ <string id="30005">Play latest episode</string>
+ <string id="30101">Force View</string>
+ <string id="30102">ViewID (Videos)</string>
+ <string id="30103">ViewID (Episodes)</string>
</strings>
diff --git a/plugin.video.cbsnews_com/resources/language/German/strings.xml
b/plugin.video.cbsnews_com/resources/language/German/strings.xml
index b054bed..b4c1439 100644
--- a/plugin.video.cbsnews_com/resources/language/German/strings.xml
+++ b/plugin.video.cbsnews_com/resources/language/German/strings.xml
@@ -2,7 +2,8 @@
<strings>
<string id="30001">Nächste Seite</string>
<string id="30002">Suchen</string>
- <string id="30003">Alle Videos</string>
- <string id="30101">Maximale Bitrate</string>
- <string id="30102">View erzwingen</string>
+ <string id="30003">Ganze Folgen</string>
+ <string id="30004">Alle Videos</string>
+ <string id="30005">Letzte Folge abspielen</string>
+ <string id="30101">View erzwingen</string>
</strings>
diff --git a/plugin.video.cbsnews_com/resources/settings.xml
b/plugin.video.cbsnews_com/resources/settings.xml
index 9a1ff6f..bea0839 100644
--- a/plugin.video.cbsnews_com/resources/settings.xml
+++ b/plugin.video.cbsnews_com/resources/settings.xml
@@ -1,5 +1,5 @@
<settings>
- <setting id="maxBitRate" type="enum" label="30101"
values="500kb|1000kb|1500kb|2000kb|3000kb" default="4"/>
- <setting id="forceViewMode" type="bool" label="30102" default="false"/>
- <setting id="viewMode" type="number" label="30103" default="500"/>
+ <setting id="forceView" type="bool" label="30101" default="true"/>
+ <setting id="viewIDVideos" type="number" label="30102" enable="eq(-1,true)"
default="504"/>
+ <setting id="viewIDEpisodes" type="number" label="30103"
enable="eq(-2,true)" default="503"/>
</settings>
-----------------------------------------------------------------------
Summary of changes:
plugin.video.cbsnews_com/addon.xml | 11 +-
plugin.video.cbsnews_com/changelog.txt | 4 +-
plugin.video.cbsnews_com/default.py | 504 ++++++++------------
.../resources/language/English/strings.xml | 14 +-
.../resources/language/German/strings.xml | 7 +-
plugin.video.cbsnews_com/resources/settings.xml | 6 +-
6 files changed, 215 insertions(+), 331 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons