commit cd8b99556540ba90d777a5cb83b36e5422033499 Author: Johan Andersson Date: Tue Mar 1 17:42:12 2011 +0100 Inital commit 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