The branch, frodo has been updated
via 6a5170508d3904824031f54f5f57855152315e12 (commit)
via 3f2fccee457fb889eb2118fd923572dd20a70fb0 (commit)
via 1d8d41ced5427484595b81a08a57b7538e9c1965 (commit)
from 69284276527e4b98618afbee128d91e0c141a3ad (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=6a5170508d3904824031f54f5f57855152315e12
commit 6a5170508d3904824031f54f5f57855152315e12
Author: beenje <[email protected]>
Date: Tue May 21 21:36:54 2013 +0200
[plugin.video.revision3] updated to version 3.0.14
diff --git a/plugin.video.revision3/addon.xml b/plugin.video.revision3/addon.xml
index 6d80fa4..e253103 100644
--- a/plugin.video.revision3/addon.xml
+++ b/plugin.video.revision3/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.revision3"
name="Revision3"
- version="3.0.13"
+ version="3.0.14"
provider-name="stacked">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
diff --git a/plugin.video.revision3/addonfunc.py
b/plugin.video.revision3/addonfunc.py
index cabf23b..0f74dd3 100644
--- a/plugin.video.revision3/addonfunc.py
+++ b/plugin.video.revision3/addonfunc.py
@@ -2,20 +2,27 @@
Addon Functions
__author__ = 'stacked <[email protected]>'
__url__ = 'http://code.google.com/p/plugin/'
-__date__ = '03-31-2013'
-__version__ = '0.0.7'
+__date__ = '05-12-2013'
+__version__ = '0.0.8'
'''
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:19.0) Gecko/20100101
Firefox/19.0'
+useragent = 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:20.0) Gecko/20100101
Firefox/20.0'
-def addListItem(label, image, url, isFolder, infoLabels = False, fanart =
False, duration = False):
+def addListItem(label, image, url, isFolder, totalItems, infoLabels = False,
fanart = False, duration = False):
listitem = xbmcgui.ListItem(label = label, iconImage = image,
thumbnailImage = image)
+ if url['mode']:
+ u = sys.argv[0] + '?' + urllib.urlencode(url)
+ else:
+ u = url['url']
if not isFolder:
if settings.getSetting('download') == '' or
settings.getSetting('download') == 'false':
listitem.setProperty('IsPlayable', 'true')
+ if settings.getSetting('playall') == 'true':
+ playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+ playlist.add(url = u, listitem = listitem)
if fanart:
listitem.setProperty('fanart_image', fanart)
if infoLabels:
@@ -25,11 +32,7 @@ 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)) } )
- 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)
+ ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u,
listitem = listitem, isFolder = isFolder, totalItems = totalItems)
return ok
def playListItem(label, image, path, infoLabels, PlayPath = False):
diff --git a/plugin.video.revision3/changelog.txt
b/plugin.video.revision3/changelog.txt
index 50f0894..7e4368a 100644
--- a/plugin.video.revision3/changelog.txt
+++ b/plugin.video.revision3/changelog.txt
@@ -1,3 +1,13 @@
+[B]Version 3.0.14[/B]
+
+- Added option to hide Daily/Extra shows (Enabled by default)
+- Added "Play All" option to play all episodes on the current page
+- Added progress bar when loading directories
+- Switch to Revision3 API for media urls
+- Fixed UnicodeEncodeError when loading Networks subdirectories
+- Fixed ValueError error when loading addon
+- Fixed Https/SSL errors
+
[B]Version 3.0.13[/B]
- Updated addon to support recent Revision3 changes
diff --git a/plugin.video.revision3/default.py
b/plugin.video.revision3/default.py
index cf10a4c..af1f55f 100644
--- a/plugin.video.revision3/default.py
+++ b/plugin.video.revision3/default.py
@@ -1,12 +1,12 @@
-import xbmc, xbmcgui, xbmcplugin, xbmcaddon, urllib, re, string, sys, os,
time, buggalo, urllib2, base64
+import xbmc, xbmcgui, xbmcplugin, xbmcaddon, urllib, re, string, sys, os,
time, buggalo, urllib2, base64, ast
import simplejson as json
plugin = 'Revision3'
__author__ = 'stacked <[email protected]>'
__url__ = 'http://code.google.com/p/plugin/'
-__date__ = '04-01-2013'
-__version__ = '3.0.13'
+__date__ = '05-12-2013'
+__version__ = '3.0.14'
settings = xbmcaddon.Addon(id='plugin.video.revision3')
buggalo.SUBMIT_URL = 'http://www.xbmc.byethost17.com/submit.php'
dbg = False
@@ -17,8 +17,9 @@ archived_thumb = os.path.join( settings.getAddonInfo( 'path'
), 'resources', 'me
recent_thumb = os.path.join( settings.getAddonInfo( 'path' ), 'resources',
'media', 'recent.png' )
featured_thumb = os.path.join( settings.getAddonInfo( 'path' ), 'resources',
'media', 'featured.png' )
networks_thumb = os.path.join( settings.getAddonInfo( 'path' ), 'resources',
'media', 'networks.png' )
+play_thumb = os.path.join( settings.getAddonInfo( 'path' ), 'resources',
'media', 'play.png' )
fanart_bg = os.path.join( settings.getAddonInfo( 'path' ), 'fanart.jpg' )
-BASE = 'https://revision3.com/api/'
+BASE = 'http://revision3.com/api/'
KEY = base64.b64decode(settings.getLocalizedString( 30025 ))
import CommonFunctions
@@ -30,48 +31,61 @@ downloader = downloader.SimpleDownloader()
from addonfunc import addListItem, playListItem, getUrl, getPage, setViewMode,
getParameters, retry
-@retry((IndexError, TypeError))
+@retry((IndexError, TypeError, ValueError))
def build_main_directory(url):
data = json.loads(getUrl(url))['shows']
if settings.getSetting('folder') == 'true' and settings.getSetting(
'downloadPath' ) and url == BASE + 'getShows' + KEY:
u = { 'mode': None, 'url': settings.getSetting( 'downloadPath'
) }
infoLabels = { "Title": settings.getLocalizedString( 30012 ),
"Plot": settings.getLocalizedString( 30022 ) }
- addListItem('[ ' + settings.getLocalizedString( 30012 ) + ' ]',
downloads_thumb, u, True, infoLabels, fanart_bg)
+ addListItem('[ ' + settings.getLocalizedString( 30012 ) + ' ]',
downloads_thumb, u, True, 0, infoLabels, fanart_bg)
if url == BASE + 'getShows' + KEY:
#Featured
u = { 'mode': '1', 'name': settings.getLocalizedString( 30023
), 'url': BASE + 'getEpisodes' + KEY + '&grouping=featured', 'slug': 'None' }
infoLabels = { "Title": settings.getLocalizedString( 30023 ),
"Plot": settings.getLocalizedString( 30024 ) }
- addListItem('[ ' + settings.getLocalizedString( 30023 ) + ' ]',
featured_thumb, u, True, infoLabels, fanart_bg)
+ addListItem('[ ' + settings.getLocalizedString( 30023 ) + ' ]',
featured_thumb, u, True, 0, infoLabels, fanart_bg)
#Most Recent
u = { 'mode': '1', 'name': settings.getLocalizedString( 30013
), 'url': BASE + 'getEpisodes' + KEY + '&grouping=latest', 'slug': 'None' }
infoLabels = { "Title": settings.getLocalizedString( 30013 ),
"Plot": settings.getLocalizedString( 30018 ) }
- addListItem('[ ' + settings.getLocalizedString( 30013 ) + ' ]',
recent_thumb, u, True, infoLabels, fanart_bg)
+ addListItem('[ ' + settings.getLocalizedString( 30013 ) + ' ]',
recent_thumb, u, True, 0, infoLabels, fanart_bg)
#Networks
u = { 'mode': '4' }
infoLabels = { "Title": settings.getLocalizedString( 30027 ),
"Plot": settings.getLocalizedString( 30028 ) }
- addListItem('[ ' + settings.getLocalizedString( 30027 ) + ' ]',
networks_thumb, u, True, infoLabels, fanart_bg)
+ addListItem('[ ' + settings.getLocalizedString( 30027 ) + ' ]',
networks_thumb, u, True, 0, infoLabels, fanart_bg)
#Archived Shows
u = { 'mode': '3', 'url': BASE + 'getShows' + KEY +
'&grouping=archived' }
infoLabels = { "Title": settings.getLocalizedString( 30014 ),
"Plot": settings.getLocalizedString( 30019 ) }
- addListItem('[ ' + settings.getLocalizedString( 30014 ) + ' ]',
archived_thumb, u, True, infoLabels, fanart_bg)
+ addListItem('[ ' + settings.getLocalizedString( 30014 ) + ' ]',
archived_thumb, u, True, 0, infoLabels, fanart_bg)
+ daily_data = {}
+ for daily_show in data:
+ if daily_show['parent_id'] != None:
+ name = daily_show['name']
+ thumb = daily_show['images']['logo'].replace('\\','')
+ url = BASE + 'getEpisodes' + KEY + '&show_id=' +
daily_show['id']
+ daily_data[daily_show['parent_id']] = { 'name': name,
'url': url, 'plot': daily_show['summary'], 'thumb': thumb}
+ totalItems = len(data) - len(daily_data)
for show in data:
- slug = show['slug']
- if not settings.getSetting(slug):
- fanart = fanart_bg
- else:
- fanart = settings.getSetting(slug)
- name = show['name']
- #fanart = show['images']['hero'].replace('\\','')
- url = BASE + 'getEpisodes' + KEY + '&show_id=' + show['id']
- u = { 'mode': '1', 'name': name, 'url': url, 'slug': slug }
- infoLabels = { "Title": name, "Plot": show['summary'] }
- addListItem(name, show['images']['logo'].replace('\\',''), u,
True, infoLabels, fanart)
+ if show['parent_id'] == None:
+ if show['id'] in daily_data:
+ daily_info = daily_data[show['id']]
+ else:
+ daily_info = 'None'
+ slug = show['slug']
+ if not settings.getSetting(slug):
+ fanart = fanart_bg
+ else:
+ fanart = settings.getSetting(slug)
+ name = show['name']
+ #fanart = show['images']['hero'].replace('\\','')
+ url = BASE + 'getEpisodes' + KEY + '&show_id=' +
show['id']
+ u = { 'mode': '1', 'name': name, 'url': url, 'slug':
slug, 'daily_info': daily_info }
+ infoLabels = { "Title": name, "Plot": show['summary'] }
+ addListItem(name,
show['images']['logo'].replace('\\',''), u, True, totalItems, infoLabels,
fanart)
xbmcplugin.addSortMethod( handle = int(sys.argv[ 1 ]), sortMethod =
xbmcplugin.SORT_METHOD_UNSORTED )
setViewMode("515")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
-@retry((IndexError, TypeError))
-def build_sub_directory(url, name, slug, offset):
+@retry((IndexError, TypeError, ValueError))
+def build_sub_directory(url, name, slug, offset, daily_info):
if slug == None:
dialog = xbmcgui.Dialog()
ok = dialog.ok( plugin , settings.getLocalizedString( 30029 ) )
@@ -96,17 +110,28 @@ def build_sub_directory(url, name, slug, offset):
except:
fanart =
'http://videos.revision3.com/revision3/images/shows/%s/%s_hero.jpg' % (slug,
slug)
if getPage(fanart)['error'] == 'HTTP Error 404: Not
Found':
- settings.setSetting(slug, fanart_bg)
+ fanart = fanart_bg
+ settings.setSetting(slug, fanart)
else:
settings.setSetting(slug, fanart)
+ else:
+ fanart = fanart_bg
+ if daily_info != 'None' and settings.getSetting('daily') == 'true':
+ daily_info = ast.literal_eval(daily_info)
+ u = { 'mode': '1', 'name': daily_info['name'], 'url':
daily_info['url'], 'slug': slug, 'daily_info': 'None' }
+ infoLabels = { "Title": daily_info['name'], "Plot":
daily_info['plot'] }
+ addListItem('[ ' + daily_info['name'] + ' ]',
daily_info['thumb'], u, True, 0, infoLabels, fanart)
+ if settings.getSetting('download') == '' or
settings.getSetting('download') == 'false':
+ if settings.getSetting('playall') == 'true':
+ playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+ playlist.clear()
+ u = { 'mode': '6' }
+ infoLabels = { "Title": settings.getLocalizedString(
30030 ), "Plot": settings.getLocalizedString( 30031 ) }
+ addListItem('* ' + settings.getLocalizedString( 30030 )
+ ' *', play_thumb, u, True, 0, infoLabels, fanart)
for episode in data['episodes']:
studio = episode['show']['name']
thumb = episode['images']['medium']
- url = episode['slug']
- if not settings.getSetting(episode['show']['slug']):
- fanart = fanart_bg
- else:
- fanart = settings.getSetting(episode['show']['slug'])
+ url = episode['media']
plot = episode['summary'].encode('ascii', 'ignore')
name = episode['name'].encode('ascii', 'ignore')
episodenum = episode['number']
@@ -114,11 +139,11 @@ def build_sub_directory(url, name, slug, offset):
duration = int(episode['duration'])
infoLabels = { "Title": name, "Studio": studio, "Plot": plot,
"Episode": int(episodenum), "Aired": date }
u = { 'mode': '2', 'name': name, 'url': url, 'plot': plot,
'studio': studio, 'episode': episodenum, 'thumb': thumb, 'date': date }
- addListItem(plot, thumb, u, False, infoLabels, fanart, duration)
+ addListItem(plot, thumb, u, False, len(data['episodes']),
infoLabels, fanart, duration)
if (int(data['total']) - ((offset + 1) * 25)) > 0:
- u = { 'mode': '1', 'name': studio, 'url': saveurl, 'slug':
slug, 'offset': offset + 1 }
+ u = { 'mode': '1', 'name': studio, 'url': saveurl, 'slug':
slug, 'offset': offset + 1, 'daily_info': 'None' }
infoLabels = { "Title": settings.getLocalizedString( 30016 ),
"Plot": settings.getLocalizedString( 30016 ) }
- addListItem(settings.getLocalizedString( 30016 ) + ' (' + str(
offset + 2 ) + ')', next_thumb, u, True, infoLabels, fanart_bg)
+ addListItem(settings.getLocalizedString( 30016 ) + ' (' + str(
offset + 2 ) + ')', next_thumb, u, True, 0, infoLabels, fanart)
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_UNSORTED )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_EPISODE )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_STUDIO )
@@ -139,7 +164,7 @@ def build_networks_directory():
plot = common.parseDOM(meta, "p")[0].rsplit('\n ')[1]
u = { 'mode': '5', 'url': url }
infoLabels = { "Title": name, "Plot": plot }
- addListItem(name, image, u, True, infoLabels, fanart_bg)
+ addListItem(name, image, u, True, len(item), infoLabels,
fanart_bg)
xbmcplugin.addSortMethod( handle = int(sys.argv[ 1 ]), sortMethod =
xbmcplugin.SORT_METHOD_UNSORTED )
setViewMode("515")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
@@ -153,6 +178,13 @@ def build_networks_sub_directory(url, offset):
dialog = xbmcgui.Dialog()
ok = dialog.ok( plugin , settings.getLocalizedString( 30026 ) +
' this page.' )
return
+ if settings.getSetting('download') == '' or
settings.getSetting('download') == 'false':
+ if settings.getSetting('playall') == 'true':
+ playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+ playlist.clear()
+ u = { 'mode': '6' }
+ infoLabels = { "Title": settings.getLocalizedString(
30030 ), "Plot": settings.getLocalizedString( 30031 ) }
+ addListItem('* ' + settings.getLocalizedString( 30030 )
+ ' *', play_thumb, u, True, 0, infoLabels, fanart_bg)
for item in networkItem:
url = common.parseDOM(item, "a", attrs = { "class":
"playlistPlay clear" }, ret = "href")[0][1:]
thumbnail = common.parseDOM(item, "div", attrs = { "class":
"thumbnail" })
@@ -160,14 +192,14 @@ def build_networks_sub_directory(url, offset):
meta = common.parseDOM(item, "div", attrs = { "class": "meta" })
name = common.parseDOM(meta, "div", attrs = { "class": "title"
})[0]
studio = common.parseDOM(meta, "div", attrs = { "class":
"showtitle" })[0]
- plot = common.parseDOM(meta, "div", attrs = { "class":
"itemPreview" })[0]
+ plot = common.parseDOM(meta, "div", attrs = { "class":
"itemPreview" })[0].encode('ascii', 'ignore')
infoLabels = { "Title": name, "Studio": studio, "Plot": plot }
u = { 'mode': '2', 'name': name, 'url': url, 'plot': plot,
'studio': studio, 'episode': '0', 'thumb': image, 'date': '0000-00-00' }
- addListItem(name, image, u, False, infoLabels, fanart_bg)
+ addListItem(name, image, u, False, len(networkItem),
infoLabels, fanart_bg)
if len(networkItem) == 25:
u = { 'mode': '5', 'url': saveurl, 'offset': offset + 1 }
infoLabels = { "Title": settings.getLocalizedString( 30016 ),
"Plot": settings.getLocalizedString( 30016 ) }
- addListItem(settings.getLocalizedString( 30016 ) + ' (' + str(
offset + 2 ) + ')', next_thumb, u, True, infoLabels, fanart_bg)
+ addListItem(settings.getLocalizedString( 30016 ) + ' (' + str(
offset + 2 ) + ')', next_thumb, u, True, 0, infoLabels, fanart_bg)
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_UNSORTED )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_EPISODE )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ),
sortMethod=xbmcplugin.SORT_METHOD_STUDIO )
@@ -177,24 +209,38 @@ def build_networks_sub_directory(url, offset):
@retry((IndexError, TypeError))
def get_video(url, name, plot, studio, episode, thumb, date):
- oembed =
getUrl('http://revision3.com/api/oembed/?url=http://revision3.com/%s/&format=json'
% url)
- video_id =
re.compile('html5player\-v(.+?)\?external').findall(oembed)[0]
- api = getUrl('http://revision3.com/api/flash?video_id=' + video_id)
- videos_api = common.parseDOM(api, "media", ret = "type")
- videos_api[:] = (value for value in videos_api if value != 'thumbnail')
- durl = {}
- for type_api in videos_api:
- content_api = clean(common.parseDOM(api, "media", attrs = {
"type": type_api })[0])
- durl[type_api] = content_api
- try:
- url = durl[settings.getSetting('format').lower()]
- except:
- if 'high' in durl:
- url = durl['high']
- elif 'low' in durl:
- url = durl['low']
- else:
- url = str(durl.items()[0][1])
+ if '{' in url:
+ url = ast.literal_eval(url)
+ try:
+ path =
url[settings.getSetting('format').lower().replace('hd','hd720p30').replace('high','large').replace('low','small')]['url']
+ except:
+ if 'hd' in url:
+ path = url['hd']['url']
+ elif 'large' in url:
+ path = url['large']['url']
+ elif 'small' in url:
+ path = url['small']['url']
+ else:
+ path = url.items()[0][1]['url']
+ else:
+ oembed =
getUrl('http://revision3.com/api/oembed/?url=http://revision3.com/%s/&format=json'
% url)
+ video_id =
re.compile('html5player\-v(.+?)\?external').findall(oembed)[0]
+ api = getUrl('http://revision3.com/api/flash?video_id=' +
video_id)
+ videos_api = common.parseDOM(api, "media", ret = "type")
+ videos_api[:] = (value for value in videos_api if value !=
'thumbnail')
+ durl = {}
+ for type_api in videos_api:
+ content_api = clean(common.parseDOM(api, "media", attrs
= { "type": type_api })[0])
+ durl[type_api] = content_api
+ try:
+ path = durl[settings.getSetting('format').lower()]
+ except:
+ if 'high' in durl:
+ path = durl['high']
+ elif 'low' in durl:
+ path = durl['low']
+ else:
+ path = str(durl.items()[0][1])
if settings.getSetting('download') == 'true':
while not settings.getSetting('downloadPath'):
if settings.getSetting('download') == 'false':
@@ -203,11 +249,16 @@ def get_video(url, name, plot, studio, episode, thumb,
date):
dialog = xbmcgui.Dialog()
ok = dialog.ok(plugin, settings.getLocalizedString(
30011 ))
settings.openSettings()
- params = { "url": url, "download_path":
settings.getSetting('downloadPath'), "Title": name }
- downloader.download(clean_file(name) + '.' +
url.split('/')[-1].split('.')[-1], params)
+ params = { "url": path, "download_path":
settings.getSetting('downloadPath'), "Title": name }
+ downloader.download(clean_file(name) + '.' +
path.split('/')[-1].split('.')[-1], params)
else:
infoLabels = { "Title": name, "Studio": 'Revision3: ' + studio,
"Plot": plot, "Episode": int(episode), "Aired": date }
- playListItem(label = name, image = thumb, path = url,
infoLabels = infoLabels, PlayPath = False)
+ playListItem(label = name, image = thumb, path = path,
infoLabels = infoLabels, PlayPath = False)
+
+def playall():
+ playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+ xbmc.Player().play(playlist)
+ return
def clean(name):
remove = [('&','&'), ('"','"'), (''','\''), ('\r\n',' '),
('\n',' '), (''','\''), ('–','-'), ('%3A',':'), ('%2F','/'),
('<link>',''), ('</link>','')]
@@ -231,6 +282,7 @@ episode = None
thumb = None
date = None
slug = None
+daily_info = 'None'
offset = 0
try:
@@ -270,6 +322,10 @@ try:
except:
pass
try:
+ daily_info = urllib.unquote_plus(params["daily_info"])
+except:
+ pass
+try:
offset = int( params['offset'] )
except:
pass
@@ -279,7 +335,7 @@ try:
url = BASE + 'getShows' + KEY
build_main_directory(url)
elif mode == 1:
- build_sub_directory(url, name, slug, offset)
+ build_sub_directory(url, name, slug, offset, daily_info)
elif mode == 2:
get_video(url, name, plot, studio, episode, thumb, date)
elif mode == 3:
@@ -288,5 +344,7 @@ try:
build_networks_directory()
elif mode == 5:
build_networks_sub_directory(url, offset)
+ elif mode == 6:
+ playall()
except Exception:
buggalo.onExceptionRaised()
diff --git a/plugin.video.revision3/resources/language/English/strings.xml
b/plugin.video.revision3/resources/language/English/strings.xml
index f35927b..96c7c34 100644
--- a/plugin.video.revision3/resources/language/English/strings.xml
+++ b/plugin.video.revision3/resources/language/English/strings.xml
@@ -28,6 +28,10 @@
<string id="30027">Networks</string>
<string id="30028">Whether you're a gamer, tech enthusiast, or just
like to know what's hot right now you can't miss Revision3's newest networks!
Tune in for all the best content plus bonus clips you won't see anywhere
else.</string>
<string id="30029">Please update your Revision3 favorites.</string>
+ <string id="30030">Play All</string>
+ <string id="30031">Play all episodes on the current page.</string>
+ <string id="30032">Enable Play All option</string>
+ <string id="30033">Enable Daily/Extra Shows</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>
diff --git a/plugin.video.revision3/resources/settings.xml
b/plugin.video.revision3/resources/settings.xml
index 14c87c8..2dd2a47 100644
--- a/plugin.video.revision3/resources/settings.xml
+++ b/plugin.video.revision3/resources/settings.xml
@@ -1,5 +1,7 @@
<settings>
<setting id="format" type="labelenum" lvalues="30001|30002|30003"
label="30000" default="HD"/>
+ <setting id="daily" type="bool" label="30033" default="true"/>
+ <setting id="playall" type="bool" label="30032" default="false"/>
<setting id="download" type="bool" label="30004" default="false"/>
<setting id="downloadPath" type="folder" enable="eq(-1,true)" label="30005"
default="" />
<setting id="folder" type="bool" enable="eq(-2,true)" label="30008"
default="true"/>
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=3f2fccee457fb889eb2118fd923572dd20a70fb0
commit 3f2fccee457fb889eb2118fd923572dd20a70fb0
Author: beenje <[email protected]>
Date: Tue May 21 21:36:42 2013 +0200
[plugin.video.mediathek] updated to version 0.5.4
diff --git a/plugin.video.mediathek/addon.xml b/plugin.video.mediathek/addon.xml
index 9e8f941..a6125e8 100644
--- a/plugin.video.mediathek/addon.xml
+++ b/plugin.video.mediathek/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="plugin.video.mediathek"
- version="0.5.3"
+ version="0.5.4"
name="Mediathek"
provider-name="Raptor 2101 [[email protected]]">
<requires>
@@ -25,5 +25,10 @@ Currently implemented:
</description>
<language>de</language>
<platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
+ <forum>https://github.com/raptor2101/Mediathek/issues</forum>
+ <website>https://github.com/raptor2101/Mediathek</website>
+ <source>https://github.com/raptor2101/Mediathek</source>
+ <email>[email protected]</email>
</extension>
</addon>
diff --git a/plugin.video.mediathek/changelog.txt
b/plugin.video.mediathek/changelog.txt
index 0b3c65d..8040656 100644
--- a/plugin.video.mediathek/changelog.txt
+++ b/plugin.video.mediathek/changelog.txt
@@ -1,3 +1,4 @@
+0.5.4 - FIX: NDR Fixed by dethfeet
0.5.2 - FIX: adopt some specialities in the ARD Format
0.5.2 - FIX: Get all ARD features back working
0.5.1 - FIX: Get ARD working again (without "Sendungen A-Z")
diff --git a/plugin.video.mediathek/mediathek/ndr.py
b/plugin.video.mediathek/mediathek/ndr.py
index 07eb09f..a23247b 100644
--- a/plugin.video.mediathek/mediathek/ndr.py
+++ b/plugin.video.mediathek/mediathek/ndr.py
@@ -16,17 +16,19 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re,time
+import pprint
from mediathek import *
from xml.dom import minidom;
-regex_dateString = re.compile("\\d{4}-\\d{2}-\\d{2}");
-
class NDRMediathek(Mediathek):
@classmethod
+
def name(self):
return "NDR";
+
def isSearchable(self):
return True;
+
def __init__(self, simpleXbmcGui):
self.gui = simpleXbmcGui;
@@ -45,7 +47,8 @@ class NDRMediathek(Mediathek):
self.rootLink = "http://www.ndr.de"
self.menuLink =
self.rootLink+"/mediathek/mediathek100-mediathek_medium-tv_searchtype-"
- self.searchLink = self.menuLink+"fulltext_pageSize-"+self.pageSize+".xml?";
+
+ self.searchLink =
self.rootLink+"/mediathek/mediatheksuche101.html?pagenumber=1&search_video=true&"
self.regex_extractVideoLink =
re.compile("rtmpt://ndr.fcod.llnwd.net/a3715/d1/flashmedia/streams/ndr/(.*\\.)(hi.mp4|lo.flv)");
@@ -55,6 +58,8 @@ class NDRMediathek(Mediathek):
self.mmsBaseLink =
"mms://a874.v1608102.c160810.g.vm.akamaistream.net/7/874/160810/v0001/wm.origin.ndr.gl-systemhaus.de/msmedia/";
self.httpBaseLink = "http://media.ndr.de/progressive/";
+
+ #Hauptmenue
self.menuTree = [
TreeNode("0","Die neuesten
Videos",self.menuLink+"teasershow_pageSize-"+self.pageSize+".xml",True),
];
@@ -68,25 +73,40 @@ class NDRMediathek(Mediathek):
for menuNode in menuNodes:
menuId = menuNode.getAttribute('id')
menuItem = unicode(menuNode.firstChild.data)
- menuLink =
self.rootLink+"/mediathek/mediathek100-mediathek_medium-tv_broadcast-"+menuId+"_pageSize-"+self.pageSize+".xml"
+ menuLink =
self.rootLink+"/mediatheksuche105_broadcast-"+menuId+"_format-video_page-1.html"
self.menuTree.append(TreeNode(str(x),menuItem,menuLink,True));
x = x+1
def buildPageMenu(self, link, initCount):
self.gui.log("buildPageMenu: "+link);
- rssFeed = self.loadConfigXml(link);
- self.extractVideoObjects(rssFeed, initCount);
+ htmlPage = self.loadPage(link);
+
+ regex_extractVideoItems = re.compile("<div
class=\"m_teaser\">(.*?)</p>\n</div>\n</div>",re.DOTALL);
+ regex_extractVideoItemHref = re.compile("<a href=\".*?/([^/]*?)\.html\"
title=\".*?\" .*?>");
+ regex_extractVideoItemDate = re.compile("<div
class=\"subline\">.*?(\\d{2}\.\\d{2}\.\\d{4} \\d{2}:\\d{2})</div>");
+
+ videoItems = regex_extractVideoItems.findall(htmlPage)
+ nodeCount = initCount + len(videoItems)
+
+ for videoItem in videoItems:
+ videoID = regex_extractVideoItemHref.search(videoItem).group(1)
+ dateString = regex_extractVideoItemDate.search(videoItem).group(1)
+ dateTime = time.strptime(dateString,"%d.%m.%Y %H:%M");
+ self.extractVideoInformation(videoID,dateTime,nodeCount)
+
+ #Pagination (weiter)
+ regex_extractNextPage = re.compile("<a href=\"(.*?)\"
class=\"button_next\" title=\"(.*?)\".*?>")
+ nextPageHref = regex_extractNextPage.search(htmlPage)
+ if nextPageHref:
+ menuItemName = nextPageHref.group(2)
+ link = self.rootLink+nextPageHref.group(1)
+
self.gui.buildVideoLink(DisplayObject(menuItemName,"","","description",link,False),self,nodeCount+1);
def searchVideo(self, searchText):
- searchText = searchText.replace( u'\xf6',"oe")
- searchText = searchText.replace( u'\xe4',"ae")
- searchText = searchText.replace( u'\xfc',"ue")
- searchText = searchText.replace( u'\xdf',"ss")
- searchText = searchText.encode("latin1")
- searchText = urllib.urlencode({"searchtext" : searchText})
- self.buildPageMenu(self.searchLink+searchText,0);
- print searchText
+ searchText = searchText.encode("UTF-8")
+ searchText = urllib.urlencode({"query" : searchText})
+ self.buildPageMenu(self.searchLink+searchText,0);
def readText(self,node,textNode):
try:
@@ -98,22 +118,13 @@ class NDRMediathek(Mediathek):
def loadConfigXml(self, link):
self.gui.log("load:"+link)
xmlPage = self.loadPage(link);
+ xmlPage = xmlPage.replace(" & "," & ")
+
try:
xmlDom = minidom.parseString(xmlPage);
except:
xmlDom = False
return xmlDom;
-
- def extractVideoObjects(self, rssFeed, initCount):
- nodes = rssFeed.getElementsByTagName("mediaItem");
- nodeCount = initCount + len(nodes)
- for itemNode in nodes:
- self.extractVideoInformation(itemNode,nodeCount);
-
- def parseDate(self,dateString):
- dateString = regex_dateString.search(dateString).group();
-
- return time.strptime(dateString,"%Y-%m-%d");
def loadVideoLinks(self, videoNode):
videoSources = videoNode.getElementsByTagName("sources")[0]
@@ -142,12 +153,7 @@ class NDRMediathek(Mediathek):
return links;
- def extractVideoInformation(self, itemNode, nodeCount):
- videoId = itemNode.getAttribute("id")
-
- dateString = self.readText(itemNode,"date");
- pubDate = self.parseDate(dateString);
-
+ def extractVideoInformation(self, videoId, pubDate, nodeCount):
videoPage =
self.rootLink+"/fernsehen/sendungen/media/"+videoId+"-avmeta.xml"
videoNode = self.loadConfigXml(videoPage)
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=1d8d41ced5427484595b81a08a57b7538e9c1965
commit 1d8d41ced5427484595b81a08a57b7538e9c1965
Author: beenje <[email protected]>
Date: Tue May 21 21:36:40 2013 +0200
[plugin.video.servustv] updated to version 0.0.6
diff --git a/plugin.video.servustv/addon.xml b/plugin.video.servustv/addon.xml
index 73ebe63..485397a 100644
--- a/plugin.video.servustv/addon.xml
+++ b/plugin.video.servustv/addon.xml
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.servustv" name="ServusTV - Mediathek" version="0.0.4"
provider-name="dethfeet">
- <requires>
- <import addon="xbmc.python" version="2.0"/>
- <import addon="script.module.pyamf" version="0.6.1"/>
- </requires>
- <extension point="xbmc.python.pluginsource" library="default.py">
- <provides>video</provides>
- </extension>
- <extension point="xbmc.addon.metadata">
- <language>de</language>
- <summary lang="en">ServusTV (german television)</summary>
- <summary lang="de">ServusTV - Wir wünschen Ihnen bessere
Unterhaltung.</summary>
- <description lang="en">ServusTV (german television)</description>
- <description lang="de">Hier finden Sie Ihre Lieblingssendungen aus dem
Programm von ServusTV zum immer wieder Sehen</description>
- <platform>all</platform>
- </extension>
-</addon>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.servustv" name="ServusTV - Mediathek" version="0.0.6"
provider-name="dethfeet">
+ <requires>
+ <import addon="xbmc.python" version="2.1.0"/>
+ <import addon="script.module.pyamf" version="0.6.1"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <language>de</language>
+ <summary lang="en">ServusTV (german television)</summary>
+ <summary lang="de">ServusTV - Wir wünschen Ihnen bessere
Unterhaltung.</summary>
+ <description lang="en">ServusTV (german television)</description>
+ <description lang="de">Hier finden Sie Ihre Lieblingssendungen aus dem
Programm von ServusTV zum immer wieder Sehen</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+
<forum>http://www.xbmcnerds.com/index.php?page=Thread&threadID=13548</forum>
+ <website>https://github.com/dethfeet/plugin.video.servustv</website>
+ <source>https://github.com/dethfeet/plugin.video.servustv</source>
+ <email>[email protected]</email>
+ </extension>
+</addon>
diff --git a/plugin.video.servustv/brightcovePlayer.py
b/plugin.video.servustv/brightcovePlayer.py
index 485a79f..beee27c 100644
--- a/plugin.video.servustv/brightcovePlayer.py
+++ b/plugin.video.servustv/brightcovePlayer.py
@@ -1,46 +1,46 @@
-import httplib
-from pyamf import AMF0, AMF3
-
-from pyamf import remoting
-from pyamf.remoting.client import RemotingService
-
-playerKey = "AQ~~,AAAA0Zd2KCE~,a1ZzPs5ODGffVvk2dn1CRCof3Ru_I9gE"
-#playerKey = "AAAAAGLvCOI~,a0C3h1Jh3aQKs2UcRZrrxyrjE0VH93xl"
-
-def build_amf_request(const, playerID, videoPlayer, publisherID):
- env = remoting.Envelope(amfVersion=3)
- env.bodies.append(
- (
- "/2",
- remoting.Request(
-
target="com.brightcove.player.runtime.PlayerMediaFacade.findMediaByReferenceId",
- body=[const, playerID, videoPlayer, publisherID],
- envelope=env
- )
- )
- )
- return env
-
-def get_clip_info(const, playerID, videoPlayer, publisherID):
-
- conn = httplib.HTTPConnection("c.brightcove.com")
- envelope = build_amf_request(const, playerID, videoPlayer, publisherID)
- conn.request("POST", "/services/messagebroker/amf?playerKey=" + playerKey,
str(remoting.encode(envelope).read()), {'content-type': 'application/x-amf'})
- response = conn.getresponse().read()
- response = remoting.decode(response).bodies[0][1].body
- return response
-
-def play(const, playerID, videoPlayer, publisherID, height):
- rtmpdata = get_clip_info(const, playerID, videoPlayer, publisherID)
-
- streamName = ""
- streamUrl = "";
-
- for item in sorted(rtmpdata['renditions'], key=lambda
item:item['frameHeight'], reverse=False):
- streamHeight = item['frameHeight']
-
- if streamHeight <= height:
- streamUrl = item['defaultURL']
-
- streamName = streamName + rtmpdata['displayName']
- return [streamName, streamUrl];
+import httplib
+from pyamf import AMF0, AMF3
+
+from pyamf import remoting
+from pyamf.remoting.client import RemotingService
+
+playerKey = "AQ~~,AAAA0Zd2KCE~,a1ZzPs5ODGffVvk2dn1CRCof3Ru_I9gE"
+#playerKey = "AAAAAGLvCOI~,a0C3h1Jh3aQKs2UcRZrrxyrjE0VH93xl"
+
+def build_amf_request(const, playerID, videoPlayer, publisherID):
+ env = remoting.Envelope(amfVersion=3)
+ env.bodies.append(
+ (
+ "/2",
+ remoting.Request(
+
target="com.brightcove.player.runtime.PlayerMediaFacade.findMediaByReferenceId",
+ body=[const, playerID, videoPlayer, publisherID],
+ envelope=env
+ )
+ )
+ )
+ return env
+
+def get_clip_info(const, playerID, videoPlayer, publisherID):
+
+ conn = httplib.HTTPConnection("c.brightcove.com")
+ envelope = build_amf_request(const, playerID, videoPlayer, publisherID)
+ conn.request("POST", "/services/messagebroker/amf?playerKey=" + playerKey,
str(remoting.encode(envelope).read()), {'content-type': 'application/x-amf'})
+ response = conn.getresponse().read()
+ response = remoting.decode(response).bodies[0][1].body
+ return response
+
+def play(const, playerID, videoPlayer, publisherID, height):
+ rtmpdata = get_clip_info(const, playerID, videoPlayer, publisherID)
+
+ streamName = ""
+ streamUrl = "";
+
+ for item in sorted(rtmpdata['renditions'], key=lambda
item:item['frameHeight'], reverse=False):
+ streamHeight = item['frameHeight']
+
+ if streamHeight <= height:
+ streamUrl = item['defaultURL']
+
+ streamName = streamName + rtmpdata['displayName']
+ return [streamName, streamUrl];
diff --git a/plugin.video.servustv/changelog.txt
b/plugin.video.servustv/changelog.txt
index 34d6b79..9b62f52 100755
--- a/plugin.video.servustv/changelog.txt
+++ b/plugin.video.servustv/changelog.txt
@@ -1,3 +1,6 @@
+0.0.6 - Fix addon.xml
+ Fix to comply with official repo requirements
+0.0.5 - Make plugin work again
0.0.4 - Add changelog
Update addon.xml
Remove pyamf
diff --git a/plugin.video.servustv/default.py b/plugin.video.servustv/default.py
index f31524b..8aacff0 100644
--- a/plugin.video.servustv/default.py
+++ b/plugin.video.servustv/default.py
@@ -1,154 +1,156 @@
-import xbmcplugin
-import xbmcgui
-import xbmcaddon
-import sys
-import urllib, urllib2
-import pprint
-import re
-import urlparse
-import brightcovePlayer
-
-addon = xbmcaddon.Addon(id='plugin.video.servustv')
-
-thisPlugin = int(sys.argv[1])
-baseLink = "http://www.servustv.com/"
-
-mediathekLink = baseLink + "cs/Satellite/VOD-Mediathek/001259088496198"
-showLink = baseLink +
"cs/Satellite?categoryId=%s&categoryNodeId=%s&pagename=ServusTV/Ajax/MediathekData&nachThemen=all&nachSendung=%s&nachThemenNodeId=null&nachThemen_changed=1&nachSendung_changed=2&ajax=true"
-searchLink = baseLink +
"cs/Satellite?cid=¤tPage=1&pagename=servustv/Page/SearchResultsRenderer&searchkey=%s&tabType=video"
-
-height = 1080
-const = "8e99dff8de8d8e378ac3f68ed404dd4869a4c007"
-playerID = 1254928709001
-publisherID = 900189268001
-
-playerKey = "AQ~~,AAAA0Zd2KCE~,a1ZzPs5ODGffVvk2dn1CRCof3Ru_I9gE"
-
-_regex_extractCategories = re.compile("<li
class=(\"allevideos\"|'category[0-9]{1}')><a href='(.*?)'>(.*?)</a></li>",
re.DOTALL)
-_regex_extractShows = re.compile("<select name=\"nachSendung\"
id=\"nachSendung\">.*?</select>", re.DOTALL)
-_regex_extractShow = re.compile("<option value='(.*?)'>(.*?)</option>")
-
-
-_regex_extractShowNext = re.compile("<li><a href='(.*?)'
class=\"nachste\">.*?</a></li>")
-
-_regex_extractEpisode = re.compile("<!-- videotype:vod -->[ \n\r\t]*<li
class='.*?'>.*?<a href='#' title='(.*?)'.*?<img
src='(.*?)'.*?name=\"videoList\.featured\" value='([0-9]*)'/>.*?Sendung vom
([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}).*?(<div
class=\"programDescription\">|<span
class=\"description\">)(.*?)(</div>|</span>).*?</li>", re.DOTALL)
-
-def mainPage():
- page = load_page(mediathekLink)
-
- menu_name = addon.getLocalizedString(30001)
- addDirectoryItem(menu_name, {"action" : "search"})
-
- for category in _regex_extractCategories.finditer(page):
- menu_link = category.group(2)
- menu_name = category.group(3)
- addDirectoryItem(menu_name.strip(), {"action" : "category", "link":
menu_link})
- xbmcplugin.endOfDirectory(thisPlugin)
-
-def showCategory(link):
- link = urllib.unquote(link)
- page = load_page(baseLink + link)
- categoryId = link[link.find("?p=")+3:]
-
- menu_link = showLink % (categoryId,"","")
- menu_name = addon.getLocalizedString(30000)
- addDirectoryItem(menu_name, {"action" : "show", "link": menu_link})
-
- shows = _regex_extractShows.search(page)
-
- for show in _regex_extractShow.finditer(shows.group(0)):
- menu_link = showLink % (categoryId,"",show.group(1))
- menu_name = show.group(2)
- addDirectoryItem(menu_name, {"action" : "show", "link": menu_link})
- xbmcplugin.endOfDirectory(thisPlugin)
-
-def showPage(link=None):
- page = load_page(link)
-
- for episode in _regex_extractEpisode.finditer(page):
- date = episode.group(4)
- name = episode.group(1)
- name = name + " (" + date + ")"
- url = episode.group(3)
- thumbnail = baseLink + episode.group(2)
- addDirectoryItem(name, {'action':"episode", 'link':url}, thumbnail,
False)
-
- showMore = _regex_extractShowNext.search(page)
- if showMore is not None:
- menu_name = addon.getLocalizedString(30002)
- addDirectoryItem(menu_name, {"action" : "show", "link": baseLink +
showMore.group(1)})
-
- xbmcplugin.endOfDirectory(thisPlugin)
-
-def playEpisode(videoPlayer):
- brightcove_item = brightcovePlayer.play(const, playerID, str(videoPlayer),
publisherID, height)
- stream_url = brightcove_item[1]
- rtmpbase = stream_url[0:stream_url.find("&")]
- playpath = stream_url[stream_url.find("&") + 1:]
-
- finalurl = rtmpbase + ' playpath=' + playpath
-
- item = xbmcgui.ListItem(path=finalurl)
- xbmcplugin.setResolvedUrl(thisPlugin, True, item)
-
-def searchVideo():
- keyboard = xbmc.Keyboard("")
- keyboard.doModal();
- searchString = keyboard.getText()
- searchString = searchString.strip()
- searchString = urllib.quote_plus(searchString)
-
- if searchString == "":
- return False
-
- searchUrl = searchLink % (searchString)
- showPage(searchUrl)
-
-def load_page(url):
- print url
- req = urllib2.Request(url)
- response = urllib2.urlopen(req)
- link = response.read()
- response.close()
- return link
-
-def addDirectoryItem(name, parameters={}, pic="", folder=True):
- li = xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=pic)
- if not folder:
- li.setProperty('IsPlayable', 'true')
- url = sys.argv[0] + '?' + urllib.urlencode(parameters)
- return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url,
listitem=li, isFolder=folder)
-
-def get_params():
- param = []
- paramstring = sys.argv[2]
- if len(paramstring) >= 2:
- params = sys.argv[2]
- cleanedparams = params.replace('?', '')
- if (params[len(params) - 1] == '/'):
- params = params[0:len(params) - 2]
- pairsofparams = cleanedparams.split('&')
- param = {}
- for i in range(len(pairsofparams)):
- splitparams = {}
- splitparams = pairsofparams[i].split('=')
- if (len(splitparams)) == 2:
- param[splitparams[0]] = splitparams[1]
-
- return param
-
-
-if not sys.argv[2]:
- mainPage()
-else:
- params = get_params()
- if params['action'] == "category":
- showCategory(params['link'])
- elif params['action'] == "show":
- showPage(urllib.unquote(params['link']))
- elif params['action'] == "episode":
- playEpisode(params['link'])
- elif params['action'] == "search":
- searchVideo()
- else:
- mainPage()
+import xbmcplugin
+import xbmcgui
+import xbmcaddon
+import sys
+import urllib, urllib2
+import pprint
+import re
+import urlparse
+import brightcovePlayer
+
+urllib2.socket.setdefaulttimeout(30)
+
+addon = xbmcaddon.Addon(id='plugin.video.servustv')
+
+thisPlugin = int(sys.argv[1])
+baseLink = "http://www.servustv.com/"
+
+mediathekLink = baseLink + "cs/Satellite/VOD-Mediathek/001259088496198"
+showLink = baseLink +
"cs/Satellite?categoryId=%s&categoryNodeId=%s&pagename=ServusTV/Ajax/MediathekData&nachThemen=all&nachSendung=%s&nachThemenNodeId=null&nachThemen_changed=1&nachSendung_changed=2&ajax=true"
+searchLink = baseLink +
"cs/Satellite?cid=¤tPage=1&pagename=servustv/Page/SearchResultsRenderer&searchkey=%s&tabType=video"
+
+height = 1080
+const = "8e99dff8de8d8e378ac3f68ed404dd4869a4c007"
+playerID = 1254928709001
+publisherID = 900189268001
+
+playerKey = "AQ~~,AAAA0Zd2KCE~,a1ZzPs5ODGffVvk2dn1CRCof3Ru_I9gE"
+
+_regex_extractCategories = re.compile("<li
class=(\"allevideos\"|'category[0-9]{1}')><a href='(.*?)'>(.*?)</a></li>",
re.DOTALL)
+_regex_extractShows = re.compile("<select name=\"nachSendung\"
id=\"nachSendung\">.*?</select>", re.DOTALL)
+_regex_extractShow = re.compile("<option value='(.*?)'>(.*?)</option>")
+
+
+_regex_extractShowNext = re.compile("<li><a href='(.*?)'
class=\"nachste\">.*?</a></li>")
+
+_regex_extractEpisode = re.compile("<!-- videotype:vod -->[ \n\r\t]*<li
class='.*?'>.*?<a href='#' title='(.*?)'.*?<img
src='(.*?)'.*?name=\"videoList\.featured\" value='([0-9]*)'/>.*?Sendung vom
([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}).*?(<div
class=\"programDescription\">|<span
class=\"description\">)(.*?)(</div>|</span>).*?</li>", re.DOTALL)
+
+def mainPage():
+ page = load_page(mediathekLink)
+
+ menu_name = addon.getLocalizedString(30001)
+ addDirectoryItem(menu_name, {"action" : "search"})
+
+ for category in _regex_extractCategories.finditer(page):
+ menu_link = category.group(2)
+ menu_name = category.group(3)
+ addDirectoryItem(menu_name.strip(), {"action" : "category", "link":
menu_link})
+ xbmcplugin.endOfDirectory(thisPlugin)
+
+def showCategory(link):
+ link = urllib.unquote(link)
+ page = load_page(baseLink + link)
+ categoryId = link[link.find("?p=")+3:]
+
+ menu_link = showLink % (categoryId,"","")
+ menu_name = addon.getLocalizedString(30000)
+ addDirectoryItem(menu_name, {"action" : "show", "link": menu_link})
+
+ shows = _regex_extractShows.search(page)
+
+ for show in _regex_extractShow.finditer(shows.group(0)):
+ menu_link = showLink % (categoryId,"",show.group(1))
+ menu_name = show.group(2)
+ addDirectoryItem(menu_name, {"action" : "show", "link": menu_link})
+ xbmcplugin.endOfDirectory(thisPlugin)
+
+def showPage(link=None):
+ page = load_page(link)
+
+ for episode in _regex_extractEpisode.finditer(page):
+ date = episode.group(4)
+ name = episode.group(1)
+ name = name + " (" + date + ")"
+ url = episode.group(3)
+ thumbnail = baseLink + episode.group(2)
+ addDirectoryItem(name, {'action':"episode", 'link':url}, thumbnail,
False)
+
+ showMore = _regex_extractShowNext.search(page)
+ if showMore is not None:
+ menu_name = addon.getLocalizedString(30002)
+ addDirectoryItem(menu_name, {"action" : "show", "link": baseLink +
showMore.group(1)})
+
+ xbmcplugin.endOfDirectory(thisPlugin)
+
+def playEpisode(videoPlayer):
+ brightcove_item = brightcovePlayer.play(const, playerID, str(videoPlayer),
publisherID, height)
+ stream_url = brightcove_item[1]
+ rtmpbase = stream_url[0:stream_url.find("&")]
+ playpath = stream_url[stream_url.find("&") + 1:]
+
+ finalurl = rtmpbase + ' playpath=' + playpath
+
+ item = xbmcgui.ListItem(path=finalurl)
+ xbmcplugin.setResolvedUrl(thisPlugin, True, item)
+
+def searchVideo():
+ keyboard = xbmc.Keyboard("")
+ keyboard.doModal();
+ searchString = keyboard.getText()
+ searchString = searchString.strip()
+ searchString = urllib.quote_plus(searchString)
+
+ if searchString == "":
+ return False
+
+ searchUrl = searchLink % (searchString)
+ showPage(searchUrl)
+
+def load_page(url):
+ print url
+ req = urllib2.Request(url)
+ response = urllib2.urlopen(req)
+ link = response.read()
+ response.close()
+ return link
+
+def addDirectoryItem(name, parameters={}, pic="", folder=True):
+ li = xbmcgui.ListItem(name, iconImage="DefaultFolder.png",
thumbnailImage=pic)
+ if not folder:
+ li.setProperty('IsPlayable', 'true')
+ url = sys.argv[0] + '?' + urllib.urlencode(parameters)
+ return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url,
listitem=li, isFolder=folder)
+
+def get_params():
+ param = []
+ paramstring = sys.argv[2]
+ if len(paramstring) >= 2:
+ params = sys.argv[2]
+ cleanedparams = params.replace('?', '')
+ if (params[len(params) - 1] == '/'):
+ params = params[0:len(params) - 2]
+ pairsofparams = cleanedparams.split('&')
+ param = {}
+ for i in range(len(pairsofparams)):
+ splitparams = {}
+ splitparams = pairsofparams[i].split('=')
+ if (len(splitparams)) == 2:
+ param[splitparams[0]] = splitparams[1]
+
+ return param
+
+
+if not sys.argv[2]:
+ mainPage()
+else:
+ params = get_params()
+ if params['action'] == "category":
+ showCategory(params['link'])
+ elif params['action'] == "show":
+ showPage(urllib.unquote(params['link']))
+ elif params['action'] == "episode":
+ playEpisode(params['link'])
+ elif params['action'] == "search":
+ searchVideo()
+ else:
+ mainPage()
-----------------------------------------------------------------------
Summary of changes:
plugin.video.mediathek/addon.xml | 7 +-
plugin.video.mediathek/changelog.txt | 1 +
plugin.video.mediathek/mediathek/ndr.py | 68 +++--
plugin.video.revision3/addon.xml | 2 +-
plugin.video.revision3/addonfunc.py | 21 +-
plugin.video.revision3/changelog.txt | 10 +
plugin.video.revision3/default.py | 174 ++++++++----
.../resources/language/English/strings.xml | 4 +
plugin.video.revision3/resources/media/play.png | Bin 0 -> 23115 bytes
plugin.video.revision3/resources/settings.xml | 2 +
plugin.video.servustv/addon.xml | 41 ++--
plugin.video.servustv/brightcovePlayer.py | 92 +++---
plugin.video.servustv/changelog.txt | 3 +
plugin.video.servustv/default.py | 310 ++++++++++----------
14 files changed, 417 insertions(+), 318 deletions(-)
create mode 100644 plugin.video.revision3/resources/media/play.png
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons