The branch, eden has been updated
via c6b9cf975af1812e53ee9bd13b492f42ceff476e (commit)
via 112dc3c340acd7d87b69068d4efe222ab3219cbb (commit)
via 25268a54114496a34923ef5076c48db6b4471421 (commit)
via 39bcc0d26e6d83b7577acaa189a66580f18e5f7c (commit)
via e260a854339044b24a9a15164118261b7e39b91d (commit)
from bd19edbbe45ff1ac595b04b1ecd22ae9cb709591 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=c6b9cf975af1812e53ee9bd13b492f42ceff476e
commit c6b9cf975af1812e53ee9bd13b492f42ceff476e
Author: spiff <[email protected]>
Date: Sun Sep 9 23:05:06 2012 +0200
[plugin.audio.mp3search] updated to version 0.2.3
diff --git a/plugin.audio.mp3search/addon.xml b/plugin.audio.mp3search/addon.xml
index 803437c..f71d8b4 100644
--- a/plugin.audio.mp3search/addon.xml
+++ b/plugin.audio.mp3search/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.audio.mp3search"
name="MP3 Search"
- version="0.2.2"
+ version="0.2.3"
provider-name="[email protected]">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.audio.mp3search/changelog.txt
b/plugin.audio.mp3search/changelog.txt
index 60df53d..034d86d 100644
--- a/plugin.audio.mp3search/changelog.txt
+++ b/plugin.audio.mp3search/changelog.txt
@@ -1,3 +1,10 @@
+[B]0.2.3:[/B]
+Updated due to site changes (grrrr,grrrr...)
+- reported some problems on Raspberry, I don't know where the problem is, so
be careful
+
+
+
+
[B]0.2.2:[/B]
Updated due to site changes (grrrr...)
diff --git a/plugin.audio.mp3search/default.py
b/plugin.audio.mp3search/default.py
index 21bc010..777e270 100644
--- a/plugin.audio.mp3search/default.py
+++ b/plugin.audio.mp3search/default.py
@@ -10,7 +10,7 @@ downloader = downloader.SimpleDownloader()
__plugin__ = "mp3search"
__author__ = "[email protected]"
__url__ = ""
-__version__ = "0.2.2"
+__version__ = "0.2.3"
@@ -158,8 +158,8 @@ def doSearch(fquery,fpage,isave=True):
asearched=[]
- req =
urllib2.Request('http://togrool.com/search.xhtml?query='+fquery+'&searchtype=mp3&page='+str(fpage)+'&source=page')
- req.add_header('User-Agent', ' Mozilla/5.0 (Windows NT 5.1; rv:13.0)
Gecko/20100101 Firefox/13.0.1')
+ req =
urllib2.Request('http://searchmp3.mobi/search.xhtml?query='+fquery+'&searchtype=mp3&page='+str(fpage)+'&source=page')
+ req.add_header('User-Agent', ' Mozilla/5.0 (Windows NT 5.1; rv:13.0)
Gecko/20100101 Firefox/14.0.1')
req.add_header('Cache-Control',' no-cache')
req.add_header('Connection',' close')
@@ -168,7 +168,8 @@ def doSearch(fquery,fpage,isave=True):
response = urllib2.urlopen(req)
link=response.read()
response.close()
- match=re.compile('<a
href="http://togrool.com/download(.+?)\?').findall(link)
+ #match=re.compile('<a
href="http://togrool.com/download(.+?)\?').findall(link)
+ match=re.compile('<a
href="http://searchmp3.mobi/download(.+?)\?').findall(link)
if isave:
asearched=getDatFile("searched.dat")
@@ -182,8 +183,8 @@ def doSearch(fquery,fpage,isave=True):
for i in range(len(match)):
- req =
urllib2.Request('http://togrool.com/download'+match[i])
- req.add_header('User-Agent', ' Mozilla/5.0 (Windows NT
5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1')
+ req =
urllib2.Request('http://searchmp3.mobi/download'+match[i])
+ req.add_header('User-Agent', ' Mozilla/5.0 (Windows NT
5.1; rv:13.0) Gecko/20100101 Firefox/15.0.1')
req.add_header('Cache-Control',' no-cache')
req.add_header('Connection',' keep-alive')
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=112dc3c340acd7d87b69068d4efe222ab3219cbb
commit 112dc3c340acd7d87b69068d4efe222ab3219cbb
Author: spiff <[email protected]>
Date: Sun Sep 9 23:03:37 2012 +0200
[plugin.video.twitch] updated to version 0.2.1
diff --git a/plugin.video.twitch/addon.xml b/plugin.video.twitch/addon.xml
index 6a698cb..0ee85b6 100644
--- a/plugin.video.twitch/addon.xml
+++ b/plugin.video.twitch/addon.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<addon id='plugin.video.twitch' version='0.1.8' name='TwitchTV'
provider-name='StateOfTheArt'>
+<addon id='plugin.video.twitch' version='0.2.1' name='TwitchTV'
provider-name='StateOfTheArt'>
<requires>
<import addon='xbmc.python' version='2.0'/>
<import addon='script.module.simplejson' version='2.0.10'/>
diff --git a/plugin.video.twitch/changelog.txt
b/plugin.video.twitch/changelog.txt
index cb0e791..ca1a498 100644
--- a/plugin.video.twitch/changelog.txt
+++ b/plugin.video.twitch/changelog.txt
@@ -16,4 +16,9 @@
- fixed bug in following list
0.1.8
- better error handling
-- localized strings in all notifications
\ No newline at end of file
+- localized strings in all notifications
+0.2.0
+- added selection of prefered video settings
+- added fallback-function, if selected video does not support video settings
+0.2.1
+- added featured streams section
\ No newline at end of file
diff --git a/plugin.video.twitch/default.py b/plugin.video.twitch/default.py
index 4c2dda8..b9080d3 100644
--- a/plugin.video.twitch/default.py
+++ b/plugin.video.twitch/default.py
@@ -14,6 +14,7 @@ thisPlugin = int(sys.argv[1])
settings = xbmcaddon.Addon(id='plugin.video.twitch')
httpHeaderUserAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0)
Gecko/20100101 Firefox/6.0'
translation = settings.getLocalizedString
+ITEMS_PER_SITE=20
def downloadWebData(url):
try:
@@ -27,11 +28,12 @@ def downloadWebData(url):
xbmc.executebuiltin("XBMC.Notification("+translation(31000)+"," +
translation(32001) +")")
def createMainListing():
- addDir(translation(30001),'','games','')
- addDir(translation(30002),'','following','')
- addDir(translation(30003),'','search','')
- addDir(translation(30004),'','settings','')
- xbmcplugin.endOfDirectory(thisPlugin)
+ addDir(translation(30005),'','featured','')
+ addDir(translation(30001),'','games','')
+ addDir(translation(30002),'','following','')
+ addDir(translation(30003),'','search','')
+ addDir(translation(30004),'','settings','')
+ xbmcplugin.endOfDirectory(thisPlugin)
def createFollowingList():
username = settings.getSetting('username').lower()
@@ -53,27 +55,52 @@ def createFollowingList():
addLink(name,loginname,'play',image,loginname)
xbmcplugin.endOfDirectory(thisPlugin)
+def createListOfFeaturedStreams():
+
jsonString=downloadWebData(url='https://api.twitch.tv/kraken/streams/featured')
+ jsonData=json.loads(jsonString)
+ for x in jsonData['featured']:
+ try:
+ image = x['stream']['channel']['logo']
+ image = image.replace("http://","",1)
+ image = urllib.quote(image)
+ image = 'http://' + image
+ except:
+ image = ""
+ name = x['stream']['channel']['status']
+ if name == '':
+ name = x['stream']['channel']['display_name']
+ channelname = x['stream']['channel']['name']
+ addLink(name,'...','play',image,channelname)
+ xbmcplugin.endOfDirectory(thisPlugin)
+
def createListOfGames(index=0):
-
htmlData=downloadWebData(url='http://de.twitch.tv/directory?page='+str(index+1))
- if htmlData is None:
- return
- gameDiv=re.compile("(?<=<div class='boxart'>).+?</div>.+?(?=</div>)",
re.MULTILINE|re.DOTALL).findall(htmlData)
- for x in gameDiv:
- name = re.compile("(?<=<h5 class='title'>).+?(?=</h5>)").findall(x)[0]
- dir = 'http://de.twitch.tv/directory/?category=' +
urllib.quote_plus(name)
- image = re.compile('(?<=setPlaceholder\(this\);" src="http://).+?(?="
/>)').findall(x)[0]
- image = urllib.quote(image)
- image = 'http://' + image
- addDir(name,dir,'channel',image)
- addDir(translation(31001),'','games','',index+1)
+
jsonString=downloadWebData(url='https://api.twitch.tv/kraken/games/top?limit='+str(ITEMS_PER_SITE)+'&offset='+str(index*ITEMS_PER_SITE))
+ jsonData=json.loads(jsonString)
+ for x in jsonData['top']:
+ try:
+ name = str(x['game']['name'])
+ game = urllib.quote(name)
+ image = ''
+ except:
+ continue
+ try:
+ image = x['game']['images']['super']
+ image = image.replace("http://","",1)
+ image = urllib.quote(image)
+ image = 'http://' + image
+ except:
+ image = ''
+ addDir(name,game,'channel',image)
+ if len(jsonData['top']) >= ITEMS_PER_SITE:
+ addDir(translation(31001),'','games','',index+1)
xbmcplugin.endOfDirectory(thisPlugin)
-
+
def search():
keyboard = xbmc.Keyboard('', translation(30101))
keyboard.doModal()
if keyboard.isConfirmed() and keyboard.getText():
search_string = urllib.quote_plus(keyboard.getText())
- sdata =
downloadWebData('http://api.swiftype.com/api/v1/public/engines/search.json?callback=jQuery1337&q='+search_string+'&engine_key=9NXQEpmQPwBEz43TM592&page=1&per_page=20')
+ sdata =
downloadWebData('http://api.swiftype.com/api/v1/public/engines/search.json?callback=jQuery1337&q='+search_string+'&engine_key=9NXQEpmQPwBEz43TM592&page=1&per_page='+str(ITEMS_PER_SITE))
sdata = sdata.replace('jQuery1337','');
sdata = sdata[1:len(sdata)-1]
jdata = json.loads(sdata)
@@ -82,21 +109,25 @@ def search():
addLink(x['title'],x['user'],'play',x['thumbnail'],x['user'])
xbmcplugin.endOfDirectory(thisPlugin)
-def createListForGame(url, index=0):
- htmlData=downloadWebData(url+ '&page=' + str(index+1))
- if htmlData is None:
- return
- videoDiv=re.compile("(?<=<div class='video clearfix).+?(?=</div>)",
re.MULTILINE|re.DOTALL).findall(htmlData)
- for x in videoDiv:
- image =
re.compile('(?<=http://)static-cdn.jtvnw.net/previews/.+?(?=")',
re.MULTILINE|re.DOTALL).findall(x)[0]
- image = urllib.quote(image)
- image = 'http://' + image
- nameAndLink = re.compile("(?<=<p class='title'>).+?(?=</a></p>)",
re.MULTILINE|re.DOTALL).findall(x)[0]
- name = re.compile('(?<=\>).+?\Z',
re.MULTILINE|re.DOTALL).findall(nameAndLink)[0]
- channelname = re.compile('(?<=<a
href="/).+?(?=">)').findall(nameAndLink)[0]
+def createListForGame(gameName, index=0):
+
jsonString=downloadWebData(url='https://api.twitch.tv/kraken/streams?game='+gameName+'&limit='+str(ITEMS_PER_SITE)+'&offset='+str(index*ITEMS_PER_SITE))
+ jsonData=json.loads(jsonString)
+ for x in jsonData['streams']:
+ try:
+ image = x['channel']['logo']
+ image = image.replace("http://","",1)
+ image = urllib.quote(image)
+ image = 'http://' + image
+ except:
+ image = ""
+ name = x['channel']['status']
+ if name == '':
+ name = x['channel']['display_name']
+ channelname = x['channel']['name']
addLink(name,'...','play',image,channelname)
- addDir(translation(31001),url,'channel','',index+1)
- xbmcplugin.endOfDirectory(thisPlugin)
+ if len(jsonData['streams']) >= ITEMS_PER_SITE:
+ addDir(translation(31001),url,'channel','',index+1)
+ xbmcplugin.endOfDirectory(thisPlugin)
def addLink(name,url,mode,iconimage,channelname):
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&channelname="+channelname
@@ -146,29 +177,66 @@ def parameters_string_to_dict(parameters):
return paramDict
def getSwfUrl(channel_name):
- """Helper method to grab the swf url, resolving HTTP 301/302 along the
way"""
+ ''' Helper method to grab the swf url, resolving HTTP 301/302 along
the way'''
base_url =
'http://www.justin.tv/widgets/live_embed_player.swf?channel=%s' % channel_name
headers = {'User-agent' : httpHeaderUserAgent,
'Referer' : 'http://www.justin.tv/'+channel_name}
req = urllib2.Request(base_url, None, headers)
response = urllib2.urlopen(req)
- return response.geturl()
+ return response.geturl()
+def getBestJtvTokenPossible(name):
+ '''Helper method to find another jtv token'''
+ swf_url = getSwfUrl(name)
+ headers = {'User-agent' : httpHeaderUserAgent,
+ 'Referer' : swf_url}
+ url = 'http://usher.justin.tv/find/'+name+'.json?type=any&group='
+ data = json.loads(get_request(url,headers))
+ bestVideoHeight = -1
+ bestIndex = -1
+ index = 0
+ for x in data:
+ value = x.get('token', '')
+ videoHeight = int(x['video_height'])
+ if (value != '') and (videoHeight > bestVideoHeight):
+ bestVideoHeight = x['video_height']
+ bestIndex = index
+ index = index + 1
+ return data[bestIndex]
+
def playLive(name, play=False, password=None):
swf_url = getSwfUrl(name)
headers = {'User-agent' : httpHeaderUserAgent,
'Referer' : swf_url}
- url = 'http://usher.justin.tv/find/'+name+'.json?type=live&group='
+ chosenQuality = settings.getSetting('video')
+ videoTypeName = 'any'
+ if chosenQuality == '0':
+ videoTypeName = 'any'
+ elif chosenQuality == '1':
+ videoTypeName = '720p'
+ elif chosenQuality == '2':
+ videoTypeName = '480p'
+ elif chosenQuality == '3':
+ videoTypeName = '360p'
+ url =
'http://usher.justin.tv/find/'+name+'.json?type='+videoTypeName+'&private_code=null&group='
data = json.loads(get_request(url,headers))
+ tokenIndex = 0
if data == []:
xbmc.executebuiltin("XBMC.Notification("+translation(31000)+","+translation(32002)+")")
return
try:
- token = ' jtv='+data[0]['token'].replace('\\','\\5c').replace('
','\\20').replace('"','\\22')
+ '''trying to get a token in desired quality'''
+ token = '
jtv='+data[tokenIndex]['token'].replace('\\','\\5c').replace('
','\\20').replace('"','\\22')
+ rtmp = data[tokenIndex]['connect']+'/'+data[tokenIndex]['play']
except:
-
xbmc.executebuiltin("XBMC.Notification("+translation(31000)+","+translation(32004)+")")
- return
- rtmp = data[0]['connect']+'/'+data[0]['play']
+
xbmc.executebuiltin("XBMC.Notification("+translation(32005)+","+translation(32006)+")")
+ jtvtoken = getBestJtvTokenPossible(name)
+ if jtvtoken == '':
+
xbmc.executebuiltin("XBMC.Notification("+translation(31000)+","+translation(32004)+")")
+ return
+ token = ' jtv='+jtvtoken['token'].replace('\\','\\5c').replace('
','\\20').replace('"','\\22')
+ rtmp = jtvtoken['connect']+'/'+jtvtoken['play']
+
swf = ' swfUrl=%s swfVfy=1 live=1' % swf_url
Pageurl = ' Pageurl=http://www.justin.tv/'+name
url = rtmp+token+swf+Pageurl
@@ -195,6 +263,8 @@ if type(url)==type(str()):
url=urllib.unquote_plus(url)
if mode == 'games':
createListOfGames(index)
+elif mode == 'featured':
+ createListOfFeaturedStreams()
elif mode == 'channel':
createListForGame(url, index)
elif mode == 'play':
diff --git a/plugin.video.twitch/icon.png b/plugin.video.twitch/icon.png
index 069a2e5..d63481a 100644
Binary files a/plugin.video.twitch/icon.png and b/plugin.video.twitch/icon.png
differ
diff --git a/plugin.video.twitch/resources/language/English/strings.xml
b/plugin.video.twitch/resources/language/English/strings.xml
index 8bd4047..63a3a97 100644
--- a/plugin.video.twitch/resources/language/English/strings.xml
+++ b/plugin.video.twitch/resources/language/English/strings.xml
@@ -5,6 +5,7 @@
<string id="30002">Following</string>
<string id="30003">Search</string>
<string id="30004">Settings</string>
+ <string id="30005">Featured Streams</string>
<!--search -->
<string id="30101">Search for channels</string>
@@ -18,4 +19,14 @@
<string id="32002">No Live Data Found</string>
<string id="32003">No archives found for</string>
<string id="32004">User Token Error</string>
+ <string id="32005">Changed video settings</string>
+ <string id="32006">Selected video settings are not available</string>
+
+ <!--settings -->
+ <string id="33000">Video Quality</string>
+ <string id="33001">Best possible</string>
+ <string id="33002">720p</string>
+ <string id="33003">480p</string>
+ <string id="33004">360p</string>
+
</strings>
\ No newline at end of file
diff --git a/plugin.video.twitch/resources/language/German/strings.xml
b/plugin.video.twitch/resources/language/German/strings.xml
index 8c07983..d51c540 100644
--- a/plugin.video.twitch/resources/language/German/strings.xml
+++ b/plugin.video.twitch/resources/language/German/strings.xml
@@ -5,6 +5,7 @@
<string id="30002">Folgend</string>
<string id="30003">Suche</string>
<string id="30004">Einstellungen</string>
+ <string id="30005">Featured Streams</string>
<!-- search -->
<string id="30101">Suche nach Kanälen</string>
@@ -18,4 +19,13 @@
<string id="32002">Keine Live-Daten gefunden</string>
<string id="32003">Keine Archive gefunden für</string>
<string id="32004">User Token Fehler</string>
+ <string id="32005">Geaenderte Video Einstellung</string>
+ <string id="32006">Gewaehlte Qualitaet nicht verfuegbar...Eventuell Premium
Content?</string>
+
+ <!--settings -->
+ <string id="33000">Video Qualität</string>
+ <string id="33001">Beste</string>
+ <string id="33002">720p</string>
+ <string id="33003">480p</string>
+ <string id="33004">360p</string>
</strings>
\ No newline at end of file
diff --git a/plugin.video.twitch/resources/settings.xml
b/plugin.video.twitch/resources/settings.xml
index 51ba8d0..c6e5de9 100644
--- a/plugin.video.twitch/resources/settings.xml
+++ b/plugin.video.twitch/resources/settings.xml
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<!-- General -->
- <category label="Account">
+ <category label="General">
<setting id="username" type="text" label="Username" default="" />
+ <!-- Video Quality -->
+ <setting id="video" type="enum" label="33000"
lvalues="33001|33002|33003|33004" default="0" />
</category>
+
+
</settings>
\ No newline at end of file
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=25268a54114496a34923ef5076c48db6b4471421
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=39bcc0d26e6d83b7577acaa189a66580f18e5f7c
commit 39bcc0d26e6d83b7577acaa189a66580f18e5f7c
Author: spiff <[email protected]>
Date: Sun Sep 9 23:00:52 2012 +0200
[plugin.video.myvideo_de] updated to version 0.1.9
diff --git a/plugin.video.myvideo_de/addon.xml
b/plugin.video.myvideo_de/addon.xml
index 1503c55..80279af 100644
--- a/plugin.video.myvideo_de/addon.xml
+++ b/plugin.video.myvideo_de/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.myvideo_de" name="MyVideo.de" version="0.1.8"
provider-name="Tristan Fischer ([email protected])">
+<addon id="plugin.video.myvideo_de" name="MyVideo.de" version="0.1.9"
provider-name="Tristan Fischer ([email protected])">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.xbmcswift" version="0.2.0"/>
diff --git a/plugin.video.myvideo_de/changelog.txt
b/plugin.video.myvideo_de/changelog.txt
index 2dcbc0a..ce80fe8 100644
--- a/plugin.video.myvideo_de/changelog.txt
+++ b/plugin.video.myvideo_de/changelog.txt
@@ -1,3 +1,5 @@
+0.1.9
+ - fix "Musik Charts"
0.1.8
- fix white images
0.1.7
diff --git a/plugin.video.myvideo_de/resources/lib/scraper.py
b/plugin.video.myvideo_de/resources/lib/scraper.py
index 4f0cb71..22bd289 100644
--- a/plugin.video.myvideo_de/resources/lib/scraper.py
+++ b/plugin.video.myvideo_de/resources/lib/scraper.py
@@ -100,8 +100,6 @@ def get_path(path):
items = __parse_channels(tree, path)
elif 'mv_charts' in path:
items = __parse_channels(tree, path)
- elif 'Musik_Charts' in path:
- items = __parse_music_charts(tree, path)
elif 'Charts' in path: # fixme: still needed?
items = __parse_video_charts(tree, path)
elif 'channel' in path:
@@ -324,23 +322,6 @@ def __parse_categories(tree, path):
return items
-def __parse_music_charts(tree, path):
- __log('__parse_music_charts started with path: %s' % path)
- r_section = re.compile('lBox floatLeft pHalfBox charts_box')
- sections = tree.findAll('div', {'class': r_section})
- items = []
- for sec in sections:
- d = sec.find('td', {'class': 'wLListLeft'})
- title = d.nextSibling.string.strip()
- path = sec.find('a', {'class': 'sBold'})['href']
- is_folder = True
- items.append({'title': title,
- 'path': path,
- 'is_folder': is_folder})
- __log('__parse_music_charts finished with %d elements' % len(items))
- return items
-
-
def __parse_shows_overview(tree, path):
__log('__parse_shows_overview started with path: %s' % path)
subtree = tree.find('div', {'class': 'lContent'})
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=e260a854339044b24a9a15164118261b7e39b91d
commit e260a854339044b24a9a15164118261b7e39b91d
Author: spiff <[email protected]>
Date: Sun Sep 9 22:59:56 2012 +0200
[plugin.video.nrk] updated to version 4.0.1
diff --git a/plugin.video.nrk/addon.xml b/plugin.video.nrk/addon.xml
index 6c0ef10..4cdb029 100644
--- a/plugin.video.nrk/addon.xml
+++ b/plugin.video.nrk/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.nrk"
name="NRK Nett-TV"
- version="4.0.0"
+ version="4.0.1"
provider-name="takoi">
<requires>
<import addon="xbmc.python" version="2.0"/>
@@ -9,6 +9,7 @@
<import addon="script.module.parsedom" version="0.9.2"/>
<import addon="script.module.requests" version="0.13.2"/>
<import addon="script.module.xbmcswift" version="0.2.0"/>
+ <import addon="script.common.plugin.cache" version="1.1.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
diff --git a/plugin.video.nrk/changelog.txt b/plugin.video.nrk/changelog.txt
index 99d8444..b2175c9 100644
--- a/plugin.video.nrk/changelog.txt
+++ b/plugin.video.nrk/changelog.txt
@@ -1,3 +1,6 @@
+[B]4.0.1[/B]
+- Diverse ytelsesforbedringer
+
[B]4.0.0[/B]
- Ny versjon basert på NRKs nye nett-TV
diff --git a/plugin.video.nrk/data.py b/plugin.video.nrk/data.py
index 8545104..b560d54 100644
--- a/plugin.video.nrk/data.py
+++ b/plugin.video.nrk/data.py
@@ -14,23 +14,27 @@
'''
import re
-
+import requests
import BeautifulSoup
+import StorageServer
+import CommonFunctions
+from subs import get_subtitles
+
html_decode = lambda string: BeautifulSoup.BeautifulSoup(string,
convertEntities=BeautifulSoup.BeautifulSoup.HTML_ENTITIES).contents[0]
-
-import CommonFunctions
parseDOM = CommonFunctions.parseDOM
+requests =
requests.session(headers={'User-Agent':'xbmc.org','X-Requested-With':'XMLHttpRequest'})
+cache = StorageServer.StorageServer('nrk.no', 336)
-import requests
-requests = requests.session(headers={'User-Agent':'xbmc.org'})
+def _get_cached(url):
+ f = lambda x: requests.get(x).json
+ return cache.cacheFunction(f, url)
def parse_by_letter(arg):
""" returns: </serie/newton> or </program/koif45000708> """
- url = "http://tv.nrk.no/programmer/%s?filter=rettigheter" % arg
+ url = "http://tv.nrk.no/programmer/%s?filter=rettigheter&ajax=true" % arg
html = requests.get(url).text
- html = parseDOM(html, 'div', {'id':'programList'})
return _parse_list(html)
def parse_by_category(arg):
@@ -68,12 +72,11 @@ def parse_recommended():
def parse_most_recent():
- url = "http://tv.nrk.no/listobjects/recentlysent"
- html = requests.get(url).text
- urls = parseDOM(html, 'a', {'class':'listobject-link'}, ret='href')
- thumbs = parseDOM(html, 'img', ret='src')[::2] #extract even elements
- html = ''.join(parseDOM(html, 'span', {'class':'listobject-title'}))
- titles = parseDOM(html, 'strong')
+ url = "http://tv.nrk.no/listobjects/recentlysent.json/page/0"
+ elems = requests.get(url).json['ListObjectViewModels']
+ titles = [ e['Title'] for e in elems ]
+ thumbs = [ e['ImageUrl'] for e in elems ]
+ urls = [ e['Url'] for e in elems ]
titles = map(html_decode, titles)
return titles, urls, thumbs
@@ -94,7 +97,6 @@ def parse_episodes(series_id, season_id):
""" returns: </serie/aktuelt-tv/nnfa50051612/16-05-2012..> """
url = "http://tv.nrk.no/program/Episodes/%s/%s" % (series_id, season_id)
html = requests.get(url).text
- html = parseDOM(html, 'table', {'class':'episodeTable'})
trs = parseDOM(html, 'tr', {'class':'has-programtooltip episode-row js-click
*'})
titles = [ parseDOM(tr, 'a', {'class':'p-link'})[0] for tr in trs ]
titles = map(html_decode, titles)
@@ -107,7 +109,7 @@ def parse_episodes(series_id, season_id):
def parse_media_url(video_id, bitrate):
bitrate = 4 if bitrate > 4 else bitrate
url = "http://nrk.no/serum/api/video/%s" % video_id
- url = requests.get(url).json['mediaURL']
+ url = _get_cached(url)['mediaURL']
url = url.replace('/z/', '/i/', 1)
url = url.rsplit('/', 1)[0]
url = url + '/index_%s_av.m3u8' % bitrate
@@ -115,6 +117,6 @@ def parse_media_url(video_id, bitrate):
def _get_descr(url):
url = "http://nrk.no/serum/api/video/%s" % url.split('/')[3]
- descr = requests.get(url).json['description']
+ descr = _get_cached(url)['description']
return descr
diff --git a/plugin.video.nrk/default.py b/plugin.video.nrk/default.py
index 90eec8d..39e8818 100644
--- a/plugin.video.nrk/default.py
+++ b/plugin.video.nrk/default.py
@@ -18,9 +18,6 @@ import os
import sys
import time
import xbmc, xbmcaddon, xbmcplugin
-import data
-import subs
-
from itertools import repeat
from xbmcplugin import addDirectoryItem
from xbmcplugin import endOfDirectory
@@ -74,26 +71,31 @@ def view(titles, urls, descr=repeat(''), thumbs=repeat(''),
bgs=repeat('')):
@plugin.route('/recommended')
def recommended():
+ import data
titles, urls, bgs = data.parse_recommended()
view(titles, urls, bgs=bgs)
@plugin.route('/mostrecent')
def mostrecent():
+ import data
titles, urls, thumbs = data.parse_most_recent()
view(titles, urls, thumbs=thumbs)
@plugin.route('/categories')
def categories():
+ import data
titles, urls = data.parse_categories()
view(titles, urls)
@plugin.route('/kategori/<arg>')
def category(arg):
+ import data
titles, urls = data.parse_by_category(arg)
view(titles, urls)
@plugin.route('/letters')
def letters():
+ import data
common = ['0-9'] + map(chr, range(97, 123))
titles = common + [ u'æ', u'ø', u'å' ]
titles = [ e.upper() for e in titles ]
@@ -102,11 +104,13 @@ def letters():
@plugin.route('/letters/<arg>')
def letter(arg):
+ import data
titles, urls = data.parse_by_letter(arg)
view(titles, urls)
@plugin.route('/serie/<arg>')
def seasons(arg):
+ import data
titles, urls = data.parse_seasons(arg)
if len(titles) == 1:
plugin.redirect(plugin.url_for(urls[0]))
@@ -115,6 +119,7 @@ def seasons(arg):
@plugin.route('/program/Episodes/<series_id>/<season_id>')
def episodes(series_id, season_id):
+ import data
titles, urls, descr = data.parse_episodes(series_id, season_id)
view(titles, urls, descr=descr)
@@ -122,10 +127,11 @@ def episodes(series_id, season_id):
@plugin.route('/program/<video_id>')
@plugin.route('/program/<video_id>/.*')
def play(video_id, series_id=""):
+ import data
url = data.parse_media_url(video_id, BITRATE)
xbmcplugin.setResolvedUrl(plugin.handle, True, ListItem(path=url))
player = xbmc.Player()
- subtitle = subs.get_subtitles(video_id)
+ subtitle = data.get_subtitles(video_id)
#Wait for stream to start
start_time = time.time()
while not player.isPlaying() and time.time() - start_time < 10:
diff --git a/plugin.video.nrk/subs.py b/plugin.video.nrk/subs.py
index 57751f4..cdd9b27 100644
--- a/plugin.video.nrk/subs.py
+++ b/plugin.video.nrk/subs.py
@@ -16,7 +16,6 @@
import os
import re
import xbmc
-
import requests
requests = requests.session(headers={'User-Agent':'xbmc.org'})
-----------------------------------------------------------------------
Summary of changes:
plugin.audio.mp3search/addon.xml | 2 +-
plugin.audio.mp3search/changelog.txt | 7 +
plugin.audio.mp3search/default.py | 13 +-
plugin.video.documentary.net/.gitignore | 1 +
.../LICENSE.txt | 0
plugin.video.documentary.net/addon.py | 69 +++++++++
plugin.video.documentary.net/addon.xml | 18 +++
plugin.video.documentary.net/changelog.txt | 2 +
plugin.video.documentary.net/icon.png | Bin 0 -> 6795 bytes
.../resources/__init__.py | 0
.../resources/language/English/strings.xml | 2 +-
.../resources/lib}/__init__.py | 0
plugin.video.documentary.net/resources/lib/api.py | 107 ++++++++++++++
plugin.video.myvideo_de/addon.xml | 2 +-
plugin.video.myvideo_de/changelog.txt | 2 +
plugin.video.myvideo_de/resources/lib/scraper.py | 19 ---
plugin.video.nrk/DataItem.py | 66 ---------
plugin.video.nrk/addon.xml | 3 +-
plugin.video.nrk/changelog.txt | 3 +
plugin.video.nrk/data.py | 34 +++--
plugin.video.nrk/dataStatic.py | 54 -------
plugin.video.nrk/default.py | 14 ++-
plugin.video.nrk/resources/images/nrk1.jpg | Bin 3406 -> 0 bytes
plugin.video.nrk/resources/images/nrk2.jpg | Bin 2915 -> 0 bytes
plugin.video.nrk/resources/images/nrk3.jpg | Bin 3540 -> 0 bytes
plugin.video.nrk/resources/images/thm_cult.png | Bin 51281 -> 0 bytes
plugin.video.nrk/resources/images/thm_docu.png | Bin 32499 -> 0 bytes
plugin.video.nrk/resources/images/thm_drma.png | Bin 35782 -> 0 bytes
plugin.video.nrk/resources/images/thm_entn.png | Bin 83809 -> 0 bytes
plugin.video.nrk/resources/images/thm_fact.png | Bin 68498 -> 0 bytes
plugin.video.nrk/resources/images/thm_food.png | Bin 52835 -> 0 bytes
plugin.video.nrk/resources/images/thm_kids.png | Bin 76271 -> 0 bytes
plugin.video.nrk/resources/images/thm_life.png | Bin 32879 -> 0 bytes
plugin.video.nrk/resources/images/thm_msic.png | Bin 56501 -> 0 bytes
plugin.video.nrk/resources/images/thm_news.png | Bin 66582 -> 0 bytes
plugin.video.nrk/resources/images/thm_ntur.png | Bin 49383 -> 0 bytes
plugin.video.nrk/resources/images/thm_rgns.png | Bin 67391 -> 0 bytes
plugin.video.nrk/resources/images/thm_sami.png | Bin 26279 -> 0 bytes
plugin.video.nrk/resources/images/thm_sign.png | Bin 29417 -> 0 bytes
plugin.video.nrk/resources/images/thm_sprt.png | Bin 428563 -> 0 bytes
plugin.video.nrk/resources/images/thm_teen.png | Bin 52665 -> 0 bytes
plugin.video.nrk/subs.py | 1 -
plugin.video.nrk/tests/textdata.py | 34 -----
plugin.video.nrk/tests/videos.py | 35 -----
plugin.video.nrk/utils.py | 27 ----
plugin.video.twitch/addon.xml | 2 +-
plugin.video.twitch/changelog.txt | 7 +-
plugin.video.twitch/default.py | 150 ++++++++++++++-----
plugin.video.twitch/icon.png | Bin 17943 -> 9780 bytes
.../resources/language/English/strings.xml | 11 ++
.../resources/language/German/strings.xml | 10 ++
plugin.video.twitch/resources/settings.xml | 6 +-
52 files changed, 392 insertions(+), 309 deletions(-)
create mode 100644 plugin.video.documentary.net/.gitignore
copy {plugin.audio.dradio => plugin.video.documentary.net}/LICENSE.txt (100%)
create mode 100644 plugin.video.documentary.net/addon.py
create mode 100644 plugin.video.documentary.net/addon.xml
create mode 100644 plugin.video.documentary.net/changelog.txt
create mode 100644 plugin.video.documentary.net/icon.png
copy {plugin.audio.radio_de =>
plugin.video.documentary.net}/resources/__init__.py (100%)
copy {plugin.video.khanacademy =>
plugin.video.documentary.net}/resources/language/English/strings.xml (62%)
copy {plugin.audio.radio_de/resources =>
plugin.video.documentary.net/resources/lib}/__init__.py (100%)
create mode 100644 plugin.video.documentary.net/resources/lib/api.py
delete mode 100644 plugin.video.nrk/DataItem.py
delete mode 100644 plugin.video.nrk/dataStatic.py
delete mode 100644 plugin.video.nrk/resources/images/nrk1.jpg
delete mode 100644 plugin.video.nrk/resources/images/nrk2.jpg
delete mode 100644 plugin.video.nrk/resources/images/nrk3.jpg
delete mode 100644 plugin.video.nrk/resources/images/thm_cult.png
delete mode 100644 plugin.video.nrk/resources/images/thm_docu.png
delete mode 100644 plugin.video.nrk/resources/images/thm_drma.png
delete mode 100644 plugin.video.nrk/resources/images/thm_entn.png
delete mode 100644 plugin.video.nrk/resources/images/thm_fact.png
delete mode 100644 plugin.video.nrk/resources/images/thm_food.png
delete mode 100644 plugin.video.nrk/resources/images/thm_kids.png
delete mode 100644 plugin.video.nrk/resources/images/thm_life.png
delete mode 100644 plugin.video.nrk/resources/images/thm_msic.png
delete mode 100644 plugin.video.nrk/resources/images/thm_news.png
delete mode 100644 plugin.video.nrk/resources/images/thm_ntur.png
delete mode 100644 plugin.video.nrk/resources/images/thm_rgns.png
delete mode 100644 plugin.video.nrk/resources/images/thm_sami.png
delete mode 100644 plugin.video.nrk/resources/images/thm_sign.png
delete mode 100644 plugin.video.nrk/resources/images/thm_sprt.png
delete mode 100644 plugin.video.nrk/resources/images/thm_teen.png
delete mode 100644 plugin.video.nrk/tests/textdata.py
delete mode 100644 plugin.video.nrk/tests/videos.py
delete mode 100644 plugin.video.nrk/utils.py
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons