The branch, frodo has been updated
via e3e5a93ad5548dcb87f2b2cf125b287e10dd61aa (commit)
via 63bdf7295d1cfacc1e8ccf65ea25d5ae1b14e83c (commit)
from 86c074a7bee0a61598dd9181309880c56285f585 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=e3e5a93ad5548dcb87f2b2cf125b287e10dd61aa
commit e3e5a93ad5548dcb87f2b2cf125b287e10dd61aa
Author: Martijn Kaijser <[email protected]>
Date: Sun Dec 8 10:58:49 2013 +0100
[plugin.video.euronews_com] 2.0.5
diff --git a/plugin.video.euronews_com/addon.xml
b/plugin.video.euronews_com/addon.xml
index a023461..1147467 100644
--- a/plugin.video.euronews_com/addon.xml
+++ b/plugin.video.euronews_com/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.euronews_com" name="euronews.com" version="2.0.4"
provider-name="AddonScriptorDE">
+<addon id="plugin.video.euronews_com" name="euronews.com" version="2.0.5"
provider-name="AddonScriptorDE">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
diff --git a/plugin.video.euronews_com/changelog.txt
b/plugin.video.euronews_com/changelog.txt
index 611007d..4c28fc8 100644
--- a/plugin.video.euronews_com/changelog.txt
+++ b/plugin.video.euronews_com/changelog.txt
@@ -9,3 +9,6 @@
- Added better thumbs
1.0.4 / 2.0.4
- Added context menu "Add to queue"
+2.0.5
+- Fixed video listing
+- Fixed polish site version
diff --git a/plugin.video.euronews_com/default.py
b/plugin.video.euronews_com/default.py
index d818728..0ebb59f 100644
--- a/plugin.video.euronews_com/default.py
+++ b/plugin.video.euronews_com/default.py
@@ -15,6 +15,7 @@ socket.setdefaulttimeout(30)
pluginhandle = int(sys.argv[1])
addonID = addon.getAddonInfo('id')
translation = addon.getLocalizedString
+xbox = xbmc.getCondVisibility("System.Platform.xbox")
while (not
os.path.exists(xbmc.translatePath("special://profile/addon_data/"+addonID+"/settings.xml"))):
addon.openSettings()
@@ -28,11 +29,13 @@ language2 = language.replace("en", "www").replace("pe",
"persian").replace("ar",
def index():
- addLink(translation(30001), "", 'playLive', "")
+ if language!="pl":
+ addLink(translation(30001), "", 'playLive', "")
addDir(translation(30002), "", 'newsMain', "")
content = getUrl("http://"+language2+".euronews.com")
match = re.compile('<li class="menu-element-programs"><a title="(.+?)"
href="(.+?)">', re.DOTALL).findall(content)
- addDir(match[0][0], "http://"+language2+".euronews.com"+match[0][1],
'listShows', "")
+ if match:
+ addDir(match[0][0], "http://"+language2+".euronews.com"+match[0][1],
'listShows', "")
content = content[content.find('<ol id="categoryNav">'):]
content = content[:content.find('</ol>')]
spl = content.split('<a')
@@ -101,14 +104,6 @@ def listVideos(url):
date = match[0][1]
title = date+" - "+title
addLink(title, url, 'playVideo', thumb, desc)
- content2 = content
- content = content[content.find('id="main-content">'):]
- if "</ul></div>" in content:
- content = content[:content.find("</ul></div>")]
- elif 'id="headline-block">' in content:
- content = content[:content.find('id="headline-block">')]
- content2 = content2[content2.find('id="headline-block">'):]
- content2 = content2[:content2.find('</div>')]
spl = content.split('<a class="imgWrap"')
for i in range(1, len(spl), 1):
entry = spl[i]
@@ -144,7 +139,9 @@ def listVideos(url):
if date:
title = date+" - "+title
addLink(title, url, 'playVideo', thumb, desc)
- spl = content2.split('<li')
+ content = content[content.find('id="headline-block">'):]
+ content = content[:content.find('</div>')]
+ spl = content.split('<li')
for i in range(1, len(spl), 1):
entry = spl[i]
match = re.compile('>(.+?) -', re.DOTALL).findall(entry)
@@ -235,9 +232,16 @@ def search():
def playVideo(url):
content = getUrl(url)
match = re.compile('file: "(.+?)"', re.DOTALL).findall(content)
+ matchYT = re.compile('youtube.com/embed/(.+?)"',
re.DOTALL).findall(content)
if match:
- listitem = xbmcgui.ListItem(path=match[0])
- xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
+ fullUrl = match[0]
+ elif matchYT:
+ if xbox:
+ fullUrl =
"plugin://video/YouTube/?path=/root/video&action=play_video&videoid=" +
matchYT[0]
+ else:
+ fullUrl =
"plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=" +
matchYT[0]
+ listitem = xbmcgui.ListItem(path=fullUrl)
+ xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
def queueVideo(url, name):
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=63bdf7295d1cfacc1e8ccf65ea25d5ae1b14e83c
commit 63bdf7295d1cfacc1e8ccf65ea25d5ae1b14e83c
Author: Martijn Kaijser <[email protected]>
Date: Sun Dec 8 10:57:36 2013 +0100
[plugin.video.spiegel_tv] 1.0.2
diff --git a/plugin.video.spiegel_tv/addon.xml
b/plugin.video.spiegel_tv/addon.xml
index 63976c4..1e998b2 100644
--- a/plugin.video.spiegel_tv/addon.xml
+++ b/plugin.video.spiegel_tv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.spiegel_tv" name="Spiegel.tv" version="1.0.0"
provider-name="AddonScriptorDE">
+<addon id="plugin.video.spiegel_tv" name="Spiegel.tv" version="1.0.2"
provider-name="AddonScriptorDE">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
diff --git a/plugin.video.spiegel_tv/changelog.txt
b/plugin.video.spiegel_tv/changelog.txt
index ad8ccc8..a5c7287 100644
--- a/plugin.video.spiegel_tv/changelog.txt
+++ b/plugin.video.spiegel_tv/changelog.txt
@@ -1,2 +1,6 @@
1.0.0
- Initial release
+1.0.1
+- Changed production date to air date
+1.0.2
+- Fixed listing of new videos
diff --git a/plugin.video.spiegel_tv/default.py
b/plugin.video.spiegel_tv/default.py
index 58ff031..de54581 100644
--- a/plugin.video.spiegel_tv/default.py
+++ b/plugin.video.spiegel_tv/default.py
@@ -25,8 +25,9 @@ viewModeChannels = str(addon.getSetting("viewModeChannels"))
translation = addon.getLocalizedString
icon = xbmc.translatePath('special://home/addons/'+addonID+'/icon.png')
addonUserDataFolder =
xbmc.translatePath("special://profile/addon_data/"+addonID)
+versionFile =
xbmc.translatePath("special://profile/addon_data/"+addonID+"/version")
cacheFolder =
xbmc.translatePath("special://profile/addon_data/"+addonID+"/cache")
-urlMain =
"http://spiegeltv-ivms2-restapi.s3.amazonaws.com/20131117113352/restapi"
+urlMain = "http://spiegeltv-ivms2-restapi.s3.amazonaws.com"
opener = urllib2.build_opener()
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:25.0)
Gecko/20100101 Firefox/25.0')]
@@ -36,6 +37,11 @@ if not os.path.isdir(cacheFolder):
os.mkdir(cacheFolder)
def index():
+ content = getUrl(urlMain+"/version.json")
+ content = json.loads(content)
+ fh = open(versionFile, 'w')
+ fh.write(content["version_name"])
+ fh.close()
addDir(translation(30003), "", 'listChannels', icon)
addDir(translation(30004), "", 'listTopics', icon)
addDir(translation(30002), "0", 'listVideos', icon)
@@ -47,10 +53,10 @@ def index():
def listChannels(url):
xbmcplugin.setContent(pluginhandle, "episodes")
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
- content = getUrl(urlMain+"/channels.json")
+ content = getUrl(urlMain+"/"+getVersion()+"/restapi/channels.json")
content = json.loads(content)
for item in content:
- channel = getUrl(urlMain+"/channels/"+str(item)+".json")
+ channel =
getUrl(urlMain+"/"+getVersion()+"/restapi/channels/"+str(item)+".json")
channel = json.loads(channel)
ids = ""
for id in channel["media"]:
@@ -74,10 +80,10 @@ def listChannels(url):
def listTopics(url):
xbmcplugin.setContent(pluginhandle, "episodes")
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
- content = getUrl(urlMain+"/playlists.json")
+ content = getUrl(urlMain+"/"+getVersion()+"/restapi/playlists.json")
content = json.loads(content)
for item in content:
- channel = getUrl(urlMain+"/playlists/"+str(item)+".json")
+ channel =
getUrl(urlMain+"/"+getVersion()+"/restapi/playlists/"+str(item)+".json")
channel = json.loads(channel)
ids = ""
for id in channel["media"]:
@@ -101,21 +107,21 @@ def listTopics(url):
def listVideos(ids, index, rnd):
xbmcplugin.setContent(pluginhandle, "episodes")
if not ids:
- content = getUrl(urlMain+"/media.json")
+ content = getUrl(urlMain+"/"+getVersion()+"/restapi/media.json")
content = json.loads(content)
else:
content = ids.split(",")
if rnd=="true":
random.shuffle(content)
for i in range(index, index+12, 1):
- video = getUrl(urlMain+"/media/"+str(content[i])+".json")
+ video =
getUrl(urlMain+"/"+getVersion()+"/restapi/media/"+str(content[i])+".json")
video = json.loads(video)
try:
- date = video["airdate"]
+ date = video["web_airdate"]
except:
date = ""
try:
- subtitle = video["subtitle"]
+ subtitle = video["subtitle"].encode('utf-8')
except:
subtitle = ""
try:
@@ -125,7 +131,7 @@ def listVideos(ids, index, rnd):
if duration=="0":
duration="1"
try:
- description = video["description"]
+ description = video["description"].encode('utf-8')
except:
description = ""
try:
@@ -141,13 +147,13 @@ def listVideos(ids, index, rnd):
else:
aspect = "4x3"
playpath = "mp4:"+uuid+"_spiegeltv_0500_"+aspect+".m4v"
- desc = video["title"]+" - "+subtitle+"\n\n"+description
+ desc = video["title"].encode('utf-8')+" - "+subtitle+"\n\n"+description
thumbUrl = ""
for thumb in video["images"]:
if thumb["spec_slug"]=="f3-film-embed":
thumbUrl = thumb["url"]
if uuid:
- addLink(video["title"], playpath, 'playVideo', thumbUrl, desc,
duration, date)
+ addLink(video["title"].encode('utf-8'), playpath, 'playVideo',
thumbUrl, desc, duration, date)
if i==len(content)-1:
break
if rnd=="true":
@@ -162,7 +168,7 @@ def listVideos(ids, index, rnd):
def playRandom():
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
- content = getUrl(urlMain+"/media.json")
+ content = getUrl(urlMain+"/"+getVersion()+"/restapi/media.json")
content = json.loads(content)
random.shuffle(content)
count = 1
@@ -189,7 +195,7 @@ def queueVideo(url, name, thumb):
def playVideoRandom(id):
- video = getUrl(urlMain+"/media/"+id+".json")
+ video = getUrl(urlMain+"/"+getVersion()+"/restapi/media/"+id+".json")
video = json.loads(video)
thumbUrl = ""
for thumb in video["images"]:
@@ -204,9 +210,9 @@ def playVideoRandom(id):
else:
aspect = "4x3"
playpath = "mp4:"+video["uuid"]+"_spiegeltv_0500_"+aspect+".m4v"
- title = video["title"]
+ title = video["title"].encode('utf-8')
try:
- subtitle = video["subtitle"]
+ subtitle = video["subtitle"].encode('utf-8')
except:
subtitle = ""
if subtitle:
@@ -223,13 +229,20 @@ def cleanTitle(title):
return title
+def getVersion():
+ fh = open(versionFile, 'r')
+ content = fh.read()
+ fh.close()
+ return content
+
+
def getUrl(url):
cacheFile = os.path.join(cacheFolder, url.split("/")[-1])
- if os.path.exists(cacheFile) and ("/media.json" in url or "/channels/" in
url) and (time.time()-os.path.getmtime(cacheFile) < 60*60*12):
+ if os.path.exists(cacheFile) and ("/media.json" in url or "/channels/" in
url) and (time.time()-os.path.getmtime(cacheFile) < 60*60*6):
fh = open(cacheFile, 'r')
content = fh.read()
fh.close()
- elif os.path.exists(cacheFile) and ("/media.json" not in url and
"/channels/" not in url):
+ elif os.path.exists(cacheFile) and ("/media.json" not in url and
"/channels/" not in url and "/version.json" not in url):
fh = open(cacheFile, 'r')
content = fh.read()
fh.close()
@@ -260,7 +273,7 @@ def addLink(name, url, mode, iconimage, desc, duration,
date):
liz.setProperty('IsPlayable', 'true')
if useThumbAsFanart:
liz.setProperty("fanart_image", iconimage)
- liz.addContextMenuItems([(translation(30006),
'RunPlugin(plugin://'+addonID+'/?mode=queueVideo&url='+urllib.quote_plus(u)+'&name='+urllib.quote_plus(name.encode('utf-8'))+'&thumb='+urllib.quote_plus(iconimage)+')',)])
+ liz.addContextMenuItems([(translation(30006),
'RunPlugin(plugin://'+addonID+'/?mode=queueVideo&url='+urllib.quote_plus(u)+'&name='+str(name)+'&thumb='+urllib.quote_plus(iconimage)+')',)])
ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u,
listitem=liz)
return ok
diff --git a/plugin.video.spiegel_tv/resources/language/English/strings.xml
b/plugin.video.spiegel_tv/resources/language/English/strings.xml
index aa37cc0..f677bc2 100644
--- a/plugin.video.spiegel_tv/resources/language/English/strings.xml
+++ b/plugin.video.spiegel_tv/resources/language/English/strings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="30001">Next Page</string>
- <string id="30002">Latest videos</string>
+ <string id="30002">New videos</string>
<string id="30003">Channels</string>
<string id="30004">Topics</string>
<string id="30005">TV-Mode</string>
-----------------------------------------------------------------------
Summary of changes:
plugin.video.euronews_com/addon.xml | 2 +-
plugin.video.euronews_com/changelog.txt | 3 +
plugin.video.euronews_com/default.py | 30 +++++++-----
plugin.video.spiegel_tv/addon.xml | 2 +-
plugin.video.spiegel_tv/changelog.txt | 4 ++
plugin.video.spiegel_tv/default.py | 51 ++++++++++++-------
.../resources/language/English/strings.xml | 2 +-
7 files changed, 59 insertions(+), 35 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons