1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00

Fix for svd.se and di.se streams

This commit is contained in:
Johan Andersson 2012-01-28 15:06:53 +01:00
parent e9b8662830
commit f1e8f25b89

View File

@ -131,30 +131,14 @@ class Urplay(Common):
self.getrtmp("rtmp://streaming.ur.se/", self.output, self.live, other, self.resume) self.getrtmp("rtmp://streaming.ur.se/", self.output, self.live, other, self.resume)
class Qbrick(Common): class Qbrick(Common):
def __init__(self, output, quality, live, other, resume): def __init__(self, output, quality, live, resume):
self.output = output self.output = output
self.quality = quality self.quality = quality
self.live = live self.live = live
self.other = other
self.resume = resume self.resume = resume
def get(self, url): def get(self, url):
host = url + "/rest/v3/getsingleplayer/" + self.other data = self.getdata(url)
data = self.getdata(host)
xml = ET.XML(data)
try:
host = xml.find("media").find("item").find("playlist").find("stream").find("format").find("substream").text
except AttributeError:
host = url + "/rest/v3/getplayer/" + self.other
data = self.getdata(host)
xml = ET.XML(data)
try:
host = xml.find("media").find("item").find("playlist").find("stream").find("format").find("substream").text
except AttributeError:
print("Error")
sys.exit(2)
data = self.getdata(host)
xml = ET.XML(data) xml = ET.XML(data)
server = xml.find("head").find("meta").attrib["base"] server = xml.find("head").find("meta").attrib["base"]
streams = xml.find("body").find("switch") streams = xml.find("body").find("switch")
@ -544,8 +528,16 @@ def main():
if not match: if not match:
print("Something wrong with that url") print("Something wrong with that url")
sys.exit(2) sys.exit(2)
qbrick = Qbrick(output, quality, live, match.group(1) + "DE1BA107", resume) qbrick = Qbrick(output, quality, live, resume)
qbrick.get("http://vms.api.qbrick.com") host = "http://vms.api.qbrick.com/rest/v3/getsingleplayer/" + match.group(1) + "DE1BA107"
data = common.getdata(host)
xml = ET.XML(data)
try:
url = xml.find("media").find("item").find("playlist").find("stream").find("format").find("substream").text
except AttributeError:
print("Cant find stream")
sys.exit(2)
qbrick.get(url)
elif re.findall("di.se", url): elif re.findall("di.se", url):
common = Common() common = Common()
@ -554,8 +546,16 @@ def main():
if not match: if not match:
print("Something wrong with that url") print("Something wrong with that url")
sys.exit(2) sys.exit(2)
qbrick = Qbrick(output, quality, live, match.group(1), resume) qbrick = Qbrick(output, quality, live, resume)
qbrick.get("http://vms.api.qbrick.com") host = "http://vms.api.qbrick.com/rest/v3/getplayer/" + match.group(1)
data = common.getdata(host)
xml = ET.XML(data)
try:
host = xml.find("media").find("item").find("playlist").find("stream").find("format").find("substream").text
except AttributeError:
print("Cant find stream")
sys.exit(2)
qbrick.get(host)
elif re.findall("svd.se", url): elif re.findall("svd.se", url):
match = re.search("_([0-9]+)\.svd", url) match = re.search("_([0-9]+)\.svd", url)
@ -571,8 +571,16 @@ def main():
print("Something wrong with that url") print("Something wrong with that url")
sys.exit(2) sys.exit(2)
qbrick = Qbrick(output, quality, live, match.group(1), resume) qbrick = Qbrick(output, quality, live, resume)
qbrick.get("http://vms.api.qbrick.com") host = "http://vms.api.qbrick.com/rest/v3/getplayer/" + match.group(1)
data = common.getdata(host)
xml = ET.XML(data)
try:
host = xml.find("media").find("item").find("playlist").find("stream").find("format").find("substream").text
except AttributeError:
print("Cant find stream")
sys.exit(2)
qbrick.get(host)
elif re.findall("urplay.se", url): elif re.findall("urplay.se", url):
urplay = Urplay(output, quality, live, resume) urplay = Urplay(output, quality, live, resume)