Pages

Showing posts with label vlc. Show all posts
Showing posts with label vlc. Show all posts

Saturday, January 5, 2013

WeepeeTV and VLC (2)


Created createwptvxml.pl and weepeetv.lua (for use with vlc)

createwptvxml.pl is a simple screenscaper perl script (yes it's written in Perl and not in a cool language like Python or Ruby) which logs in on the WeepeeTV site and creates an XML containing the necessary m3u8 stream URLS.

This XML can be used to feed other applications on your local network e.g. for use with VLC (see weepeetv.lua)
The xml file format is as follows:
<?xml version='1.0'?>
<items>
<item>
<title>channel</title>
<thumb>https://weepee.tv/img/channels/channel.jpg</thumb>
<h264>https://weepeetv.my-stream.eu/channel/uuid/channeluuid/stream.m3u8</h264>
</item>
</items>

To run the script change the variables on top of createwptvmxl.pl
## change these variables
my $ACCOUNT="uxxxxxx";
my $PASSWORD="secret";
my $CURL="/usr/bin/curl";
my $XMLFILE="wptv.xml";
my @sort=("een","canvas","bbc1","bbc2","acht","vtm","2be","vitaya","jim","ketnet","bbcentertainment","kanaalz","vtmKzoom,"tvllogosmall","livetv");

You can find the code on github

Thursday, December 27, 2012

WeepeeTV and VLC

Started testdriving WeepeeTV this week, bought a subscription for a month (for now).
You can watch tv (SD quality / H264 encoded) using flash (cpu intensive) or HLS.

Unfortunately there's no API available.

But with some creative screenscraping and parsing a lot of fun stuff can be done. 
One example below is a VLC plugin which uses my own xml file (created by screenscraping) as a source.
Very easy way to switch channels without clicking too much or using a browser.



I will put my xml creating script on github, so you can use it too :-)

To use this lua script put it in the lua/sd directory and call it weepeetv.lua
Ofcourse you need to change the parse_url to your own server or local file.

--SD_Description=WeePee TV
--[[
 Authors: 42wim

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]

require "simplexml"

function descriptor()
    return { title="WeePee TV" }
end

function main()
local tree = simplexml.parse_url("http://192.168.x.x:8080/input.xml")
    for _, items in ipairs( tree.children ) do
        simplexml.add_name_maps(items)
        local url = vlc.strings.resolve_xml_special_chars( items.children_map['h264'][1].children[1] )
        local title = vlc.strings.resolve_xml_special_chars( items.children_map['title'][1].children[1] )
        local arturl = vlc.strings.resolve_xml_special_chars( items.children_map['thumb'][1].children[1] )
        vlc.sd.add_item( { path = url, title = title , arturl = arturl } ) 
    end
end