mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
HDS: show an error message when we see DRM files.
This commit is contained in:
parent
401bb08a78
commit
0e65654a5a
@ -52,6 +52,9 @@ def hdsparse(options, manifest):
|
||||
bootstrapIter = xml.iter("{http://ns.adobe.com/f4m/1.0}bootstrapInfo")
|
||||
mediaIter = xml.iter("{http://ns.adobe.com/f4m/1.0}media")
|
||||
|
||||
if xml.find("{http://ns.adobe.com/f4m/1.0}drmAdditionalHeader") is not None:
|
||||
log.error("HDS DRM protected content.")
|
||||
return
|
||||
for i in bootstrapIter:
|
||||
if "id" in i.attrib:
|
||||
bootstrap[i.attrib["id"]] = i.text
|
||||
|
@ -52,8 +52,9 @@ class Bigbrother(Service):
|
||||
if i["defaultURL"].endswith("f4m"):
|
||||
manifest = "%s?hdcore=3.3.0" % i["defaultURL"]
|
||||
streams = hdsparse(copy.copy(options), manifest)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
|
||||
if i["defaultURL"].endswith("m3u8"):
|
||||
streams = hlsparse(i["defaultURL"])
|
||||
|
@ -44,8 +44,9 @@ class Dr(Service, OpenGraphThumbMixin):
|
||||
if stream["Target"] == "HDS":
|
||||
manifest = "%s?hdcore=2.8.0&g=hejsan" % stream["Uri"]
|
||||
streams = hdsparse(copy.copy(options), manifest)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if stream["Target"] == "HLS":
|
||||
streams = hlsparse(stream["Uri"])
|
||||
for n in list(streams.keys()):
|
||||
|
@ -53,5 +53,6 @@ class Nrk(Service, OpenGraphThumbMixin):
|
||||
|
||||
manifest_url = "%s?hdcore=2.8.0&g=hejsan" % manifest_url
|
||||
streams = hdsparse(copy.copy(options), manifest_url)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
|
@ -87,8 +87,9 @@ class Svtplay(Service, OpenGraphThumbMixin):
|
||||
parse = urlparse(i["url"])
|
||||
manifest = "%s://%s%s?%s&hdcore=3.3.0" % (parse.scheme, parse.netloc, parse.path, parse.query)
|
||||
streams = hdsparse(copy.copy(options), manifest)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
elif parse.scheme == "rtmp":
|
||||
embedurl = "%s?type=embed" % url
|
||||
data = get_http_data(embedurl)
|
||||
|
@ -84,8 +84,9 @@ class Tv4play(Service, OpenGraphThumbMixin):
|
||||
query = "?"
|
||||
manifest = "%s%shdcore=2.8.0&g=hejsan" % (i.find("url").text, query)
|
||||
streams = hdsparse(copy.copy(options), manifest)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
elif i.find("mediaFormat").text == "smi":
|
||||
yield subtitle_smi(i.find("url").text)
|
||||
|
||||
|
@ -40,8 +40,9 @@ class Vg(Service, OpenGraphThumbMixin):
|
||||
parse = urlparse(jsondata["streamUrls"]["hds"])
|
||||
manifest = "%s://%s%s?%s&hdcore=3.3.0" % (parse.scheme, parse.netloc, parse.path, parse.query)
|
||||
streams = hdsparse(copy.copy(options), manifest)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if "hls" in jsondata["streamUrls"]:
|
||||
streams = hlsparse(jsondata["streamUrls"]["hls"])
|
||||
for n in list(streams.keys()):
|
||||
|
@ -97,8 +97,9 @@ class Viaplay(Service, OpenGraphThumbMixin):
|
||||
if filename[len(filename)-3:] == "f4m":
|
||||
manifest = "%s?hdcore=2.8.0&g=hejsan" % filename
|
||||
streams = hdsparse(copy.copy(options), manifest)
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
if streams:
|
||||
for n in list(streams.keys()):
|
||||
yield streams[n]
|
||||
else:
|
||||
parse = urlparse(filename)
|
||||
match = re.search("^(/[^/]+)/(.*)", parse.path)
|
||||
|
Loading…
Reference in New Issue
Block a user