From cd8b99556540ba90d777a5cb83b36e5422033499 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 1 Mar 2011 17:42:12 +0100 Subject: [PATCH] Inital commit --- svtplay-dl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 svtplay-dl diff --git a/svtplay-dl b/svtplay-dl new file mode 100755 index 0000000..e4b8a6d --- /dev/null +++ b/svtplay-dl @@ -0,0 +1,20 @@ +#!/usr/bin/env python +import re,urllib2,urllib,os,subprocess +def getdata(url): + request = urllib2.Request(url) + request.add_header = [('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')] + response = urllib2.urlopen(request) + data = response.read() + response.close(); + return data + +text = getdata("http://svtplay.se/t/103466/dokument_inifran") +m = re.search('dynamicStreams=(.*)\&\;background', text) +new = m.group(1) +tmp = new.split("|") +m = re.search('url:(.*)\,',tmp[0]) +stream = m.group(1) +output = os.path.basename(stream) +command = ["/usr/bin/rtmpdump","-r",stream,"-o",output] +subprocess.call(command) +print output