The branch, frodo has been updated
via d2db6734ab86583894fd2d61dcd4a95b8e08e828 (commit)
from f6ee503ef86d3917ba1fa2b2f68a67e2105930d1 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=d2db6734ab86583894fd2d61dcd4a95b8e08e828
commit d2db6734ab86583894fd2d61dcd4a95b8e08e828
Author: Martijn Kaijser <[email protected]>
Date: Wed Oct 16 08:26:50 2013 +0200
[plugin.video.rt] 1.7.1
diff --git a/plugin.video.rt/README.txt b/plugin.video.rt/README.txt
index e1e92cf..4056412 100644
--- a/plugin.video.rt/README.txt
+++ b/plugin.video.rt/README.txt
@@ -6,3 +6,12 @@ XBMC Addon for Russia Today News
version 0.0.3 release
- live stream video channel
- rt.com/shows website archives
+
+version 0.1.0
+added strings.xml, required fields in addon.xml
+
+version 1.2.0 added content-encoding == gzip support
+
+version 1.5.0 added support for Kaltura videoes (Larry King Live & Politicking)
+
+version 1.7.1 added program icons and multiple pages
\ No newline at end of file
diff --git a/plugin.video.rt/addon.xml b/plugin.video.rt/addon.xml
index 4ff20ed..e3e7926 100644
--- a/plugin.video.rt/addon.xml
+++ b/plugin.video.rt/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.rt"
name="Russia Today News"
- version="0.0.3"
+ version="1.7.1"
provider-name="t1m">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
@@ -16,5 +16,10 @@
<disclaimer lang="en">Feel free to use this script. For information visit
the wiki.</disclaimer>
<platform>all</platform>
<language>en</language>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+
<forum>http://wiki.xbmc.org/index.php?title=Add-on:Russia_Today_News</forum>
+ <website></website>
+ <email></email>
+ <source>http://mirrors.xbmc.org/addons/frodo/plugin.video.rt/</source>
</extension>
</addon>
diff --git a/plugin.video.rt/changelog.txt b/plugin.video.rt/changelog.txt
index 27caa79..fbaa23a 100644
--- a/plugin.video.rt/changelog.txt
+++ b/plugin.video.rt/changelog.txt
@@ -1 +1,9 @@
-Version 0.0.3 Initial release
\ No newline at end of file
+Version 0.0.3 Initial release
+
+Version 0.1.0 added strings.xml, required fields in addon.xml
+
+version 1.2.0 added content-encoding == gzip support
+
+version 1.5.0 added support for Kaltura videoes (Larry King Live & Politicking)
+
+version 1.7.1 issue with addons.xml
\ No newline at end of file
diff --git a/plugin.video.rt/default.py b/plugin.video.rt/default.py
index cdd0876..1afcf7c 100644
--- a/plugin.video.rt/default.py
+++ b/plugin.video.rt/default.py
@@ -12,11 +12,14 @@ import xbmcgui
import xbmcaddon
import xbmcvfs
import cgi
+from StringIO import StringIO
+import gzip
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3)
Gecko/2008092417 Firefox/3.0.3'
-
addon = xbmcaddon.Addon('plugin.video.rt')
__addonname__ = addon.getAddonInfo('name')
+__language__ = addon.getLocalizedString
+
home = addon.getAddonInfo('path').decode('utf-8')
icon = xbmc.translatePath(os.path.join(home, 'icon.png'))
fanart = xbmc.translatePath(os.path.join(home, 'fanart.jpg'))
@@ -31,7 +34,7 @@ def log(txt):
def _parse_argv():
- global url,name,iconimage, mode, playlist,fchan,fres,fhost,fname,fepg
+ global url,name,iconimage, mode,
playlist,fchan,fres,fhost,fname,fepg,fanArt
params = {}
try:
@@ -42,7 +45,7 @@ def _parse_argv():
url = demunge(params.get("url",None))
name = demunge(params.get("name",""))
iconimage = demunge(params.get("iconimage",""))
-# fanart = demunge(params.get("fanart",""))
+ fanArt = demunge(params.get("fanart",""))
playlist = demunge(params.get("playlist",""))
fchan = demunge(params.get("fchan",""))
fres = demunge(params.get("fres",""))
@@ -72,35 +75,51 @@ def demunge(munge):
-
-
-
-
-def getSources():
-
- log("RT -- RT Live main page")
- req = urllib2.Request("http://www.rt.com/shows")
+def getRequest(url):
+ log("RT - getRequest URL: "+str(url))
+ req = urllib2.Request(url.encode('utf-8'))
req.add_header('User-Agent', USER_AGENT)
+ req.add_header('Accept',"text/html")
+ req.add_header('Accept-Encoding', None )
+ req.add_header('Accept-Encoding', 'deflate,sdch')
+ req.add_header('Accept-Language', 'en-US,en;q=0.8')
+ req.add_header('Cookie','hide_ce=true')
+ log("RT -- request headers = "+str(req.header_items()))
try:
response = urllib2.urlopen(req)
- link1=response.read()
+ if response.info().getheader('Content-Encoding') == 'gzip':
+ log("RT -- Content Encoding == 'gzip")
+ buf = StringIO( response.read())
+ f = gzip.GzipFile(fileobj=buf)
+ link1 = f.read()
+ else:
+ link1=response.read()
response.close()
except:
link1 = ""
+ return(link1)
+
+
+def getSources():
+ log("RT -- RT Live main page")
+ link1 = getRequest("http://rt.com/shows/")
addLink("rtmp://rt.fms-04.visionip.tv/live/rt-global-live-HD","Live",icon,fanart,"Live
HD Stream","News","",False)
link=str(link1).replace('\n','')
- match=re.compile('<ul
class="nav-extra">(.+?)</ul>').findall(str(link))
- for catblock in match:
- match=re.compile('<li><a
href="(.+?)">(.+?)</a></li>').findall(str(catblock))
- for caturl, cattext in match:
+
+ match=re.compile('<p class="shows-gallery_bottom_link"><a
href="(.+?)".+?<img
src="(.+?)".+?class="shows-gallery_bottom_text_header">(.+?)</span>(.+?)</p>').findall(str(link))
+
+ for caturl,caticon,cattitle,catdesc in match:
+
+ catdesc =
catdesc.replace('<P>','').replace('<p>','').replace('</P>','')
+ caticon = caticon.replace('.a.','.gp.')
+ caticon = "http://rt.com"+caticon
try:
- addDir(cattext.encode('utf-8',
'ignore'),caturl.encode('utf-8'),18,icon,fanart,cattext,"News","",False)
+ addDir(cattitle.encode('utf-8',
'ignore'),caturl.encode('utf-8'),18,caticon,caticon,catdesc,"News","",False)
except:
log("RT -- Problem adding directory")
-
def play_playlist(name, list):
playlist = xbmc.PlayList(1)
playlist.clear()
@@ -174,8 +193,15 @@ _parse_argv()
log("RT -- Mode: "+str(mode))
if not url is None:
- print "RT -- URL: "+str(url.encode('utf-8'))
-log("RT -- Name: "+str(name))
+ try:
+ log("RT -- URL: "+str(url.encode('utf-8')))
+ except:
+ pass
+
+try:
+ log("RT -- Name: "+str(name))
+except:
+ pass
if mode==None:
log("RT -- getSources")
@@ -195,64 +221,66 @@ elif mode==13:
elif mode==18:
log("RT -- Processing RT sub category item")
url = "http://rt.com"+url
- req = urllib2.Request(url.encode('utf-8'))
- log("RT -- req === "+str(req))
- req.add_header('User-Agent', USER_AGENT)
- try:
- response = urllib2.urlopen(req)
- link1=response.read()
- response.close()
- except:
- link1 = ""
+ link1 = getRequest(url)
link=str(link1).replace('\n','')
+
match = re.compile('<dt
class="(.+?)"(.+?)</dl>').findall(str(link))
for classtype, classdata in match:
if "programm" in classtype:
match = re.compile('<a
href="(.+?)".+?class="header">(.+?)<.+?<img src="(.+?)".+?<dd>(.+?)<span
class="time">(.+?)<').findall(str(classdata))
for pgurl,cattitle,imgurl,catdesc, cattime in match:
- caturl =
"plugin://plugin.video.rt/?url=http://rt.com"+pgurl+"&mode=19"
+ caturl =
"plugin://plugin.video.rt/?url=http://rt.com"+pgurl+"&name="+urllib.quote_plus(cattitle)+"&mode=19"
caticon = "http://rt.com"+imgurl
+ catdesc = catdesc.strip()
try:
-
addLink(caturl.encode('utf-8'),str(cattitle),caticon,fanart,cattime+"\n"+catdesc,"News","")
+
addLink(caturl.encode('utf-8'),cattitle,caticon,fanArt,cattime+"\n"+catdesc,"News","")
except:
log("RT -- Problem adding directory")
else:
match = re.compile('<a href="(.+?)".+?<img
src="(.+?)".+class="header">(.+?)</a>.+?<p>(.+?)</p.+?class="time">(.+?)<').findall(str(classdata))
for pgurl,imgurl, cattitle,catdesc, cattime in match:
- caturl =
"plugin://plugin.video.rt/?url=http://rt.com"+pgurl+"&name="+str(cattitle)+"&mode=19"
+ caturl =
"plugin://plugin.video.rt/?url=http://rt.com"+pgurl+"&name="+urllib.quote_plus(cattitle)+"&mode=19"
caticon = "http://rt.com"+imgurl
+ catdesc = catdesc.strip()
try:
-
addLink(caturl.encode('utf-8'),str(cattitle),caticon,fanart,cattime+"\n"+catdesc,"News","")
+
addLink(caturl.encode('utf-8'),cattitle,caticon,fanArt,cattime+"\n"+catdesc,"News","")
except:
log("RT -- Problem adding directory")
+ match = re.compile('<a class="pagerLink"
href="(.+?)"').findall(str(link))
+ for page in match:
+ addDir("-> Next Page",page,18,fanArt,fanArt,"Next
Page","News","",False)
+ addDir("<< Home Page","",None,fanArt,fanArt,"Home
Page","News","",False)
+
+
elif mode==19:
log("RT -- Processing RT play category item")
- req = urllib2.Request(url.encode('utf-8'))
- log("RT -- req === "+str(req))
- req.add_header('User-Agent', USER_AGENT)
- try:
- response = urllib2.urlopen(req)
- link1=response.read()
- response.close()
- except:
- link1 = ""
+ link1=getRequest(url)
link=str(link1).replace('\n','')
- match = re.compile('<span class="time">(.+?)<.+?<div
class="video_block".+?"thumbnailUrl" content="(.+?)".+?"contentURL"
content="(.+?)".+?<p>(.+?)</p>').findall(str(link))
- if not match:
- dialog = xbmcgui.Dialog()
- dialog.ok("Russia Today News", '', 'No Playable Video Found')
+ if not ("cdnapi.kaltura.com" in link):
+ match = re.compile('<span class="time">(.+?)<.+?<div
class="video_block".+?"thumbnailUrl" content="(.+?)".+?"contentURL"
content="(.+?)".+?<p>(.+?)</p>').findall(str(link))
+ if not match:
+ dialog = xbmcgui.Dialog()
+ dialog.ok(__language__(30000), '',__language__(30001))
+ else:
+ for viddate,icon,vidurl,viddesc in match:
+ if "comhttp:" in vidurl:
+ vidurl = vidurl.replace("http://rt.com","")
+ item = xbmcgui.ListItem(path=vidurl.encode('utf-8'),
iconImage="DefaultVideo.png", thumbnailImage=icon)
+ item.setInfo( type="Video", infoLabels={ "Title": name,
"Plot": viddate+"\n"+viddesc } )
+ item.setProperty("IsPlayable","true")
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
else:
- for viddate,icon,vidurl,viddesc in match:
- if "comhttp:" in vidurl:
- vidurl = vidurl.replace("http://rt.com","")
- item = xbmcgui.ListItem(path=vidurl.encode('utf-8'),
iconImage="DefaultVideo.png", thumbnailImage=icon)
- item.setInfo( type="Video", infoLabels={ "Title": name,
"Plot": viddate+"\n"+viddesc } )
- item.setProperty("IsPlayable","true")
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
-
+ match = re.compile('<meta name="description"
content="(.+?)".+?<link rel="image_src" href="(.+?)".+?<span
class="time">(.+?)<.+?<script src="(.+?)embedIframeJs/.+?"entry_id":
"(.+?)"').findall(str(link))
+ for viddesc,icon,viddate,vidurl,entry_id in match:
+ vidurl =
vidurl+"playManifest/entryId/"+entry_id+"/flavorId/0_ib2gjoc9/format/url/protocol/http/a.mp4"
+ item = xbmcgui.ListItem(path=vidurl.encode('utf-8'),
iconImage="DefaultVideo.png", thumbnailImage=icon)
+ item.setInfo( type="Video", infoLabels={ "Title": name,
"Plot": viddate+"\n"+viddesc } )
+ item.setProperty("IsPlayable","true")
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
+
xbmcplugin.endOfDirectory(int(sys.argv[1]))
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
plugin.video.rt/README.txt | 9 ++
plugin.video.rt/addon.xml | 7 +-
plugin.video.rt/changelog.txt | 10 ++-
plugin.video.rt/default.py | 136 ++++++++++++--------
.../resources/language/english/strings.xml | 2 +-
5 files changed, 107 insertions(+), 57 deletions(-)
copy {plugin.video.mediacorp =>
plugin.video.rt}/resources/language/english/strings.xml (67%)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons