summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2012-09-13 22:37:33 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2012-09-13 22:40:06 +0300
commitb27b9f78c71761dc4b9df224c29ab6a11776575a (patch)
treedfa74eb9cde440f37b622ebb2d43751aaf5028b4
parent50cb06a1ea355824c49398fe655f9d4296639502 (diff)
downloadvdr-plugin-webvideo-b27b9f78c71761dc4b9df224c29ab6a11776575a.tar.gz
vdr-plugin-webvideo-b27b9f78c71761dc4b9df224c29ab6a11776575a.tar.bz2
ruutu.fi fixes
-rw-r--r--templates/www.ruutu.fi/description.xsl28
-rw-r--r--templates/www.ruutu.fi/mainmenu.xsl6
-rw-r--r--templates/www.ruutu.fi/mostviewed.xsl18
-rw-r--r--templates/www.ruutu.fi/program.xsl106
-rw-r--r--templates/www.ruutu.fi/recent.xsl18
-rw-r--r--templates/www.ruutu.fi/series.xsl15
-rw-r--r--templates/www.ruutu.fi/video.xsl2
-rw-r--r--templates/www.ruutu.fi/videopage.xsl6
8 files changed, 84 insertions, 115 deletions
diff --git a/templates/www.ruutu.fi/description.xsl b/templates/www.ruutu.fi/description.xsl
index aa5326d..aed48c4 100644
--- a/templates/www.ruutu.fi/description.xsl
+++ b/templates/www.ruutu.fi/description.xsl
@@ -20,30 +20,32 @@
<xsl:template match="/">
<wvmenu>
- <title><xsl:value-of select="/Playerdata/Behavior/Program/@program_name"/></title>
+ <title><xsl:value-of select="normalize-space(//h1[@class='node-title'])"/></title>
- <xsl:if test="/Playerdata/Behavior/Program/@description">
- <textarea>
- <label><xsl:value-of select="/Playerdata/Behavior/Program/@description"/></label>
- </textarea>
- </xsl:if>
+ <textarea>
+ <label>
+ <xsl:value-of select="normalize-space(//div[contains(@class, 'field-name-field-season')])"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="normalize-space(//div[contains(@class, 'field-name-field-episode')])"/>
+ </label>
+ </textarea>
+
+ <textarea>
+ <label><xsl:value-of select="normalize-space(//div[contains(@class, 'field-name-field-starttime')])"/></label>
+ </textarea>
<textarea>
- <label><xsl:value-of select="/Playerdata/Behavior/Program/@episode_name"/></label>
+ <label><xsl:value-of select="normalize-space(//div[contains(@class, 'field-name-field-webdescription')])"/></label>
</textarea>
<textarea>
- <label>Kesto: <xsl:call-template name="pretty-print-seconds">
- <xsl:with-param name="seconds">
- <xsl:value-of select="/Playerdata/Behavior/Program/@episode_duration"/>
- </xsl:with-param>
- </xsl:call-template>
+ <label>Kesto: <xsl:value-of select="normalize-space(//div[contains(@class, 'field-name-field-duration')])"/>
</label>
</textarea>
<link>
<label>Lataa</label>
- <stream>wvt:///www.ruutu.fi/video.xsl?srcurl=<xsl:value-of select="str:encode-uri($docurl, true())"/></stream>
+ <stream>wvt:///www.ruutu.fi/videopage.xsl?srcurl=<xsl:value-of select="str:encode-uri($docurl, true())"/></stream>
</link>
</wvmenu>
</xsl:template>
diff --git a/templates/www.ruutu.fi/mainmenu.xsl b/templates/www.ruutu.fi/mainmenu.xsl
index a8b051b..8261fc1 100644
--- a/templates/www.ruutu.fi/mainmenu.xsl
+++ b/templates/www.ruutu.fi/mainmenu.xsl
@@ -16,17 +16,17 @@
<link>
<label>Listaa sarjat</label>
- <ref>wvt:///www.ruutu.fi/series.xsl?srcurl=http://www.ruutu.fi/ajax/media_get_netti_tv_series_list/all/false&amp;postprocess=json2xml</ref>
+ <ref>wvt:///www.ruutu.fi/series.xsl?srcurl=http://www.ruutu.fi/ajax/series-navi</ref>
</link>
<link>
<label>Uusimmat</label>
- <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=http://www.ruutu.fi/ajax/media_get_nettitv_media/all/video_episode/__/latestdesc/0/25/true/__&amp;postprocess=json2xml</ref>
+ <ref>wvt:///www.ruutu.fi/recent.xsl?srcurl=http://www.ruutu.fi/etusivu</ref>
</link>
<link>
<label>Katsotuimmat</label>
- <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=http://www.ruutu.fi/ajax/media_get_nettitv_media/all/video_episode/__/most_watched/0/25/true/__&amp;postprocess=json2xml</ref>
+ <ref>wvt:///www.ruutu.fi/mostviewed.xsl?srcurl=http://www.ruutu.fi/etusivu</ref>
</link>
</wvmenu>
</xsl:template>
diff --git a/templates/www.ruutu.fi/mostviewed.xsl b/templates/www.ruutu.fi/mostviewed.xsl
new file mode 100644
index 0000000..621ea8a
--- /dev/null
+++ b/templates/www.ruutu.fi/mostviewed.xsl
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ exclude-result-prefixes="str">
+
+<xsl:import href="program.xsl"/>
+
+<xsl:template match="/">
+<wvmenu>
+ <title>Ruutu.fi - Katsotuimmat</title>
+
+ <xsl:apply-templates select="id('quicktabs-container-katsotuimmat')//article"/>
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/www.ruutu.fi/program.xsl b/templates/www.ruutu.fi/program.xsl
index fd5c9c0..37b1611 100644
--- a/templates/www.ruutu.fi/program.xsl
+++ b/templates/www.ruutu.fi/program.xsl
@@ -7,112 +7,46 @@
<xsl:param name="docurl"/>
-<xsl:template match="dict">
- <xsl:param name="mediatype" select="video"/>
-
- <xsl:variable name="videoid">
- <xsl:choose>
- <xsl:when test="video_id_to_use">
- <xsl:value-of select="video_id_to_use"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after(nodeurl, 'vid=')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
+<xsl:template match="article">
<link>
<label>
- <xsl:choose>
- <xsl:when test="video_name_to_use != '' and program_episode_name != '' and video_name_to_use != program_episode_name">
- <xsl:value-of select="normalize-space(concat(video_name_to_use, ': ', program_episode_name, ' ', video_datetime_to_use))"/>
- </xsl:when>
- <xsl:when test="clip_series_name != '' and video_name_to_use != ''">
- <xsl:value-of select="normalize-space(concat(clip_series_name, ': ', video_name_to_use, ' ', video_datetime_to_use))"/>
- </xsl:when>
- <xsl:when test="video_name_to_use != ''">
- <xsl:value-of select="normalize-space(concat(video_name_to_use, ' ', video_datetime_to_use))"/>
- </xsl:when>
- <xsl:when test="program_episode_name != ''">
- <xsl:value-of select="normalize-space(concat(program_episode_name, ' ', video_datetime_to_use))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="title"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="normalize-space(.//h2[@class='node-title']/a)"/>
+ <xsl:if test=".//div[contains(@class, 'field-name-field-xb-name')]">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="normalize-space(.//div[contains(@class, 'field-name-field-xb-name')])"/>
+ </xsl:if>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="normalize-space(.//div[contains(@class, 'field-name-field-season')])"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="normalize-space(.//div[contains(@class, 'field-name-field-episode')])"/>
</label>
-
- <xsl:variable name="videourl">http://www.nelonen.fi/utils/video_config/%3Fq%3D<xsl:value-of select="$mediatype"/>/<xsl:value-of select="$videoid"/>%26site%3Dwww.ruutu.fi%26ageCheckURL%3Dhttp://sso.nelonenmedia.fi/ajax/check_age/%26current_page%3Dhttp://www.ruutu.fi/video</xsl:variable>
-
- <ref>wvt:///www.ruutu.fi/description.xsl?srcurl=<xsl:value-of select="$videourl"/></ref>
- <stream>wvt:///www.ruutu.fi/video.xsl?srcurl=<xsl:value-of select="$videourl"/></stream>
+ <ref>wvt:///www.ruutu.fi/description.xsl?srcurl=<xsl:value-of select="@about"/></ref>
+ <stream>wvt:///www.ruutu.fi/videopage.xsl?srcurl=<xsl:value-of select="@about"/></stream>
</link>
</xsl:template>
<xsl:template match="/">
<wvmenu>
- <xsl:variable name="start">
- <xsl:value-of select="number(str:tokenize($docurl, '/')[9])"/>
- </xsl:variable>
-
<!-- title -->
- <title>Ruutu.fi</title>
+ <title><xsl:value-of select="//h1[@class='node-title']"/></title>
<!-- Video links -->
- <xsl:if test="not(/jsondocument/dict/video | /jsondocument/dict/video_episode)">
+ <xsl:if test="not(id('block-views-videos-by-series-episodes-1')//article)">
<textarea>
<label>Ei jaksoja</label>
</textarea>
</xsl:if>
- <xsl:apply-templates select="/jsondocument/dict/video_episode/list/li/dict">
- <xsl:with-param name="mediatype">video_episode</xsl:with-param>
- </xsl:apply-templates>
- <xsl:apply-templates select="/jsondocument/dict/video/list/li/dict">
- <xsl:with-param name="mediatype">video</xsl:with-param>
+ <xsl:apply-templates select="id('block-views-videos-by-series-episodes-1')//article">
</xsl:apply-templates>
- <xsl:if test="contains($docurl, '/video_episode/') and ($start = 0)">
- <link>
+ <xsl:if test="id('block-views-videos-by-series-clips-1')//article">
+ <textarea>
<label>Klipit</label>
- <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=<xsl:value-of select="str:replace($docurl, '/video_episode/', '/video/')"/>&amp;postprocess=json2xml</ref>
- </link>
- </xsl:if>
-
- <!-- prev/next links -->
- <xsl:variable name="total">
- <xsl:value-of select="number(/jsondocument/dict/total_count)"/>
- </xsl:variable>
-
- <xsl:variable name="urlend">
- <xsl:text>/</xsl:text><xsl:value-of select="str:tokenize($docurl, '/')[10]"/><xsl:text>/</xsl:text><xsl:value-of select="str:tokenize($docurl, '/')[11]"/><xsl:text>/</xsl:text><xsl:value-of select="str:tokenize($docurl, '/')[12]"/>
- </xsl:variable>
-
- <xsl:variable name="prevstart">
- <xsl:choose>
- <xsl:when test="$start >= 25">
- <xsl:value-of select="string($start - 25)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>0</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:if test="$start > 0">
- <link>
- <label>Edellinen</label>
- <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=<xsl:value-of select="str:encode-uri(str:replace($docurl, concat(string($start), $urlend), concat($prevstart, $urlend)), true())"/>&amp;postprocess=json2xml</ref>
- </link>
- </xsl:if>
-
- <xsl:if test="$start + 25 &lt; $total">
- <link>
- <label>Seuraava</label>
- <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=<xsl:value-of select="str:encode-uri(str:replace($docurl, concat(string($start), $urlend), concat(string($start+25), $urlend)), true())"/>&amp;postprocess=json2xml</ref>
- </link>
+ </textarea>
+ <xsl:apply-templates select="id('block-views-videos-by-series-clips-1')//article">
+ </xsl:apply-templates>
</xsl:if>
-
</wvmenu>
</xsl:template>
diff --git a/templates/www.ruutu.fi/recent.xsl b/templates/www.ruutu.fi/recent.xsl
new file mode 100644
index 0000000..5101cf5
--- /dev/null
+++ b/templates/www.ruutu.fi/recent.xsl
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ exclude-result-prefixes="str">
+
+<xsl:import href="program.xsl"/>
+
+<xsl:template match="/">
+<wvmenu>
+ <title>Ruutu.fi - Uusimmat</title>
+
+ <xsl:apply-templates select="id('quicktabs-etusivu_uusimmat_qt')//article"/>
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/www.ruutu.fi/series.xsl b/templates/www.ruutu.fi/series.xsl
index 217d8be..4bf5cda 100644
--- a/templates/www.ruutu.fi/series.xsl
+++ b/templates/www.ruutu.fi/series.xsl
@@ -7,21 +7,18 @@
<xsl:output method="xml" version="1.0" encoding="UTF-8" />
-<xsl:template match="dict">
- <xsl:if test="is_video=1">
- <link>
- <label><xsl:value-of select="name"/></label>
- <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=http://www.ruutu.fi/ajax/media_get_nettitv_video/all/video_episode/<xsl:value-of select="str:encode-uri(str:encode-uri(url_encode_name, true()), true())"/>/latestdesc/0/25/true/__&amp;postprocess=json2xml</ref>
- <!-- Yes, ruutu.fi really expects url_encode_name to be double-url-encoded! -->
- </link>
- </xsl:if>
+<xsl:template match="a">
+ <link>
+ <label><xsl:value-of select="."/></label>
+ <ref>wvt:///www.ruutu.fi/program.xsl?srcurl=<xsl:value-of select="str:encode-uri(@href, true())"/></ref>
+ </link>
</xsl:template>
<xsl:template match="/">
<wvmenu>
<title>Kaikki sarjat</title>
- <xsl:apply-templates select="/jsondocument/list/li/dict"/>
+ <xsl:apply-templates select="//div[@class='has-episodes']/a"/>
</wvmenu>
</xsl:template>
diff --git a/templates/www.ruutu.fi/video.xsl b/templates/www.ruutu.fi/video.xsl
index 55fa9a5..f813751 100644
--- a/templates/www.ruutu.fi/video.xsl
+++ b/templates/www.ruutu.fi/video.xsl
@@ -7,7 +7,7 @@
<xsl:template name="mediaurl">
<mediaurl>
- <title><xsl:value-of select="concat(/Playerdata/Behavior/Program/@program_name, ' ', /Playerdata/Behavior/Program/@episode_name)"/></title>
+ <title><xsl:value-of select="normalize-space(concat(/Playerdata/Behavior/Program/@program_name, ' ', /Playerdata/Behavior/Program/@episode_name))"/></title>
<xsl:choose>
<xsl:when test="starts-with(/Playerdata/Clip/SourceFile, 'rtmp://') or
diff --git a/templates/www.ruutu.fi/videopage.xsl b/templates/www.ruutu.fi/videopage.xsl
index 7060eba..01091c7 100644
--- a/templates/www.ruutu.fi/videopage.xsl
+++ b/templates/www.ruutu.fi/videopage.xsl
@@ -11,9 +11,9 @@
</xsl:template>
<xsl:template match="/">
- <xsl:param name="mediatype" select="substring-before(substring-after($docurl, 'vt='), '&amp;vid=')"/>
- <xsl:param name="videoid" select="substring-after($docurl, '&amp;vid=')"/>
- <xsl:variable name="videourl">http://www.nelonen.fi/utils/video_config/?q=<xsl:value-of select="$mediatype"/>/<xsl:value-of select="$videoid"/>&amp;site=www.ruutu.fi&amp;ageCheckURL=http://sso.nelonenmedia.fi/ajax/check_age/&amp;current_page=http://www.ruutu.fi/video</xsl:variable>
+ <xsl:param name="mediatype" select="substring-before(substring-after(id('block-ruutu-commerce-video-area')/script, 'type%3D'), '%26')"/>
+ <xsl:param name="videoid" select="substring-before(substring-after(id('block-ruutu-commerce-video-area')/script, 'id%3D'), '%26')"/>
+ <xsl:variable name="videourl">http://crossbow.nelonenmedia.fi/mxmlc?type=<xsl:value-of select="$mediatype"/>&amp;id=<xsl:value-of select="$videoid"/>&amp;site=www.ruutu.fi&amp;gRVBR=0</xsl:variable>
<xsl:apply-templates select="document($videourl)" mode="video_config"/>
</xsl:template>