Update dl.py
This commit is contained in:
parent
61d21e94e3
commit
93fdfebc69
@ -338,7 +338,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla
|
|||||||
|
|
||||||
service_name = service.__class__.__name__
|
service_name = service.__class__.__name__
|
||||||
|
|
||||||
if service_name == "DisneyPlus": # Always retrieve fresh keys for DSNP so that content_keys variable has 2 kid:key pairs
|
if service_name in ["DisneyPlus", "Hulu"]: # Always retrieve fresh keys for DSNP so that content_keys variable has 2 kid:key pairs
|
||||||
no_cache = True
|
no_cache = True
|
||||||
|
|
||||||
log.info("Retrieving Titles")
|
log.info("Retrieving Titles")
|
||||||
@ -599,7 +599,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla
|
|||||||
# TODO: Move decryption code to Track
|
# TODO: Move decryption code to Track
|
||||||
if not config.decrypter:
|
if not config.decrypter:
|
||||||
raise log.exit(" - No decrypter specified")
|
raise log.exit(" - No decrypter specified")
|
||||||
if service_name == "DisneyPlus" or (config.decrypter == "packager" and not (track.descriptor == Track.Descriptor.ISM)) :
|
if service_name in ["DisneyPlus", "Hulu"] or (config.decrypter == "packager" and not (track.descriptor == Track.Descriptor.ISM)) :
|
||||||
platform = {"win32": "win", "darwin": "osx"}.get(sys.platform, sys.platform)
|
platform = {"win32": "win", "darwin": "osx"}.get(sys.platform, sys.platform)
|
||||||
names = ["shaka-packager", "packager", f"packager-{platform}"]
|
names = ["shaka-packager", "packager", f"packager-{platform}"]
|
||||||
executable = next((x for x in (shutil.which(x) for x in names) if x), None)
|
executable = next((x for x in (shutil.which(x) for x in names) if x), None)
|
||||||
@ -622,7 +622,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla
|
|||||||
f"label=0:key_id={track.kid.lower()}:key={track.key.lower()}",
|
f"label=0:key_id={track.kid.lower()}:key={track.key.lower()}",
|
||||||
# Apple TV+ needs this as shaka pulls the incorrect KID, idk why
|
# Apple TV+ needs this as shaka pulls the incorrect KID, idk why
|
||||||
f"label=1:key_id=00000000000000000000000000000000:key={track.key.lower()}",
|
f"label=1:key_id=00000000000000000000000000000000:key={track.key.lower()}",
|
||||||
]) if service_name != "DisneyPlus" else
|
]) if service_name not in ["DisneyPlus", "Hulu"] else
|
||||||
",".join(
|
",".join(
|
||||||
[# This right here is a hack as DSNP sometimes has 2 kids and returns 2 keys. FFS.
|
[# This right here is a hack as DSNP sometimes has 2 kids and returns 2 keys. FFS.
|
||||||
"label={}:key_id={}:key={}".format(
|
"label={}:key_id={}:key={}".format(
|
||||||
@ -639,7 +639,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla
|
|||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
raise log.exit(" - Failed!")
|
raise log.exit(" - Failed!")
|
||||||
|
|
||||||
elif service_name != "DisneyPlus" or (config.decrypter == "mp4decrypt" or (track.descriptor == Track.Descriptor.ISM)):
|
elif service_name not in ["DisneyPlus", "Hulu"] or (config.decrypter == "mp4decrypt" or (track.descriptor == Track.Descriptor.ISM)):
|
||||||
executable = shutil.which("mp4decrypt")
|
executable = shutil.which("mp4decrypt")
|
||||||
if not executable:
|
if not executable:
|
||||||
raise log.exit(" - Unable to find mp4decrypt binary")
|
raise log.exit(" - Unable to find mp4decrypt binary")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user