diff options
author | Antti Ajanki <antti.ajanki@iki.fi> | 2012-01-29 19:17:56 +0200 |
---|---|---|
committer | Antti Ajanki <antti.ajanki@iki.fi> | 2012-01-29 19:17:56 +0200 |
commit | c0982d5244cdf3ca7eeb120cdcb943ab36c880af (patch) | |
tree | 6635fb9815bf2ce8351978e2311c52816862a7a9 | |
parent | c5c8695ff8615e4517300d234eedb6824bea4850 (diff) | |
download | vdr-plugin-webvideo-c0982d5244cdf3ca7eeb120cdcb943ab36c880af.tar.gz vdr-plugin-webvideo-c0982d5244cdf3ca7eeb120cdcb943ab36c880af.tar.bz2 |
Fix Google video
-rw-r--r-- | templates/video.google.com/searchresults.xsl | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/templates/video.google.com/searchresults.xsl b/templates/video.google.com/searchresults.xsl index d1524c7..8bd2146 100644 --- a/templates/video.google.com/searchresults.xsl +++ b/templates/video.google.com/searchresults.xsl @@ -9,7 +9,7 @@ <title>Search results</title> <xsl:choose> - <xsl:when test="not(//li[contains(@class, 'videobox')]//td/h3/a)"> + <xsl:when test="not(//li[contains(@class, 'g')]//td/a[not(img)])"> <textarea> <label> <xsl:text>Your search did not return any results.</xsl:text> @@ -18,37 +18,39 @@ </xsl:when> <xsl:otherwise> - <xsl:for-each select="//li[contains(@class, 'videobox')]//td/h3/a"> + <xsl:for-each select="//li[@class='g']//td/a[not(img)]"> + <xsl:variable name="url" select="str:decode-uri(substring-after(@href, 'q='))" /> + <xsl:choose> - <xsl:when test="starts-with(@href, 'http://www.youtube.com/')"> + <xsl:when test="starts-with($url, 'http://www.youtube.com/')"> <link> <label><xsl:value-of select="normalize-space(.)" /></label> - <stream>wvt:///www.youtube.com/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></stream> - <ref>wvt:///www.youtube.com/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(concat('http://gdata.youtube.com/feeds/api/videos/', substring-after(@href, 'v='), '?v=2'), true())"/></ref> + <stream>wvt:///www.youtube.com/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri($url, true())"/></stream> + <ref>wvt:///www.youtube.com/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(concat('http://gdata.youtube.com/feeds/api/videos/', substring-after($url, 'v='), '?v=2'), true())"/></ref> </link> </xsl:when> - <xsl:when test="starts-with(@href, 'http://video.google.com/')"> + <xsl:when test="starts-with($url, 'http://video.google.com/')"> <link> <label><xsl:value-of select="normalize-space(.)"/></label> - <stream>wvt:///video.google.com/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></stream> - <ref>wvt:///video.google.com/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></ref> + <stream>wvt:///video.google.com/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri($url, true())"/></stream> + <ref>wvt:///video.google.com/description.xsl?srcurl=<xsl:value-of select="str:encode-uri($url, true())"/></ref> </link> </xsl:when> - <xsl:when test="starts-with(@href, 'http://www.metacafe.com/')"> + <xsl:when test="starts-with($url, 'http://www.metacafe.com/')"> <link> <label><xsl:value-of select="normalize-space(.)"/></label> - <stream>wvt:///www.metacafe.com/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></stream> - <ref>wvt:///www.metacafe.com/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></ref> + <stream>wvt:///www.metacafe.com/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri($url, true())"/></stream> + <ref>wvt:///www.metacafe.com/description.xsl?srcurl=<xsl:value-of select="str:encode-uri($url, true())"/></ref> </link> </xsl:when> - <xsl:when test="starts-with(@href, 'http://vimeo.com/')"> + <xsl:when test="starts-with($url, 'http://vimeo.com/')"> <link> <label><xsl:value-of select="normalize-space(.)"/></label> - <stream>wvt:///www.vimeo.com/video.xsl?srcurl=http://www.vimeo.com/moogaloop/load/clip:<xsl:value-of select="substring-after(@href, 'http://vimeo.com/')"/></stream> - <ref>wvt:///www.vimeo.com/description.xsl?srcurl=http://vimeo.com/api/v2/video/<xsl:value-of select="substring-after(@href, 'http://vimeo.com/')"/>.xml</ref> + <stream>wvt:///vimeo.com/video.xsl?srcurl=http://www.vimeo.com/moogaloop/load/clip:<xsl:value-of select="substring-after($url, 'http://vimeo.com/')"/>&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="substring-after($url, 'http://vimeo.com/')"/>.xml</ref> </link> </xsl:when> |