The branch, frodo has been updated via c8f3cfc0779b59ecb0b73de890d17230bd21b14e (commit) via 1a49a9aecde9caf5b20b0e088ff9f15180ef8c7f (commit) via 55491b4268d78fd37125c5c0d688a11e945c158f (commit) via 351f0f427c6e42d96a94fa6121cc363c7cb90d25 (commit) from ec6f9c89c1c6479105133e5829d05b438044dede (commit)
- Log ----------------------------------------------------------------- http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=c8f3cfc0779b59ecb0b73de890d17230bd21b14e commit c8f3cfc0779b59ecb0b73de890d17230bd21b14e Author: beenje <bee...@xbmc.org> Date: Tue Nov 19 22:43:46 2013 +0100 [plugin.video.gametest.dk] updated to version 3.0.1 diff --git a/plugin.video.gametest.dk/addon.py b/plugin.video.gametest.dk/addon.py index 7b3eddb..6b6e9fb 100644 --- a/plugin.video.gametest.dk/addon.py +++ b/plugin.video.gametest.dk/addon.py @@ -29,16 +29,22 @@ import xbmcplugin BASE_URL = 'http://www.gametest.dk/' PLAY_VIDEO_PATH = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' -PLAYLIST_PATH = 'plugin://plugin.video.youtube/?channel=gametestforever&path=%2froot%2fsubscriptions&user_feed=uploads' +PLAYLIST_PATH = 'plugin://plugin.video.youtube/?channel=GametestDanmark&path=%2froot%2fsubscriptions&user_feed=uploads' -class GameTest(object): - def showOverview(self): +if __name__ == '__main__': + ADDON = xbmcaddon.Addon() + HANDLE = int(sys.argv[1]) + + ICON = os.path.join(ADDON.getAddonInfo('path'), 'icon.png') + FANART = os.path.join(ADDON.getAddonInfo('path'), 'fanart.jpg') + + try: u = urllib2.urlopen(BASE_URL) html = u.read() u.close() - m = re.search('http://www.youtube.com/embed/([^"]+)"', html, re.DOTALL) + m = re.search('//www.youtube.com/embed/([^"]+)"', html, re.DOTALL) if m: videoId = m.group(1) item = xbmcgui.ListItem(ADDON.getLocalizedString(30000), iconImage=ICON) @@ -51,17 +57,6 @@ class GameTest(object): xbmcplugin.addDirectoryItem(HANDLE, PLAYLIST_PATH, item, True) xbmcplugin.endOfDirectory(HANDLE) - -if __name__ == '__main__': - ADDON = xbmcaddon.Addon() - HANDLE = int(sys.argv[1]) - - ICON = os.path.join(ADDON.getAddonInfo('path'), 'icon.png') - FANART = os.path.join(ADDON.getAddonInfo('path'), 'fanart.jpg') - - gt = GameTest() - try: - gt.showOverview() except: buggalo.onExceptionRaised() diff --git a/plugin.video.gametest.dk/addon.xml b/plugin.video.gametest.dk/addon.xml index df2aab3..5c3a1c4 100644 --- a/plugin.video.gametest.dk/addon.xml +++ b/plugin.video.gametest.dk/addon.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<addon id="plugin.video.gametest.dk" version="3.0.0" name="Gametest" provider-name="twinther"> +<addon id="plugin.video.gametest.dk" version="3.0.1" name="Gametest" provider-name="twinther"> <requires> <import addon="xbmc.python" version="2.1.0"/> <import addon="script.module.buggalo" version="1.1.2"/> diff --git a/plugin.video.gametest.dk/changelog.txt b/plugin.video.gametest.dk/changelog.txt index 5c0bdec..6828c98 100644 --- a/plugin.video.gametest.dk/changelog.txt +++ b/plugin.video.gametest.dk/changelog.txt @@ -1,3 +1,6 @@ +[B]Version 3.0.1 - 2013-10-10[/B] +- Fixed addon due to site changes + [B]Version 3.0.0 - 2013-06-02[/B] - Complete rewrite, site uses YouTube now http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=1a49a9aecde9caf5b20b0e088ff9f15180ef8c7f commit 1a49a9aecde9caf5b20b0e088ff9f15180ef8c7f Author: beenje <bee...@xbmc.org> Date: Tue Nov 19 22:43:42 2013 +0100 [plugin.video.videovideo.dk] updated to version 3.0.1 diff --git a/plugin.video.videovideo.dk/addon.py b/plugin.video.videovideo.dk/addon.py index 791b514..90a6e48 100644 --- a/plugin.video.videovideo.dk/addon.py +++ b/plugin.video.videovideo.dk/addon.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2012 Tommy Winther +# Copyright (C) 2013 Tommy Winther # http://tommy.winther.nu # # This Program is free software; you can redistribute it and/or modify @@ -20,16 +20,22 @@ import sys import urllib2 import urlparse -import simplejson import buggalo import xbmcaddon import xbmcgui import xbmcplugin +try: + import json +except: + import simplejson as json + + class VideoVideoException(Exception): pass + class VideoVideoHD(object): INDEX_URL = 'http://videovideo.dk/index/json/' SHOWS_URL = 'http://videovideo.dk/shows/json/' @@ -43,10 +49,10 @@ class VideoVideoHD(object): teasers = None for show in shows: - item = xbmcgui.ListItem(show['title'], iconImage = show['image']) - item.setInfo(type = 'video', infoLabels = { - 'title' : show['title'], - 'plot' : show['description'] + item = xbmcgui.ListItem(show['title'], iconImage=show['image']) + item.setInfo(type='video', infoLabels={ + 'title': show['title'], + 'plot': show['description'] }) item.setProperty('Fanart_Image', show['imagefull']) url = PATH + '?url=' + show['url'] @@ -54,12 +60,12 @@ class VideoVideoHD(object): if teasers is not None: for teaser in teasers: - item = xbmcgui.ListItem(teaser['headline'], iconImage = teaser['image'], thumbnailImage = teaser['image']) - item.setInfo(type = 'video', infoLabels = { - 'title' : teaser['headline'], - 'plot' : teaser['text'], - 'duration' : self.parseDuration(teaser['episode']['duration']), - 'studio' : ADDON.getAddonInfo('name') + item = xbmcgui.ListItem(teaser['headline'], iconImage=teaser['image'], thumbnailImage=teaser['image']) + item.setInfo(type='video', infoLabels={ + 'title': teaser['headline'], + 'plot': teaser['text'], + 'duration': self.parseDuration(teaser['episode']['duration']), + 'studio': ADDON.getAddonInfo('name') }) item.setProperty('Fanart_Image', teaser['episode']['imagefull']) url = teaser['episode']['distributions']['720'] @@ -71,7 +77,7 @@ class VideoVideoHD(object): items = list() episodes = self.downloadJson(url) for episode in episodes: - item = xbmcgui.ListItem(episode['title'], iconImage = episode['image'], thumbnailImage = episode['image']) + item = xbmcgui.ListItem(episode['title'], iconImage=episode['image'], thumbnailImage=episode['image']) day = episode['timestamp'][8:10] month = episode['timestamp'][5:7] @@ -81,13 +87,13 @@ class VideoVideoHD(object): aired = '%s-%s-%s' % (year, month, day) infoLabels = { - 'title' : episode['title'], - 'plot' : episode['shownotes'], - 'date' : date, - 'aired' : aired, - 'year' : int(year), - 'duration' : self.parseDuration(episode['duration']), - 'studio' : ADDON.getAddonInfo('name') + 'title': episode['title'], + 'plot': episode['shownotes'], + 'date': date, + 'aired': aired, + 'year': int(year), + 'duration': self.parseDuration(episode['duration']), + 'studio': ADDON.getAddonInfo('name') } item.setInfo('video', infoLabels) item.setProperty('Fanart_Image', episode['imagefull']) @@ -108,11 +114,11 @@ class VideoVideoHD(object): u = urllib2.urlopen(url) response = u.read() u.close() - return simplejson.loads(response) + return json.loads(response) except Exception, ex: raise VideoVideoException(ex) - def showError(self, message = 'n/a'): + def showError(self, message='n/a'): xbmcplugin.endOfDirectory(HANDLE, succeeded=False) heading = buggalo.getRandomHeading() @@ -130,7 +136,7 @@ if __name__ == '__main__': buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php' vvd = VideoVideoHD() try: - if PARAMS.has_key('url'): + if 'url' in PARAMS: vvd.showShow(PARAMS['url'][0]) else: vvd.showOverview() diff --git a/plugin.video.videovideo.dk/addon.xml b/plugin.video.videovideo.dk/addon.xml index 7d0905b..90c1e48 100644 --- a/plugin.video.videovideo.dk/addon.xml +++ b/plugin.video.videovideo.dk/addon.xml @@ -1,9 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<addon id="plugin.video.videovideo.dk" version="3.0.0" name="videovideo.dk HD" provider-name="twinther [to...@winther.nu]"> +<addon id="plugin.video.videovideo.dk" + version="3.0.1" + name="videovideo.dk HD" + provider-name="twinther"> <requires> <import addon="xbmc.python" version="2.1.0"/> <import addon="script.module.simplejson" version="2.0.10"/> - <import addon="script.module.buggalo" version="1.1.2"/> + <import addon="script.module.buggalo" version="1.1.5"/> </requires> <extension point="xbmc.python.pluginsource" library="addon.py"> <provides>video</provides> @@ -16,5 +19,8 @@ <license>GPL 2.0</license> <platform>all</platform> <language>da</language> + <email>to...@winther.nu</email> + <website>http://tommy.winther.nu</website> + <source>https://github.com/xbmc-danish-addons/plugin.video.videovideo.dk</source> </extension> </addon> diff --git a/plugin.video.videovideo.dk/changelog.txt b/plugin.video.videovideo.dk/changelog.txt index fcab037..ed6c968 100644 --- a/plugin.video.videovideo.dk/changelog.txt +++ b/plugin.video.videovideo.dk/changelog.txt @@ -1,3 +1,6 @@ +[B]Version 3.0.1 - 2013-11-16[/B] +- Cleanup and use builtin json if available + [B]Version 3.0.0 - 2013-01-06[/B] - Fixed addon on Frodo - Fixed parsing of duration http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=55491b4268d78fd37125c5c0d688a11e945c158f commit 55491b4268d78fd37125c5c0d688a11e945c158f Author: beenje <bee...@xbmc.org> Date: Tue Nov 19 22:43:40 2013 +0100 [plugin.video.tv3play.dk] updated to version 2.0.7 diff --git a/plugin.video.tv3play.dk/addon.py b/plugin.video.tv3play.dk/addon.py index 694e953..bc7395c 100644 --- a/plugin.video.tv3play.dk/addon.py +++ b/plugin.video.tv3play.dk/addon.py @@ -35,9 +35,9 @@ REGIONS = ['tv3play.dk', 'tv3play.se', 'tv3play.no', 'tv3play.lt', 'tv3play.lv', class TV3PlayAddon(object): - def __init__(self): - if 'region' in PARAMS: - self.api = mobileapi.TV3PlayMobileApi(PARAMS['region'][0]) + def __init__(self, region): + self.region = region + self.api = mobileapi.TV3PlayMobileApi(region) def listRegions(self): items = list() @@ -49,7 +49,7 @@ class TV3PlayAddon(object): xbmcplugin.addDirectoryItems(HANDLE, items) xbmcplugin.endOfDirectory(HANDLE) - def listPrograms(self, region): + def listPrograms(self): items = list() formats = self.api.getAllFormats() @@ -69,12 +69,12 @@ class TV3PlayAddon(object): item = xbmcgui.ListItem(series['title'], iconImage=fanart) item.setInfo('video', infoLabels) item.setProperty('Fanart_Image', fanart) - items.append((PATH + '?region=%s&format=%s' % (region, series['id']), item, True)) + items.append((PATH + '?region=%s&format=%s' % (self.region, series['id']), item, True)) xbmcplugin.addDirectoryItems(HANDLE, items) xbmcplugin.endOfDirectory(HANDLE) - def listCategories(self, region, formatId): + def listCategories(self, formatId): detailed = self.api.detailed(formatId) for category in detailed['formatcategories']: @@ -83,12 +83,12 @@ class TV3PlayAddon(object): item = xbmcgui.ListItem(category['name'], iconImage=fanart) item.setProperty('Fanart_Image', fanart) xbmcplugin.addDirectoryItem(HANDLE, - PATH + '?region=%s&format=%s&category=%s' % (region, formatId, category['id']), + PATH + '?region=%s&format=%s&category=%s' % (self.region, formatId, category['id']), item, True) xbmcplugin.endOfDirectory(HANDLE) - def listVideos(self, region, category): + def listVideos(self, category): items = list() videos = self.api.getVideos(category) @@ -117,7 +117,7 @@ class TV3PlayAddon(object): item.setInfo('video', infoLabels) item.setProperty('IsPlayable', 'true') item.setProperty('Fanart_Image', fanart) - items.append((PATH + '?region=%s&playVideo=%s' % (region, video['id']), item)) + items.append((PATH + '?region=%s&playVideo=%s' % (self.region, video['id']), item)) xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_EPISODE) xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_TITLE) @@ -163,17 +163,23 @@ if __name__ == '__main__': if not os.path.exists(CACHE_PATH): os.makedirs(CACHE_PATH) + r = None + if 'region' in PARAMS: + r = PARAMS['region'][0] + elif ADDON.getSetting('region') in REGIONS: + r = ADDON.getSetting('region') + buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php' - tv3PlayAddon = TV3PlayAddon() + tv3PlayAddon = TV3PlayAddon(r) try: if 'playVideo' in PARAMS: tv3PlayAddon.playVideo(PARAMS['playVideo'][0]) elif 'format' in PARAMS and 'category' in PARAMS: - tv3PlayAddon.listVideos(PARAMS['region'][0], PARAMS['category'][0]) + tv3PlayAddon.listVideos(PARAMS['category'][0]) elif 'format' in PARAMS: - tv3PlayAddon.listCategories(PARAMS['region'][0], PARAMS['format'][0]) - elif 'region' in PARAMS: - tv3PlayAddon.listPrograms(PARAMS['region'][0]) + tv3PlayAddon.listCategories(PARAMS['format'][0]) + elif r: + tv3PlayAddon.listPrograms() else: tv3PlayAddon.listRegions() diff --git a/plugin.video.tv3play.dk/addon.xml b/plugin.video.tv3play.dk/addon.xml index 5f1effd..ab17d8d 100644 --- a/plugin.video.tv3play.dk/addon.xml +++ b/plugin.video.tv3play.dk/addon.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<addon id="plugin.video.tv3play.dk" version="2.0.6" name="TV3 Play" provider-name="twinther"> +<addon id="plugin.video.tv3play.dk" version="2.0.7" name="TV3 Play" provider-name="twinther"> <requires> <import addon="xbmc.python" version="2.1.0"/> <import addon="script.module.buggalo" version="1.1.2"/> diff --git a/plugin.video.tv3play.dk/changelog.txt b/plugin.video.tv3play.dk/changelog.txt index 5707963..ef3f0c4 100644 --- a/plugin.video.tv3play.dk/changelog.txt +++ b/plugin.video.tv3play.dk/changelog.txt @@ -1,3 +1,7 @@ +[B]Version 2.0.7 - 2013-10-16[/B] +- Made start page configurable + You can now start directly on your preferred region + [B]Version 2.0.6 - 2013-10-09[/B] - Fixed problem with missing air date in metadata diff --git a/plugin.video.tv3play.dk/resources/language/English/strings.xml b/plugin.video.tv3play.dk/resources/language/English/strings.xml index 3223feb..c536f5f 100644 --- a/plugin.video.tv3play.dk/resources/language/English/strings.xml +++ b/plugin.video.tv3play.dk/resources/language/English/strings.xml @@ -4,6 +4,9 @@ <!-- Report language file syntax bugs at: alanw...@xbmc.org --> <strings> + <string id="30000">General</string> + <string id="30001">Start page</string> + <string id="30100">Commercial</string> <string id="30200">An error occurred while communication with TV3 Play.</string> <string id="30201">The error message is:</string> http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=351f0f427c6e42d96a94fa6121cc363c7cb90d25 commit 351f0f427c6e42d96a94fa6121cc363c7cb90d25 Author: beenje <bee...@xbmc.org> Date: Tue Nov 19 22:43:38 2013 +0100 [plugin.video.dr.dk.bonanza] updated to version 3.0.1 diff --git a/plugin.video.dr.dk.bonanza/addon.py b/plugin.video.dr.dk.bonanza/addon.py index 0c48980..87aaf84 100644 --- a/plugin.video.dr.dk.bonanza/addon.py +++ b/plugin.video.dr.dk.bonanza/addon.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2012 Tommy Winther +# Copyright (C) 2013 Tommy Winther # http://tommy.winther.nu # # This Program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ import os import re import sys -import simplejson import urlparse import urllib2 from htmlentitydefs import name2codepoint @@ -31,53 +30,67 @@ import xbmcgui import xbmcplugin import xbmcaddon +try: + import json +except: + import simplejson as json + BASE_URL = 'http://www.dr.dk/Bonanza/' VIDEO_TYPES = ['VideoHigh', 'VideoMid', 'VideoLow', 'Audio'] + class BonanzaException(Exception): pass + class Bonanza(object): + def __init__(self): + self.content_type = 'video' + def search(self): keyboard = xbmc.Keyboard('', ADDON.getLocalizedString(30001)) keyboard.doModal() if keyboard.isConfirmed(): - html = self._downloadUrl('http://www.dr.dk/bonanza/search.htm?&type=video&limit=120&needle=' + keyboard.getText().replace(' ', '+')) + html = self._downloadUrl('http://www.dr.dk/bonanza/search.htm?&type=' + self.content_type + + '&limit=120&needle=' + keyboard.getText().replace(' ', '+')) self.addContent(html) xbmcplugin.endOfDirectory(HANDLE) - def showCategories(self): items = list() html = self._downloadUrl(BASE_URL) - item = xbmcgui.ListItem(ADDON.getLocalizedString(30001), iconImage = ICON) + item = xbmcgui.ListItem(ADDON.getLocalizedString(30001), iconImage=ICON) item.setProperty('Fanart_Image', FANART) - xbmcplugin.addDirectoryItem(HANDLE, PATH + '?mode=search', item, True) - item = xbmcgui.ListItem(ADDON.getLocalizedString(30002), iconImage = ICON) + xbmcplugin.addDirectoryItem(HANDLE, PATH + '?content_type=' + self.content_type + '&mode=search', item, True) + item = xbmcgui.ListItem(ADDON.getLocalizedString(30002), iconImage=ICON) item.setProperty('Fanart_Image', FANART) - xbmcplugin.addDirectoryItem(HANDLE, PATH + '?mode=recommend', item, True) - item = xbmcgui.ListItem(ADDON.getLocalizedString(30004), iconImage = ICON) + xbmcplugin.addDirectoryItem(HANDLE, PATH + '?content_type=' + self.content_type + '&mode=recommend', item, True) + item = xbmcgui.ListItem(ADDON.getLocalizedString(30004), iconImage=ICON) item.setProperty('Fanart_Image', FANART) - xbmcplugin.addDirectoryItem(HANDLE, PATH + '?mode=latest', item, True) + xbmcplugin.addDirectoryItem(HANDLE, PATH + '?content_type=' + self.content_type + '&mode=latest', item, True) + + if self.content_type == 'audio': + pattern = '<a href="(/Bonanza/Radio/Kategori/.*\.htm)">(.*)</a>' + else: + pattern = '<a href="(/Bonanza/kategori/.*\.htm)">(.*)</a>' - for m in re.finditer('<a href="(/Bonanza/kategori/.*\.htm)">(.*)</a>', html): + for m in re.finditer(pattern, html): path = m.group(1) title = m.group(2) - item = xbmcgui.ListItem(title, iconImage = ICON) + item = xbmcgui.ListItem(title, iconImage=ICON) item.setProperty('Fanart_Image', FANART) - item.setInfo(type = 'video', infoLabels = { - 'title' : title + item.setInfo(self.content_type, infoLabels={ + 'title': title }) - url = PATH + '?mode=subcat&url=http://www.dr.dk' + path + url = PATH + '?content_type=' + self.content_type + '&mode=subcat&url=http://www.dr.dk' + path items.append((url, item, True)) xbmcplugin.addDirectoryItems(HANDLE, items) xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.endOfDirectory(HANDLE) - def showRecommendations(self): html = self._downloadUrl(BASE_URL) tab = self._getTab(html, 'redaktionens favoritter') @@ -92,10 +105,9 @@ class Bonanza(object): xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.endOfDirectory(HANDLE) - def showSubCategories(self, url): html = self._downloadUrl(url.replace(' ', '+')) - tab = self._getTab(html, '') # will return first tab found + tab = self._getTab(html, '') # will return first tab found self.addSubCategories(tab) xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.endOfDirectory(HANDLE) @@ -107,46 +119,55 @@ class Bonanza(object): xbmcplugin.endOfDirectory(HANDLE) def addSubCategories(self, html): - for m in re.finditer('<a href="(http://www\.dr\.dk/bonanza/serie/[^\.]+\.htm)"[^>]+>..<img src="(http://downol\.dr\.dk/download/bonanza/collectionThumbs/[^"]+)"[^>]+>..<b>([^<]+)</b>..<span>([^<]+)</span>..</a>', html, re.DOTALL): + + if self.content_type == 'audio': + pattern = '<a href="(http://www\.dr\.dk/bonanza/radio/serie/[^\.]+\.htm)"[^>]+>..' \ + '<img src="(http://downol\.dr\.dk/download/bonanza/collectionThumbs/[^"]+)"[^>]+>..' \ + '<b>([^<]+)</b>..<span>([^<]+)</span>..</a>' + else: + pattern = '<a href="(http://www\.dr\.dk/bonanza/serie/[^\.]+\.htm)"[^>]+>..' \ + '<img src="(http://downol\.dr\.dk/download/bonanza/collectionThumbs/[^"]+)"[^>]+>..' \ + '<b>([^<]+)</b>..<span>([^<]+)</span>..</a>' + + for m in re.finditer(pattern, html, re.DOTALL): url = m.group(1) image = m.group(2) title = m.group(3) description = m.group(4) - item = xbmcgui.ListItem(title, iconImage = image) + item = xbmcgui.ListItem(title, iconImage=image) item.setProperty('Fanart_Image', FANART) - item.setInfo(type = 'video', infoLabels = { - 'title' : title, - 'plot' : description + item.setInfo(self.content_type, infoLabels={ + 'title': title, + 'plot': description }) - url = PATH + '?mode=content&url=' + url + url = PATH + '?content_type=' + self.content_type + '&mode=content&url=' + url xbmcplugin.addDirectoryItem(HANDLE, url, item, True) - def addContent(self, html): items = list() for m in re.finditer('newPlaylist\(([^"]+)"', html): raw = m.group(1)[:-2].replace('"', '"') - json = simplejson.loads(raw) + content = json.loads(raw) infoLabels = {} - if json.has_key('Title') and json['Title'] is not None: - infoLabels['title'] = self._decodeHtmlEntities(json['Title']) - if json.has_key('Description') and json['Description'] is not None: - infoLabels['plot'] = self._decodeHtmlEntities(json['Description']) - if json.has_key('Colophon') and json['Colophon'] is not None: - infoLabels['writer'] = self._decodeHtmlEntities(json['Colophon']) - if json.has_key('Actors') and json['Actors'] is not None: - infoLabels['cast'] = self._decodeHtmlEntities(json['Actors']) - if json.has_key('Rating') and json['Rating'] is not None: - infoLabels['rating'] = json['Rating'] - if json.has_key('FirstPublished') and json['FirstPublished'] is not None: - infoLabels['year'] = int(json['FirstPublished'][:4]) - if json.has_key('Duration') and json['Duration'] is not None: - infoLabels['duration'] = self._secondsToDuration(int(json['Duration']) / 1000) + if 'Title' in content and content['Title'] is not None: + infoLabels['title'] = self._decodeHtmlEntities(content['Title']) + if 'Description' in content and content['Description'] is not None: + infoLabels['plot'] = self._decodeHtmlEntities(content['Description']) + if 'Colophon' in content and content['Colophon'] is not None: + infoLabels['writer'] = self._decodeHtmlEntities(content['Colophon']) + if 'Actors' in content and content['Actors'] is not None: + infoLabels['cast'] = self._decodeHtmlEntities(content['Actors']) + if 'Rating' in content and content['Rating'] is not None: + infoLabels['rating'] = content['Rating'] + if 'FirstPublished' in content and content['FirstPublished'] is not None: + infoLabels['year'] = int(content['FirstPublished'][:4]) + if 'Duration' in content and content['Duration'] is not None: + infoLabels['duration'] = int(content['Duration']) / 60000 infoLabels['studio'] = ADDON.getAddonInfo('name') - thumb = self.findFileLocation(json, 'Thumb') + thumb = self.findFileLocation(content, 'Thumb') if thumb is None: thumb = ICON item = xbmcgui.ListItem(infoLabels['title'], iconImage=thumb, thumbnailImage=thumb) @@ -155,9 +176,9 @@ class Bonanza(object): item.setInfo('video', infoLabels) url = '?mode=play' - for file in json['Files']: - if file['Type'] in VIDEO_TYPES: - url += '&' + file['Type'] + '=' + file['Location'] + for elem in content['Files']: + if elem['Type'] in VIDEO_TYPES: + url += '&' + elem['Type'] + '=' + elem['Location'] items.append((PATH + url, item, False)) xbmcplugin.addDirectoryItems(HANDLE, items) @@ -167,10 +188,10 @@ class Bonanza(object): playlist.clear() firstItem = None - for type in VIDEO_TYPES: - if PARAMS.has_key(type.lower()): - url = self.fixRtmpUrl(PARAMS[type.lower()][0]) - item = xbmcgui.ListItem(type, path = url) + for videoType in VIDEO_TYPES: + if videoType.lower() in PARAMS: + url = self.fixRtmpUrl(PARAMS[videoType.lower()][0]) + item = xbmcgui.ListItem(videoType, path=url) playlist.add(url, item) if firstItem is None: @@ -182,18 +203,23 @@ class Bonanza(object): xbmcplugin.setResolvedUrl(HANDLE, False, xbmcgui.ListItem()) def fixRtmpUrl(self, url): - if url[0:4] == 'rtmp': - # patch videoUrl to work with xbmc - m = re.match('(rtmp://.*?)/(.*)', url) - url = '%s/bonanza/%s' % (m.group(1), m.group(2)) + if url[0:7] == 'rtmp://': + m = re.search('(rtmp://.*?/(.*?))/(.*)', url) + if m: + url = m.group(1) + ' playpath=' + m.group(3) + ' app=' + m.group(2) + try: + print url + except: + pass + return url - def findFileLocation(self, json, type): - for file in json['Files']: - if file['Type'] == type: - return file['Location'] + def findFileLocation(self, data, fileType): + for elem in data['Files']: + if elem['Type'] == fileType: + return elem['Location'] return None - + def _downloadUrl(self, url): try: u = urllib2.urlopen(url) @@ -225,7 +251,7 @@ class Bonanza(object): return unichr(int(ent)) elif match.group(2) == 'x': # number is in hex - return unichr(int('0x'+ent, 16)) + return unichr(int('0x' + ent, 16)) else: # they were using a name cp = name2codepoint.get(ent) @@ -237,23 +263,13 @@ class Bonanza(object): entity_re = re.compile(r'&(#?)(x?)(\w+);') return entity_re.subn(substituteEntity, string)[0] - def _secondsToDuration(self, input): - """Formats the seconds to a duration string as used by XBMC. - - Keyword arguments: - input -- the duration in seconds - - """ - hours = input / 3600 - minutes = (input % 3600) / 60 - seconds = (input % 3600) % 60 - - return "%02d:%02d:%02d" % (hours, minutes, seconds) - - def _getTab(self, html, tabLabel): - m = re.search('(<div id="tabWrapper" class="tabWrapper"><span class="tabTitle">' + tabLabel + '.*?</div>)', html, re.DOTALL + re.IGNORECASE) - return m.group(1) + m = re.search('(<div id="tabWrapper" class="tabWrapper"><span class="tabTitle">' + tabLabel + '.*?</div>)', + html, re.DOTALL + re.IGNORECASE) + if m: + return m.group(1) + else: + return '' def showError(self, message): heading = buggalo.getRandomHeading() @@ -261,8 +277,9 @@ class Bonanza(object): line2 = ADDON.getLocalizedString(30901) xbmcgui.Dialog().ok(heading, line1, line2, message) + if __name__ == '__main__': - ADDON = xbmcaddon.Addon(id = 'plugin.video.dr.dk.bonanza') + ADDON = xbmcaddon.Addon() PATH = sys.argv[0] HANDLE = int(sys.argv[1]) PARAMS = urlparse.parse_qs(sys.argv[2][1:]) @@ -273,18 +290,22 @@ if __name__ == '__main__': buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php' b = Bonanza() try: - if PARAMS.has_key('mode') and PARAMS['mode'][0] == 'subcat': - b.showSubCategories(PARAMS['url'][0]) - elif PARAMS.has_key('mode') and PARAMS['mode'][0] == 'content': - b.showContent(PARAMS['url'][0]) - elif PARAMS.has_key('mode') and PARAMS['mode'][0] == 'search': - b.search() - elif PARAMS.has_key('mode') and PARAMS['mode'][0] == 'recommend': - b.showRecommendations() - elif PARAMS.has_key('mode') and PARAMS['mode'][0] == 'latest': - b.showLatest() - elif PARAMS.has_key('mode') and PARAMS['mode'][0] == 'play': - b.playContent() + if 'content_type' in PARAMS: + b.content_type = PARAMS['content_type'][0] + + if 'mode' in PARAMS: + if PARAMS['mode'][0] == 'subcat': + b.showSubCategories(PARAMS['url'][0]) + elif PARAMS['mode'][0] == 'content': + b.showContent(PARAMS['url'][0]) + elif PARAMS['mode'][0] == 'search': + b.search() + elif PARAMS['mode'][0] == 'recommend': + b.showRecommendations() + elif PARAMS['mode'][0] == 'latest': + b.showLatest() + elif PARAMS['mode'][0] == 'play': + b.playContent() else: b.showCategories() @@ -292,6 +313,4 @@ if __name__ == '__main__': b.showError(str(ex)) except Exception: - buggalo.onExceptionRaised() - - + buggalo.onExceptionRaised() \ No newline at end of file diff --git a/plugin.video.dr.dk.bonanza/addon.xml b/plugin.video.dr.dk.bonanza/addon.xml index e857faa..06ddb0e 100644 --- a/plugin.video.dr.dk.bonanza/addon.xml +++ b/plugin.video.dr.dk.bonanza/addon.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<addon id="plugin.video.dr.dk.bonanza" version="2.1.4" name="DR.dk Bonanza" provider-name="twinther [to...@winther.nu]"> +<addon id="plugin.video.dr.dk.bonanza" version="3.0.1" name="DR.dk Bonanza" provider-name="twinther"> <requires> - <import addon="xbmc.python" version="2.0"/> + <import addon="xbmc.python" version="2.1.0"/> <import addon="script.module.simplejson" version="2.0.10"/> <import addon="script.module.buggalo" version="1.1.2"/> </requires> <extension point="xbmc.python.pluginsource" library="addon.py"> - <provides>video</provides> + <provides>audio video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary lang="en">Best and worst from DR's archives</summary> @@ -18,5 +18,8 @@ <license>GPL 2.0</license> <platform>all</platform> <language>da</language> + <email>to...@winther.nu</email> + <website>http://tommy.winther.nu</website> + <source>https://github.com/xbmc-danish-addons/plugin.video.dr.dk.bonanza</source> </extension> </addon> diff --git a/plugin.video.dr.dk.bonanza/changelog.txt b/plugin.video.dr.dk.bonanza/changelog.txt index 19ca19c..bbba5a4 100644 --- a/plugin.video.dr.dk.bonanza/changelog.txt +++ b/plugin.video.dr.dk.bonanza/changelog.txt @@ -1,3 +1,13 @@ +[B]Version 3.0.1 - 2013-10-03[/B] +- Fixed playback on Raspberry Pi +- Use Python built-in json library (if available) +- Fixed duration in list view + +[B]Version 3.0.0 - 2013-05-01[/B] +- Initial version for Frodo +- Added support for Bonanza Radio content + Access the addon through the Music addons to see this. + [B]Version 2.1.4 - 2012-10-21[/B] - Fixed problems with differences between Eden and Frodo (http://trac.xbmc.org/ticket/13349) ----------------------------------------------------------------------- Summary of changes: plugin.video.dr.dk.bonanza/addon.py | 199 +++++++++++--------- plugin.video.dr.dk.bonanza/addon.xml | 9 +- plugin.video.dr.dk.bonanza/changelog.txt | 10 + plugin.video.gametest.dk/addon.py | 25 +-- plugin.video.gametest.dk/addon.xml | 2 +- plugin.video.gametest.dk/changelog.txt | 3 + plugin.video.tv3play.dk/addon.py | 34 ++-- plugin.video.tv3play.dk/addon.xml | 2 +- plugin.video.tv3play.dk/changelog.txt | 4 + .../resources/language/English/strings.xml | 3 + plugin.video.tv3play.dk/resources/settings.xml | 7 + plugin.video.videovideo.dk/addon.py | 52 +++--- plugin.video.videovideo.dk/addon.xml | 10 +- plugin.video.videovideo.dk/changelog.txt | 3 + 14 files changed, 214 insertions(+), 149 deletions(-) create mode 100644 plugin.video.tv3play.dk/resources/settings.xml hooks/post-receive -- Plugins ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Xbmc-addons mailing list Xbmc-addons@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xbmc-addons