Fixed 640kbps audio AMZN

This commit is contained in:
chu23465 2025-04-09 10:38:13 +05:30
parent 88a682d1ef
commit 35dfeb8f7d
6 changed files with 17 additions and 11 deletions

View File

@ -20,7 +20,7 @@ I AM NOT taking credit for the entirety of this project. This project is based o
1. Install Microsoft Visual C++ Redistributable - [link](https://aka.ms/vs/17/release/vc_redist.x64.exe).
2. Ensure Python is installed in your system (cannot be from the the Microsoft Store). Refer to [link](https://www.python.org/downloads/) or on Ubuntu -> `sudo apt install python3`. I recommend python 3.10 or higher.
2. Ensure Python is installed in your system (cannot be from the the Microsoft Store). Refer to [link](https://www.python.org/downloads/) or on Ubuntu -> `sudo apt install python3`. I recommend python 3.10.11 (or higher).
3. Make sure git is installed in your system by running `git --version`. If not refer to [link](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

View File

@ -126,6 +126,7 @@ def get_cdm(log, service, profile=None, cdm_name=None):
def get_service_config(service):
"""Get both service config and service secrets as one merged dictionary."""
print(filenames.service_config.format(service=service.lower()))
service_config = load_yaml(filenames.service_config.format(service=service.lower()))
user_config = (load_yaml(filenames.user_service_config.format(service=service.lower())) or load_yaml(filenames.user_service_config.format(service=service)))
@ -499,24 +500,28 @@ def result(ctx, service, quality, range_, wanted, alang, slang, audio_only, subs
session_id=session_id
) or ctx.obj.cdm.common_privacy_cert
)
ctx.obj.cdm.parse_license(
session_id,
service.license(
license = service.license(
challenge=ctx.obj.cdm.get_license_challenge(session_id=session_id, pssh=PSSHWV(track.psshWV)),
title=title,
track=track,
session_id=session_id
)
assert license
ctx.obj.cdm.parse_license(
session_id,
license
)
elif "common_privacy_cert" not in dir(ctx.obj.cdm) and track.psshPR:
challenge = ctx.obj.cdm.get_license_challenge(session_id, PSSH(track.psshPR).wrm_headers[0])
ctx.obj.cdm.parse_license(
session_id,
service.license(
license = service.license(
challenge=challenge,
title=title,
track=track,
) # expects the XML License not base64 encoded str.
)
assert license
ctx.obj.cdm.parse_license(
session_id,
license # expects the XML License not base64 encoded str.
)
else:
raise log.exit("Unable to license")

Binary file not shown.

View File

@ -860,7 +860,7 @@ class Amazon(BaseService):
"deviceStreamingTechnologyOverride": manifest_type if manifest_type else "DASH",
"deviceProtocolOverride": "Https",
"deviceVideoCodecOverride": video_codec,
#"deviceBitrateAdaptationsOverride": bitrate_mode.replace("+", ","),
"deviceBitrateAdaptationsOverride": bitrate_mode.replace("+", ","),
"deviceVideoQualityOverride": quality,
"deviceHdrFormatsOverride": self.VIDEO_RANGE_MAP.get(hdr, "None"),
"supportedDRMKeyScheme": "DUAL_KEY", # ?
@ -1235,7 +1235,7 @@ class Amazon(BaseService):
if response_json["token_type"] != "bearer":
raise self.log.exit("Unexpected returned refreshed token type")
return response
return response_json
def get_csrf_token(self) -> str:
"""

View File

@ -19,8 +19,9 @@ from sys import platform
def load_yaml(path):
if not os.path.isfile(path):
#print(f"Service config does not exist -> {path}")
return {}
with open(path) as fd:
with open(path, 'r') as fd:
return yaml.safe_load(fd)