mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
The old fix didnt work so well on python2.
This commit is contained in:
parent
ff73f768f0
commit
8bb19793fb
@ -930,7 +930,7 @@ class Tv4play():
|
|||||||
streams[int(i.find("bitrate").text)] = stream
|
streams[int(i.find("bitrate").text)] = stream
|
||||||
|
|
||||||
if len(streams) == 1:
|
if len(streams) == 1:
|
||||||
test = streams[0]
|
test = streams[list(streams.keys())[0]]
|
||||||
else:
|
else:
|
||||||
test = select_quality(options, streams)
|
test = select_quality(options, streams)
|
||||||
|
|
||||||
@ -986,13 +986,13 @@ class Svtplay():
|
|||||||
streams2[int(i["bitrate"])] = stream
|
streams2[int(i["bitrate"])] = stream
|
||||||
|
|
||||||
if len(streams) == 0 and options.hls:
|
if len(streams) == 0 and options.hls:
|
||||||
test = streams2[0]
|
test = streams2[list(streams.keys())[0]]
|
||||||
test["url"] = test["url"].replace("/z/", "/i/").replace("manifest.f4m", "master.m3u8")
|
test["url"] = test["url"].replace("/z/", "/i/").replace("manifest.f4m", "master.m3u8")
|
||||||
elif len(streams) == 0:
|
elif len(streams) == 0:
|
||||||
log.error("Can't find any streams.")
|
log.error("Can't find any streams.")
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
elif len(streams) == 1:
|
elif len(streams) == 1:
|
||||||
test = streams[0]
|
test = streams[list(streams.keys())[0]]
|
||||||
else:
|
else:
|
||||||
test = select_quality(options, streams)
|
test = select_quality(options, streams)
|
||||||
|
|
||||||
@ -1039,7 +1039,7 @@ class Dr(object):
|
|||||||
for stream in resource['links']:
|
for stream in resource['links']:
|
||||||
streams[stream['bitrateKbps']] = stream['uri']
|
streams[stream['bitrateKbps']] = stream['uri']
|
||||||
if len(streams) == 1:
|
if len(streams) == 1:
|
||||||
uri = streams[0]
|
uri = streams[list(streams.keys())[0]]
|
||||||
else:
|
else:
|
||||||
uri = select_quality(options, streams)
|
uri = select_quality(options, streams)
|
||||||
# need -v ?
|
# need -v ?
|
||||||
|
Loading…
Reference in New Issue
Block a user