diff options
author | Antti Ajanki <antti.ajanki@iki.fi> | 2011-04-12 22:16:13 +0300 |
---|---|---|
committer | Antti Ajanki <antti.ajanki@iki.fi> | 2011-04-12 22:16:13 +0300 |
commit | 1bb94b04baa328b11b7befd075c18cbaf05fa245 (patch) | |
tree | df03056ed6adf1ae8a7af136f80434eba4dff4b3 | |
parent | af716fee174f2d790a8a65d9192e2aba6081b39b (diff) | |
download | vdr-plugin-webvideo-1bb94b04baa328b11b7befd075c18cbaf05fa245.tar.gz vdr-plugin-webvideo-1bb94b04baa328b11b7befd075c18cbaf05fa245.tar.bz2 |
Fix Vimeo search
-rw-r--r-- | templates/vimeo.com/search.xsl | 5 | ||||
-rw-r--r-- | templates/vimeo.com/searchresults.xsl | 21 |
2 files changed, 20 insertions, 6 deletions
diff --git a/templates/vimeo.com/search.xsl b/templates/vimeo.com/search.xsl index eb99f03..386beaa 100644 --- a/templates/vimeo.com/search.xsl +++ b/templates/vimeo.com/search.xsl @@ -2,7 +2,8 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:str="http://exslt.org/strings"> + xmlns:str="http://exslt.org/strings" + exclude-result-prefixes="str"> <xsl:template match="/"> <wvmenu> @@ -22,7 +23,7 @@ <button> <label>Search</label> - <submission>wvt:///vimeo.com/searchresults.xsl?srcurl=<xsl:value-of select="concat(str:encode-uri('http://vimeo.com/videos/search:', true()), '{keywords}/', substring(id('xsrft')/@value, 0, 9), '{orderby}')"/>&HTTP-header=cookie,xsrft%3D<xsl:value-of select="substring(id('xsrft')/@value, 0, 9)"/>;searchtoken%3D<xsl:value-of select="substring(id('xsrft')/@value, 0, 9)"/>&param=searchtoken,<xsl:value-of select="substring(id('xsrft')/@value, 0, 9)"/></submission> + <submission>wvt:///vimeo.com/searchresults.xsl?srcurl=<xsl:value-of select="concat(str:encode-uri('http://vimeo.com/search/videos/search:', true()), '{keywords}/', substring(id('xsrft')/@value, 0, 9), '{orderby}')"/>&HTTP-header=cookie,uid%3D0;searchtoken%3D<xsl:value-of select="substring(id('xsrft')/@value, 0, 9)"/>&param=searchtoken,<xsl:value-of select="substring(id('xsrft')/@value, 0, 9)"/></submission> </button> </wvmenu> </xsl:template> diff --git a/templates/vimeo.com/searchresults.xsl b/templates/vimeo.com/searchresults.xsl index c5af5ab..1cf8381 100644 --- a/templates/vimeo.com/searchresults.xsl +++ b/templates/vimeo.com/searchresults.xsl @@ -2,7 +2,8 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:str="http://exslt.org/strings"> + xmlns:str="http://exslt.org/strings" + exclude-result-prefixes="str"> <xsl:param name="searchtoken"/> @@ -12,9 +13,21 @@ <xsl:for-each select="//div[@class='title']/a"> <link> + <xsl:variable name="clipid"> + <xsl:choose> + <xsl:when test="contains(@href, '?')"> + <xsl:value-of select="str:split(substring-before(@href, '?'), '/')[last()]"/> + </xsl:when> + + <xsl:otherwise> + <xsl:value-of select="str:split(@href, '/')[last()]"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <label><xsl:value-of select="."/></label> - <stream>wvt:///vimeo.com/video.xsl?srcurl=http://www.vimeo.com/moogaloop/load/clip:<xsl:value-of select="str:split(@href, '/')[last()]"/></stream> - <ref>wvt:///vimeo.com/description.xsl?srcurl=http://vimeo.com/api/v2/video/<xsl:value-of select="str:split(@href, '/')[last()]"/>.xml</ref> + <stream>wvt:///vimeo.com/video.xsl?srcurl=http://www.vimeo.com/moogaloop/load/clip:<xsl:value-of select="$clipid"/>&HTTP-header=user-agent,Wget/1.2%20%28linux-gnu%29</stream> + <ref>wvt:///vimeo.com/description.xsl?srcurl=http://vimeo.com/api/v2/video/<xsl:value-of select="$clipid"/>.xml</ref> </link> </xsl:for-each> @@ -26,7 +39,7 @@ <xsl:if test="img/@alt = 'next'"> <label>Next</label> </xsl:if> - <ref>wvt:///vimeo.com/searchresults.xsl?srcurl=<xsl:value-of select="./@href"/>&HTTP-header=cookie,xsrft%3D<xsl:value-of select="$searchtoken"/>;searchtoken%3D<xsl:value-of select="$searchtoken"/>&param=searchtoken,<xsl:value-of select="$searchtoken"/></ref> + <ref>wvt:///vimeo.com/searchresults.xsl?srcurl=<xsl:value-of select="translate(./@href, ' ', '+')"/>&HTTP-header=cookie,uid%3D0;searchtoken%3D<xsl:value-of select="$searchtoken"/>&param=searchtoken,<xsl:value-of select="$searchtoken"/></ref> </link> </xsl:for-each> |