The branch, dharma has been updated
via cae7de6fb5c0153dc5d2384de2bbf831a9e67894 (commit)
from 6c5a4260a68e761aa36d30e2bd9c69cabee7bd92 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=cae7de6fb5c0153dc5d2384de2bbf831a9e67894
commit cae7de6fb5c0153dc5d2384de2bbf831a9e67894
Author: spiff <[email protected]>
Date: Tue Sep 6 16:21:04 2011 +0200
[plugin.video.nrk] updated to version 2.1.1
diff --git a/plugin.video.nrk/addon.xml b/plugin.video.nrk/addon.xml
index 14d1ccb..48451f8 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"
- version="2.1.0"
+ version="2.1.1"
provider-name="takoi">
<requires>
<import addon="xbmc.python" version="1.0"/>
diff --git a/plugin.video.nrk/changelog.txt b/plugin.video.nrk/changelog.txt
index dadc7a1..9ba4c07 100644
--- a/plugin.video.nrk/changelog.txt
+++ b/plugin.video.nrk/changelog.txt
@@ -1,3 +1,6 @@
+[B]2.1.1[/B]
+- added: multi-page search result
+
[B]2.1.0[/B]
- added: search
- added: description and larger thumbs
diff --git a/plugin.video.nrk/data.py b/plugin.video.nrk/data.py
index b4dc767..92ca4ed 100644
--- a/plugin.video.nrk/data.py
+++ b/plugin.video.nrk/data.py
@@ -50,7 +50,11 @@ def getLatest():
def getSearchResults(query):
- soup = BeautifulSoup(urllib.urlopen("http://www.nrk.no/nett-tv/sok/" +
urllib.quote(query)))
+ url = "http://www.nrk.no/nett-tv/sok/" + urllib.quote(query)
+ return _getSearchResults(url)
+
+def _getSearchResults(url):
+ soup = BeautifulSoup(urllib.urlopen(url))
li = soup.find('div', attrs={'id' : 'search-results'}).findAll('li')
items = []
for e in li:
@@ -61,6 +65,10 @@ def getSearchResults(query):
title = decodeHtml(e.find('a').string)
descr = decodeHtml(e.find('p').string)
items.append( DataItem(title=title, description=descr,
url="/nett-tv/prosjekt/"+getId(url)) )
+ #next page
+ url = soup.find('a', attrs={'id' :
'ctl00_contentPlaceHolder_ucSearch_nextLink'})['href']
+ if not (url.endswith('0') or url.endswith('1')):
+ items.append(DataItem(title="Neste »", url=url))
return items
@@ -78,10 +86,14 @@ def getMostWatched(days):
def getByUrl(url):
if (url.startswith("/nett-tv/tema") or url.startswith("/nett-tv/bokstav")):
- url = "http://www.nrk.no" + url
+ url = "http://www.nrk.no" + url
soup = BeautifulSoup(urllib.urlopen(url))
return _getAllProsjekt(soup)
+ elif (url.startswith("/nett-tv/sok")):
+ url = "http://www.nrk.no" + url
+ return _getSearchResults(url)
+
elif (url.startswith("/nett-tv/prosjekt")):
url = "http://www.nrk.no" + url
-----------------------------------------------------------------------
Summary of changes:
plugin.video.nrk/addon.xml | 2 +-
plugin.video.nrk/changelog.txt | 3 +++
plugin.video.nrk/data.py | 16 ++++++++++++++--
3 files changed, 18 insertions(+), 3 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons