FAQ  •  Register  •  Login

SvtPlay

<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Mon Nov 19, 2012 2:55 pm

SvtPlay

WebResourcePlugin to play contents from http://www.svtplay.se.

Edit 2014-06-05: Posted version 1.1.16 which works with the new SvtPlay site structure. Please note that some of your old feed urls may need to be updated as the content may have been moved. Also, some of the previously available meta data regarding publishing date of shows has been removed from the markup at the site, so in most cases it is no longer available to your DLNA clients.

Edit 2013-09-24: Posted version 1.1.14 which increases the max number of items to retrieve to be 100 when set to "infinite" in the Serviio Console.

Edit 2013-09-24: Posted version 1.1.13 with support for more resolutions in the quality priority list.
This update will probably only affect those who have their quality option set to Low or Medium.

Edit 2013-09-19: Please note that you need an ffmpeg executable which is compiled with support for HTTPS, as all SvtPlay streams are now delivered over that protocol.
HTTPS support is NOT included in the ffmpeg which comes bundled with the Serviio install, but it has been requested for inclusion in upcoming releases (later than version 1.3.1. of Serviio).
Until then, follow the instructions for getting the newest build of ffmpeg:
http://wiki.serviio.org/doku.php?id=win_ffmpeg

Edit 2013-09-11. Posted yet another verson of the plugin to work with slightly altered HTML markup at the SvtPlay site.
As of version 1.1.12 of the plugin, you no longer need to alter the "sida" parameter to increase
the number of shows returned by the plugin. The plugin uses the "max items to retrieve" property
value set in Serviio when you register the content feed. If no max value is set, a maximum of 40 shows
will be returned.

Edit 2013-09-07. Posted yet another verson of the plugin to work with slightly altered HTML markup at the SvtPlay site, this time on the category pages

Edit 2013-09-06. Posted new verson of the plugin to work with slightly altered HTML markup at the SvtPlay site.

Edit 2013-02-13: The plugin file and class is renamed to the shorter "SvtPlay" from version 1.1.9. This is to make plugin management easier on clients with limited screen real estate. PLEASE NOTE: Remember to REMOVE the old plugin file if you install the new one. They should not exist side by side!

Edit 2013-01-25: I believe that there are no longer any general geo-restrictions on SVTPlay content. Some content from foreign sources will be restricted due to licensing, but most content is free even for clients from outside of Sweden. Thus, I have renamed the thread from "SvtPlay (Sweden only)" to just "SvtPlay".

Edit 2012-12-22: PLEASE NOTE: Serviio 1.1 has now been released. The plugin now works out of the box, with no need for extra files or tweaking of configuration files. So the rather long install instructions below are mostly relevant for older versions of Serviio. The feed URL instructions are, of course, still valid.

Full instructions are in the plugin source, with the most important stuff pasted below.

Enjoy!

/ Otto

