Minor changes
This commit is contained in:
parent
3e3fb73516
commit
62030d9527
@ -624,7 +624,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla
|
|||||||
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)
|
||||||
if not executable:
|
if not executable:
|
||||||
raise log.exit(" - Unable to find packager binary")
|
raise log.exit(" - Unable to find packager binary")
|
||||||
dec = os.path.splitext(track.locate())[0].replace("enc", "dec.mp4")
|
dec = os.path.splitext(track.locate())[0].replace("enc", "dec") + ".mp4"
|
||||||
|
|
||||||
os.makedirs(directories.temp, exist_ok=True)
|
os.makedirs(directories.temp, exist_ok=True)
|
||||||
try:
|
try:
|
||||||
@ -663,7 +663,7 @@ def result(ctx, service, quality, closest_resolution, range_, wanted, alang, sla
|
|||||||
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")
|
||||||
dec = os.path.splitext(track.locate())[0].replace("enc", "dec.mp4")
|
dec = os.path.splitext(track.locate())[0].replace("enc", "dec") + ".mp4"
|
||||||
os.makedirs(directories.temp, exist_ok=True)
|
os.makedirs(directories.temp, exist_ok=True)
|
||||||
try:
|
try:
|
||||||
os.makedirs(directories.temp, exist_ok=True)
|
os.makedirs(directories.temp, exist_ok=True)
|
||||||
|
|||||||
@ -200,7 +200,7 @@ class Track:
|
|||||||
kid = next(iter(xml.xpath("PROTECTINFO/KID/@VALUE")), None)
|
kid = next(iter(xml.xpath("PROTECTINFO/KID/@VALUE")), None)
|
||||||
if not kid: # v4.3.0.0
|
if not kid: # v4.3.0.0
|
||||||
kid = next(iter(xml.xpath("PROTECTINFO/KIDS/KID/@VALUE")), None) # can be multiple?
|
kid = next(iter(xml.xpath("PROTECTINFO/KIDS/KID/@VALUE")), None) # can be multiple?
|
||||||
self.kid = uuid.UUID(base64.b64decode(self.kid).hex()).bytes_le.hex()
|
self.kid = uuid.UUID(base64.b64decode(kid).hex()).bytes_le.hex()
|
||||||
#if not track.psshWV:
|
#if not track.psshWV:
|
||||||
# self.psshWV = Box.parse(Box.build(dict(
|
# self.psshWV = Box.parse(Box.build(dict(
|
||||||
# type=b"pssh",
|
# type=b"pssh",
|
||||||
@ -240,7 +240,7 @@ class Track:
|
|||||||
xml_str = base64.b64decode(self.psshPR).decode("utf-16-le", "ignore")
|
xml_str = base64.b64decode(self.psshPR).decode("utf-16-le", "ignore")
|
||||||
xml_str = xml_str[xml_str.index("<"):]
|
xml_str = xml_str[xml_str.index("<"):]
|
||||||
kids = [uuid.UUID(base64.b64decode(kid_xml['@VALUE']).hex()).bytes_le.hex() for kid_xml in xmltodict.parse(xml_str)['WRMHEADER']['DATA']['CUSTOMATTRIBUTES']['KIDS']['KID']]
|
kids = [uuid.UUID(base64.b64decode(kid_xml['@VALUE']).hex()).bytes_le.hex() for kid_xml in xmltodict.parse(xml_str)['WRMHEADER']['DATA']['CUSTOMATTRIBUTES']['KIDS']['KID']]
|
||||||
self.kid = kids[-1]
|
self.kid = kids[-1] #Choose a random one cuz DSNP gives two for some reason
|
||||||
|
|
||||||
self.kid = uuid.UUID(base64.b64decode(self.kid).hex()).bytes_le.hex()
|
self.kid = uuid.UUID(base64.b64decode(self.kid).hex()).bytes_le.hex()
|
||||||
|
|
||||||
@ -1226,7 +1226,7 @@ class Tracks:
|
|||||||
)
|
)
|
||||||
|
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if by_codec:
|
if by_codec:
|
||||||
by_codec = by_codec.split(",")
|
by_codec = by_codec.split(",")
|
||||||
|
|||||||
@ -281,7 +281,7 @@ class AppleTVPlus(BaseService):
|
|||||||
if not e.response.text:
|
if not e.response.text:
|
||||||
raise self.log.exit(" - No license returned!")
|
raise self.log.exit(" - No license returned!")
|
||||||
raise self.log.exit(f" - Unable to obtain license (error code: {e.response.json()['errorCode']})")
|
raise self.log.exit(f" - Unable to obtain license (error code: {e.response.json()['errorCode']})")
|
||||||
return res['streaming-response']['streaming-keys'][0]["license"]
|
return base64.b64decode(res['streaming-response']['streaming-keys'][0]["license"])
|
||||||
|
|
||||||
# Service specific functions
|
# Service specific functions
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user