I've had an algorithmically equivalent script running for a different purpose for dozens of months now and decided to create a plugin for this great application that I just recently discovered -- thanks for making Serviio, zip.
- Find your channel name; i.e. http://www.twitch.tv/CHANNELNAME
- Add a URL of the above scheme as a Web Resource under Online sources
- The resulting folder will have all available qualities to choose from. "live" is the highgest quality, usually suffixed with a plus sign in the flash player.
- V3 (04.02.2013): fixed more escaping, fixed a bug for null-valued jtv tokens (reuploaded)
- V2 (03.02.2013): fixed jtv token escaping for linux 
- V1 (03.02.2013): initial release 
I've successfully tested it on Serviio 1.1. It requires a comparably new version of librtmp, so you shouldn't go too far back in terms of librtmp/ffmpeg/Serviio versions.
The Serviio 1.1 Windows package comes with a compatible ffmpeg version, under MacOSX or Linux you may have to build ffmpeg manually or see if you can find binary packages for your distribution (for Ubuntu, google librtmp+launchpad or librtmp0+launchpad).
- This plugin circumvents advertisements that partnered streamers can display to gain a revenue. So ideally you shouldn't use this plugin; support them by watching their ads.
- Some channels have resolutions/qualities that are reserved for users that buy a subscription from a channel. This plugin does not display those resolutions, as they don't come with the required authorization token from the server.
- Password-protected channel support. I've written some code, but one guy couldn't get it to work and noone wants to give me a channel to try it out for myself, and before that happens, nothing's gonna happen.