diff options
| author | Antti Ajanki <antti.ajanki@iki.fi> | 2010-10-24 21:05:47 +0300 |
|---|---|---|
| committer | Antti Ajanki <antti.ajanki@iki.fi> | 2010-10-24 21:05:47 +0300 |
| commit | 4770a7e7d1a06fcea280382c546ae38cf4fd084e (patch) | |
| tree | 9fd5b235a907edf4c76ceaf769d0cdbe501399c6 /templates/video.google.com | |
| parent | 439024953d1abe71fd5adce26fac4f17c1aa9f96 (diff) | |
| download | vdr-plugin-webvideo-4770a7e7d1a06fcea280382c546ae38cf4fd084e.tar.gz vdr-plugin-webvideo-4770a7e7d1a06fcea280382c546ae38cf4fd084e.tar.bz2 | |
rename template directories and add videopage.xsl to each template
Diffstat (limited to 'templates/video.google.com')
| -rw-r--r-- | templates/video.google.com/description.xsl | 22 | ||||
| -rw-r--r-- | templates/video.google.com/search.xsl | 36 | ||||
| -rw-r--r-- | templates/video.google.com/searchresults.xsl | 78 | ||||
| -rw-r--r-- | templates/video.google.com/service.xml | 7 | ||||
| -rw-r--r-- | templates/video.google.com/videopage.xsl | 19 |
5 files changed, 162 insertions, 0 deletions
diff --git a/templates/video.google.com/description.xsl b/templates/video.google.com/description.xsl new file mode 100644 index 0000000..b7cab19 --- /dev/null +++ b/templates/video.google.com/description.xsl @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template match="/"> +<wvmenu> + <title><xsl:value-of select="//title"/></title> + + <textarea> + <label><xsl:value-of select="//span[@id='long-desc']"/></label> + </textarea> + <textarea> + <label>Duration: <xsl:value-of select="//span[@id='video-duration']"/></label> + </textarea> + <textarea> + <label>Date: <xsl:value-of select="//span[@id='video-date']"/></label> + </textarea> +</wvmenu> +</xsl:template> + +</xsl:stylesheet> diff --git a/templates/video.google.com/search.xsl b/templates/video.google.com/search.xsl new file mode 100644 index 0000000..07dbda6 --- /dev/null +++ b/templates/video.google.com/search.xsl @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings"> + +<xsl:template match="/"> +<wvmenu> + <title>Google video search</title> + + <textfield name="q"> + <label>Search terms</label> + </textfield> + + <itemlist name="so"> + <label>Sort by</label> + <item value="">Relevance</item> + <item value=",sbd:1">Date</item> + </itemlist> + + <itemlist name="dur"> + <label>Duration</label> + <item value="">All durations</item> + <item value=",dur:s">Short (< 4 min)</item> + <item value=",dur:m">Medium (4-20 min)</item> + <item value=",dur:l">Long (> 20 min)</item> + </itemlist> + + <button> + <label>Search</label> + <submission>wvt:///video.google.com/searchresults.xsl?srcurl=<xsl:value-of select="str:encode-uri('http://www.google.com/search?q={q}&tbs=vid:1{dur}{so}', true())"/>&HTTP-header=User-Agent,Mozilla/5.0</submission> + </button> +</wvmenu> +</xsl:template> + +</xsl:stylesheet> diff --git a/templates/video.google.com/searchresults.xsl b/templates/video.google.com/searchresults.xsl new file mode 100644 index 0000000..5069825 --- /dev/null +++ b/templates/video.google.com/searchresults.xsl @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings"> + +<xsl:template match="/"> +<wvmenu> + <title>Search results</title> + + <xsl:choose> + <xsl:when test="not(//li[@class='g videobox s']/table/tr/td/h3/a)"> + <textarea> + <label> + <xsl:text>Your search did not return any results.</xsl:text> + </label> + </textarea> + </xsl:when> + + <xsl:otherwise> + <xsl:for-each select="//li[@class='g videobox s']/table/tr/td/h3/a"> + <xsl:choose> + <xsl:when test="starts-with(@href, '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> + </link> + </xsl:when> + + <xsl:when test="starts-with(@href, '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> + </link> + </xsl:when> + + <xsl:when test="starts-with(@href, '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> + </link> + </xsl:when> + + <xsl:when test="starts-with(@href, '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> + </link> + </xsl:when> + + <xsl:when test="starts-with(@href, 'http://svtplay.se/')"> + <link> + <label><xsl:value-of select="normalize-space(.)"/></label> + <stream>wvt:///svtplay.se/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></stream> + <ref>wvt:///svtplay.se/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></ref> + </link> + </xsl:when> + + </xsl:choose> + </xsl:for-each> + + <xsl:for-each select="id('nav')//td[@class='b']/a"> + <link> + <label><xsl:value-of select="span[2]/text()"/></label> + <ref>wvt:///video.google.com/searchresults.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></ref> + </link> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + +</wvmenu> +</xsl:template> + +</xsl:stylesheet> diff --git a/templates/video.google.com/service.xml b/templates/video.google.com/service.xml new file mode 100644 index 0000000..4e41372 --- /dev/null +++ b/templates/video.google.com/service.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<service> + <title>Google Video</title> + <ref>wvt:///video.google.com/search.xsl</ref> + <description>Google video search</description> +</service> diff --git a/templates/video.google.com/videopage.xsl b/templates/video.google.com/videopage.xsl new file mode 100644 index 0000000..52d6d98 --- /dev/null +++ b/templates/video.google.com/videopage.xsl @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings"> + +<xsl:template match="/"> +<mediaurl> + <title><xsl:value-of select="/html/head/title" /></title> + <xsl:for-each select="/html/body/script"> + <xsl:variable name="videourl" select="str:decode-uri(substring-before(substring-after(., 'videoUrl\x3d'), '\x26'))"/> + <xsl:if test="$videourl"> + <url><xsl:value-of select="$videourl"/></url> + </xsl:if> + </xsl:for-each> +</mediaurl> +</xsl:template> + +</xsl:stylesheet> |
