mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
dr: use text for json and send the url to the playlist
This commit is contained in:
parent
421057194e
commit
f01d97df9d
@ -26,7 +26,7 @@ class Dr(Service, OpenGraphThumbMixin):
|
||||
resource_url = match.group(1)
|
||||
resource_data = self.http.request("get", resource_url).content
|
||||
resource = json.loads(resource_data)
|
||||
streams = find_stream(options, resource)
|
||||
streams = self.find_stream(options, resource)
|
||||
for i in streams:
|
||||
yield i
|
||||
else:
|
||||
@ -34,15 +34,16 @@ class Dr(Service, OpenGraphThumbMixin):
|
||||
if not match:
|
||||
log.error("Cant find resource info for this video")
|
||||
return
|
||||
resource_url = "%s" % match.group(1)
|
||||
resource_data = self.http.request("get", resource_url).content
|
||||
resource_url = "http:%s" % match.group(1)
|
||||
resource_data = self.http.request("get", resource_url).text
|
||||
resource = json.loads(resource_data)
|
||||
|
||||
if "SubtitlesList" in resource:
|
||||
suburl = resource["SubtitlesList"][0]["Uri"]
|
||||
yield subtitle(copy.copy(options), "wrst", suburl)
|
||||
if "Data" in resource:
|
||||
streams = find_stream(options, resource)
|
||||
|
||||
streams = self.find_stream(options, resource)
|
||||
for i in streams:
|
||||
yield i
|
||||
else:
|
||||
@ -53,7 +54,7 @@ class Dr(Service, OpenGraphThumbMixin):
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if stream["Target"] == "HLS":
|
||||
streams = hlsparse(self.http.request("get", stream["Uri"]).text)
|
||||
streams = hlsparse(stream["Uri"], self.http.request("get", stream["Uri"]).text)
|
||||
for n in list(streams.keys()):
|
||||
yield HLS(copy.copy(options), streams[n], n)
|
||||
if stream["Target"] == "Streaming":
|
||||
@ -61,7 +62,7 @@ class Dr(Service, OpenGraphThumbMixin):
|
||||
rtmp = "rtmp://vod.dr.dk/cms/"
|
||||
yield RTMP(copy.copy(options), rtmp, stream['Bitrate'])
|
||||
|
||||
def find_stream(options, resource):
|
||||
def find_stream(self, options, resource):
|
||||
tempresource = resource['Data'][0]['Assets']
|
||||
# To find the VideoResource, they have Images as well
|
||||
for resources in tempresource:
|
||||
@ -70,7 +71,7 @@ def find_stream(options, resource):
|
||||
break
|
||||
for i in links:
|
||||
if i["Target"] == "Ios" or i["Target"] == "HLS":
|
||||
streams = hlsparse(i["Uri"])
|
||||
streams = hlsparse(i["Uri"], self.http.request("get", i["Uri"]).text)
|
||||
for n in list(streams.keys()):
|
||||
yield HLS(copy.copy(options), streams[n], n)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user