/**
* SvtPlay.se content URL extractor plugin.
*
* ##############################################
* Resource URL instructions
* ##############################################
*
* This is a plugin of the type "Web Resource" ("Webbresurs").
* (As of version 1.1.16, a separate plugin in the same file also supports rss feeds, but that plugin doesn't quite work - yet; 2014-06-05.)
*
* Find URLs for categories by navigating to your desired category from http://www.svtplay.se/program
* Right click on your desired thumnail show's thumbnail image and copy the shortcut to the clipboard. For documentaries
* ths URL is http://www.svtplay.se/dokumentar
*
* As of version 1.1.12 of the plugin, you no longer need to alter the "sida" parameter to increase
* the number of shows returned by the plugin. The plugin uses the "max items to retrieve" property
* value set in Serviio when you register the content feed.
*
* You can also add individual shows, links to which are found at:
* http://www.svtplay.se/program
* For example, the show "Fotbollskväll" has the feed URL
* http://www.svtplay.se/fotbollskvall
*
* If you want to get only the episodes of the shows (and not the related clips) you do not need to
* modify the URL:s which you have found as per the above instructions.
*
* If you DO want to include the clips, you need to add the request parameter serviioclips=1 to the URL.
* If you do NOT want to include the shows, you need to add the request parameter serviioepisodes=0 to the URL.
* PLEASE NOTE: Neither of these request parameters will actually be passed to the SvtPlay servers. They
* will only be used internally by the plugin and then stripped from the resource URL.
*
* Example. To get shows AND clips of "Fotbollskväll", modify the URL so it becomes:
* http://www.svtplay.se/fotbollskvall?serviioclips=1
*
* If you want one feed to display ONLY the shows and another feed to display ONLY the clips,
* use these two feed urls:
* 1) http://www.svtplay.se/fotbollskvall
* 2) http://www.svtplay.se/fotbollskvall?ser ... episodes=0
*
* Live feeds are included since version 1.1.6.
* They can sometimes be included in certain category pages (such as news).
* To add a feed with ONLY live shows, use this:
* http://www.svtplay.se/?tab=live
* or this:
* http://www.svtplay.se/kanaler
*
Attachments
SvtPlay.groovy
SvtPlay version 1.1.16, adapted for new site structure 2014-06-05
(70 KiB) Downloaded 94 times
FFMPegWrapperLiveServiio1.1.zip
ONLY NEEDED TO WATCH LIVE HLS STREAMS IN SERVIIO pre v 1.2
(1.95 KiB) Downloaded 347 times
svtplay-extras.zip
ONLY NEEDED FOR OLDER VERSIONS OF SERVIIO: jar-file to help unescape html entities in titles, and FFMpeg wrappers for linux and windows
(261.39 KiB) Downloaded 451 times
Last edited by ottomatic on Thu Jun 05, 2014 1:50 pm, edited 30 times in total.
<<

Swehawk

Serviio lover

Posts: 70

Joined: Mon Oct 10, 2011 8:08 pm

Post Tue Nov 20, 2012 10:06 am

Re: SvtPlay (Sweden only)

Great work :D :D :D
Installed the plugin yesterday evening and added "Nyheter - Senaste" with "..sida=5" and got 40 entries/thumbs in my dlna-controller. With the old plug I could never got more than 12! Gonna add the other categories tonight and test some more.

Thank you soooo much!
<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Tue Nov 20, 2012 10:08 am

Re: SvtPlay (Sweden only)

I'm glad it's working for you.

I'll post an update some day soon which also has the correct publishing date for each content item.
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Tue Nov 20, 2012 9:23 pm

Re: SvtPlay (Sweden only)

I'm getting 400 errors.

  Code:
2012-11-20 22:15:06,078 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: http://svtplay9i-f.akamaihd.net/i/world/open/20121120/1224820-032A/VV_AVA_2012-032A-40e735fa8f11fbe7_,900,320,420,620,1660,2760,.mp4.csmil/index_5_av.m3u8?e=b2a7ace1bf661c32
2012-11-20 22:15:06,078 DEBUG [ProcessExecutor] Starting /root/.serviio/lib/FFmpegWrapper.sh -i http://svtplay9i-f.akamaihd.net/i/world/open/20121120/1224820-032A/VV_AVA_2012-032A-40e735fa8f11fbe7_%2c900%2c320%2c420%2c620%2c1660%2c2760%2c.mp4.csmil/index_5_av.m3u8?e=b2a7ace1bf661c32
2012-11-20 22:15:08,977 WARN  [FeedUpdaterThread] Failed to retrieve online item information for http://svtplay9i-f.akamaihd.net/i/world/open/20121120/1224820-032A/VV_AVA_2012-032A-40e735fa8f11fbe7_,900,320,420,620,1660,2760,.mp4.csmil/index_5_av.m3u8?e=b2a7ace1bf661c32. It might not play.


  Code:
ffmpeg version N-42368-gbf53863-Serviio_Qnap Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 19 2012 23:26:14 with gcc 4.2.3
  configuration: --arch=arm --enable-armv5te --prefix=/root/.serviio/opt --extra-cflags=-I/opt/include --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-pthreads --enable-libmp3lame --enable-librtmp --extra-version=Serviio_Qnap
  libavutil      51. 64.100 / 51. 64.100
  libavcodec     54. 33.100 / 54. 33.100
  libavformat    54. 15.102 / 54. 15.102
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  1.100 /  3.  1.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
[http @ 0xe1d8f0] HTTP error 400 Bad Request
http://svtplay9i-f.akamaihd.net/i/world/open/20121120/1224820-032A/VV_AVA_2012-032A-40e735fa8f11fbe7_,900,320,420,620,1660,2760,.mp4.csmil/index_5_av.m3u8\?e=b2a7ace1bf661c32: Input/output error


Any ideas on what this is?
<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Tue Nov 20, 2012 10:24 pm

Re: SvtPlay (Sweden only)

Looks like the wrapper has inserted an extra backslash before the question mark in the URL. I must admit that I haven't tested the wrapper on a Linux box. Will have a look and see if I can come up with a quick fix.
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Tue Nov 20, 2012 10:50 pm

Re: SvtPlay (Sweden only)

Fixed it.

Change
  Code:
ARG="$(printf "%q" "$1")"

to
  Code:
ARG="$(printf "%s" "$1")"


Now it works great!
<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Tue Nov 20, 2012 11:09 pm

Re: SvtPlay (Sweden only)

Great!

I'll update the wrapper in the zip file.
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Tue Nov 20, 2012 11:21 pm

Re: SvtPlay (Sweden only)

My bad!

While this fixes the plugin, the wrapper is still broken. It won't allow spaces in filenames.

I.e ./FFmpegWrapper.sh -i "filename 123.mov" will be lumped together without the quotes. To solve this, the filename argument must be passed along with "$filename"
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Wed Nov 21, 2012 12:31 am

Re: SvtPlay (Sweden only)

Here we go. I refactored the wrapper somewhat and now both CricTV, SVTPlay and my regular media works.

Give it a spin and see if you can spot any flaws.

  Code:
#!/usr/bin/env bash
PATH_TO_FFMPEG=/root/.serviio/opt/bin/ffmpeg

SWITCHES=""

COUNT=$#
for ((INDEX=0; INDEX<COUNT; ++INDEX))
do
    if [ "$1" == "-i" ]
   then
        # Unescape the escaped commas
        FILENAME=`echo $2 | sed -e s/%2c/,/g`
      
      shift
   else
      # Add extra switches
      SWITCHES="$SWITCHES $1"
   fi

   shift
done

#echo $PATH_TO_FFMPEG -i \"$FILENAME\" $SWITCHES
$PATH_TO_FFMPEG -i "$FILENAME" $SWITCHES
<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Wed Nov 21, 2012 7:52 am

Re: SvtPlay (Sweden only)

Actually, there is a flaw in the above implementation as well.

In case there are any arguments before the -i option, they will be moved to after that option. Which I believe makes a huge difference in terms of FFMpeg options. Arguments before the in-file pertain to the incoming stream and arguments after the in-file configure the output.

So I think this should do it:

  Code:
#!/usr/bin/env bash
PATH_TO_FFMPEG=/root/.serviio/opt/bin/ffmpeg

SWITCHES=""

COUNT=$#
for ((INDEX=0; INDEX<COUNT; ++INDEX))
do
    if [ "$1" == "-i" ]
   then
        # Unescape the escaped commas
        FILENAME=`echo $2 | sed -e s/%2c/,/g`
       
        # Make sure we quote the -i argument
        SWITCHES="$SWITCHES -i \"$FILENAME\""
      shift
   else
      # Add extra switches
      SWITCHES="$SWITCHES $1"
   fi

   shift
done

#echo $PATH_TO_FFMPEG $SWITCHES
$PATH_TO_FFMPEG $SWITCHES
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Wed Nov 21, 2012 1:03 pm

Re: SvtPlay (Sweden only)

Actually, while you preserve the order of all the arguments, simply escaping quotes around the filename won't work.

This seems to work. Now it preserves the order of the switches and still keeps the integrity of the input string.

  Code:
#!/usr/bin/env bash
PATH_TO_FFMPEG=/root/.serviio/opt/bin/ffmpeg

PRESWITCHES=""
FILENAME=""
POSTSWITCHES=""
INPUT_FOUND=false

COUNT=$#
for ((INDEX=0; INDEX<COUNT; ++INDEX))
do
   if $INPUT_FOUND
   then
      POSTSWITCHES="$POSTSWITCHES $1"
   else
      if [ "$1" == "-i" ]
      then
         # Unescape the escaped commas
         FILENAME=`echo $2 | sed -e s/%2c/,/g`

         INPUT_FOUND=true
         shift
      else
         # Add extra switches
         PRESWITCHES="$PRESWITCHES $1"
      fi
   fi

   shift
done

#echo $PATH_TO_FFMPEG $PRESWITCHES -i \"$FILENAME\" $POSTSWITCHES
$PATH_TO_FFMPEG $PRESWITCHES -i "$FILENAME" $POSTSWITCHES
<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Wed Nov 21, 2012 9:50 pm

Re: SvtPlay (Sweden only)

Ha!

The output from my latest attempt looked soooo right on my ancient Linux box. But I couldn't be arsed to install ffmpeg to test it - there are no longer any live software packages for the distribution.

Just to be certain, can you verify that flash decryption works with your latest wrapper version?

Add the Homeland feed and see if you can play more than a minute of the latest show:

http://www.svtplay.se/homeland
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Wed Nov 21, 2012 11:03 pm

Re: SvtPlay (Sweden only)

Several episodes were added almost immediately and played right away. I watched some stored media earlier, and that worked aswell. So I would say that it's working.
<<

ottomatic

DLNA master

Posts: 182

Joined: Fri Nov 09, 2012 10:15 am

Post Thu Nov 22, 2012 8:02 pm

Re: SvtPlay (Sweden only)

Hi everyone.

I have updated the files in the original announcement.

Version 1.1 of the plugin correctly parses the publishing date for each content item, if available in the html markup.

Also: when usung the pirate API to fetch streanm urls, if there is no stream matching the requested quality, the first available stream will be returned. This will likely be a dynamic (adaptive) stream declared with an f4m manifest, and ffmpeg is currently unable to play such streams.
(For more info, see: http://rdkls.blogspot.se/2011/11/what-i ... aptive.htm )
So, the bottom line is: there are still some shows that won't show up in your feed. It seems that it won't be easy to get those shows to play im serviio.

The FFMpeg wrapper for linux has been updated according to the latest suggestion by csholmq.
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Fri Nov 23, 2012 1:24 pm

Re: SvtPlay (Sweden only)

Wow, I just gotta say... This plugin is AMAZING! It's fast, it never breaks down, SVTplay streams in really high quality (and loads real fast!).

If only I could figure out how to sort the Webresources after title.
<<

dtp

Serviio newbie

Posts: 6

Joined: Tue Nov 20, 2012 5:43 pm

Post Sat Nov 24, 2012 10:53 am

Re: SvtPlay (Sweden only)

"There is no media in the current folder" when using the svtplay plugin on my wd tv live 3. Any clues?
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Sat Nov 24, 2012 11:10 am

Re: SvtPlay (Sweden only)

dtp wrote:"There is no media in the current folder" when using the svtplay plugin on my wd tv live 3. Any clues?

No clues but many possible causes. Post log.
<<

dtp

Serviio newbie

Posts: 6

Joined: Tue Nov 20, 2012 5:43 pm

Post Sat Nov 24, 2012 12:04 pm

Re: SvtPlay (Sweden only)

here's a log-file. really appreciate your effort!
Attachments
log.txt
(182.36 KiB) Downloaded 149 times
<<

csholmq

DLNA master

Posts: 133

Joined: Sun Mar 25, 2012 11:41 pm

Post Sat Nov 24, 2012 12:34 pm

Re: SvtPlay (Sweden only)

This is the part that I wanted.
  Code:
2012-11-24 12:26:48,673 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\lib/ffmpeg.exe -i http://svtplay7o-f.akamaihd.net/i/world/open/20121120/1337354-011A/WHY_POVERTY_KOR-011A-97b7e3def8b913f7_%2c900%2c320%2c420%2c620%2c1660%2c2760%2c.mp4.csmil/index_0_av.m3u8?e=b2a7ace1bf661c32


It looks like you haven't changed -Dffmpeg.location as the instructions says. This is what it's supposed to look like

  Code:
2012-11-24 13:30:36,478 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\PATH_TO_FFMPEGWRAPPER -i http://svtplay7o-f.akamaihd.net/i/world/open/20121120/1337354-011A/WHY_POVERTY_KOR-011A-97b7e3def8b913f7_%2c900%2c320%2c420%2c620%2c1660%2c2760%2c.mp4.csmil/index_0_av.m3u8?e=b2a7ace1bf661c32


You should change PATH_TO_FFMPEGWRAPPER accordingly.
<<

dtp

Serviio newbie

Posts: 6

Joined: Tue Nov 20, 2012 5:43 pm

Post Sat Nov 24, 2012 3:16 pm

Re: SvtPlay (Sweden only)

FFMPegWrapper in folder lib: SET PATH_TO_FFMPEG="C:\Program Files\Serviio\lib\FFMPeg.exe"

ServiioService.exe in folder bin: -Dffmpeg.location="C:\Program Files\Serviio\lib\FFMPegWrapper.bat"

still the same error...
Next

Return to Available plugins

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.