Add new MPL profiles, add option to disable HPL

This commit is contained in:
shirt 2023-01-16 18:40:34 -05:00
parent 0c6844c4bb
commit 96856b02e0
Signed by: shirt
GPG key ID: A5D61AB2D5489EE1
9 changed files with 94 additions and 64 deletions

View file

@ -2,6 +2,14 @@
// This script runs as a drop-in replacement of the original cadmium-playercore. This is not a content script.
console.log("Netflix International script active!");
if (window.globalOptions === undefined) {
try {
window.globalOptions = JSON.parse(document.getElementById("netflix-intl-settings").innerText);
} catch(e) {
console.error("Could not load settings:", e);
}
}
/* eslint-disable no-undef */
// https://stackoverflow.com/a/45985333
function getBrowser() {
@ -47,23 +55,29 @@ function get_profile_list(original_profiles) {
"playready-h264mpl30-dash",
"playready-h264mpl31-dash",
"playready-h264mpl40-dash",
"h264mpl30-dash-playready-prk-qc",
"h264mpl31-dash-playready-prk-qc",
"h264mpl40-dash-playready-prk-qc",
]);
}
if (original_profiles.includes("playready-h264hpl30-dash")) {
profiles = profiles.concat([
"playready-h264hpl30-dash",
"playready-h264hpl31-dash",
"playready-h264hpl40-dash",
]);
}
if (original_profiles.includes("h264hpl30-dash-playready-live")) {
profiles = profiles.concat([
"h264hpl30-dash-playready-live",
"h264hpl31-dash-playready-live",
"h264hpl40-dash-playready-live",
]);
if (!globalOptions.disableHPL) {
if (original_profiles.includes("playready-h264hpl30-dash")) {
profiles = profiles.concat([
"playready-h264hpl30-dash",
"playready-h264hpl31-dash",
"playready-h264hpl40-dash",
]);
}
if (original_profiles.includes("h264hpl30-dash-playready-live")) {
profiles = profiles.concat([
"h264hpl30-dash-playready-live",
"h264hpl31-dash-playready-live",
"h264hpl40-dash-playready-live",
]);
}
} else {
profiles = profiles.filter(val => !val.includes("h264hpl"));
}
if (!globalOptions.disableVP9 && original_profiles.includes("vp9-profile0-L30-dash-cenc")) {