Fix amazon
This commit is contained in:
@@ -46,11 +46,18 @@ function updateBadge() {
|
|||||||
chrome.webRequest.onBeforeSendHeaders.addListener(
|
chrome.webRequest.onBeforeSendHeaders.addListener(
|
||||||
function(details) {
|
function(details) {
|
||||||
if (details.method === "POST") {
|
if (details.method === "POST") {
|
||||||
|
if (!window.bodys)
|
||||||
|
window.bodys=[];
|
||||||
|
|
||||||
|
// Vérifier que le body existe dans window.bodys avant d'y accéder
|
||||||
|
const bodyData = window.bodys.find((b) => b.id == details.requestId);
|
||||||
|
|
||||||
window.requests.push({
|
window.requests.push({
|
||||||
url:details.url,
|
url:details.url,
|
||||||
headers:convertHeaders(details.requestHeaders),
|
headers:convertHeaders(details.requestHeaders),
|
||||||
body:window.bodys.find((b) => b.id == details.requestId).body
|
body: bodyData ? bodyData.body : "" // Utiliser une chaîne vide si pas de body trouvé
|
||||||
});
|
});
|
||||||
|
|
||||||
if(testBlock(details.url)){
|
if(testBlock(details.url)){
|
||||||
return {cancel:true}
|
return {cancel:true}
|
||||||
}
|
}
|
||||||
@@ -63,15 +70,29 @@ chrome.webRequest.onBeforeSendHeaders.addListener(
|
|||||||
//Get requestBody from POST requests
|
//Get requestBody from POST requests
|
||||||
chrome.webRequest.onBeforeRequest.addListener(
|
chrome.webRequest.onBeforeRequest.addListener(
|
||||||
function(details) {
|
function(details) {
|
||||||
// Ton code existant pour les POST
|
// Code existant pour les POST - avec vérification du requestBody
|
||||||
if (details.method === "POST") {
|
if (details.method === "POST") {
|
||||||
|
if (!window.bodys)
|
||||||
|
window.bodys=[];
|
||||||
|
|
||||||
|
// Vérifier que requestBody existe et a la propriété raw
|
||||||
|
let bodyContent = "";
|
||||||
|
if (details.requestBody && details.requestBody.raw && details.requestBody.raw.length > 0) {
|
||||||
|
try {
|
||||||
|
bodyContent = btoa(String.fromCharCode(...new Uint8Array(details.requestBody.raw[0]['bytes'])));
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("Erreur lors de l'encodage du body:", e);
|
||||||
|
bodyContent = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
window.bodys.push({
|
window.bodys.push({
|
||||||
body:details.requestBody.raw ? btoa(String.fromCharCode(...new Uint8Array(details.requestBody.raw[0]['bytes']))) : "",
|
body: bodyContent,
|
||||||
id: details.requestId
|
id: details.requestId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nouveau : capturer les MPD
|
// Nouveau : capturer les MPD (pour toutes les méthodes)
|
||||||
if (details.url.includes('.mpd') ||
|
if (details.url.includes('.mpd') ||
|
||||||
details.url.includes('manifest') ||
|
details.url.includes('manifest') ||
|
||||||
details.url.includes('dash.mpd') ||
|
details.url.includes('dash.mpd') ||
|
||||||
|
|||||||
@@ -4,3 +4,5 @@ license.vdocipher.com
|
|||||||
ngenix.net/license
|
ngenix.net/license
|
||||||
shield-drm.imggaming.com/api/v2/license
|
shield-drm.imggaming.com/api/v2/license
|
||||||
wvls/contentlicenseservice/v1/licenses
|
wvls/contentlicenseservice/v1/licenses
|
||||||
|
unagi-eu.amazon.com/1/events/com.amazon.csm.csa.prod
|
||||||
|
atv-ps-eu.primevideo.com/cdp/usage/Clickstream
|
||||||
|
|||||||
@@ -1,7 +1,28 @@
|
|||||||
import urllib.parse
|
# import urllib.parse
|
||||||
payload = f'widevine2Challenge={urllib.parse.quote(base64.b64encode(cdm.service_certificate_challenge).decode())}&includeHdcpTestKeyInLicense=true'
|
# payload = f'widevine2Challenge={urllib.parse.quote(base64.b64encode(cdm.service_certificate_challenge).decode())}&includeHdcpTestKeyInLicense=true'
|
||||||
service_cert = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
|
# service_cert = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
|
||||||
service_cert = service_cert['widevine2License']['license']
|
# service_cert = service_cert['widevine2License']['license']
|
||||||
payload = f'widevine2Challenge={urllib.parse.quote(getChallenge("b64", service_cert))}&includeHdcpTestKeyInLicense=true'
|
# payload = f'widevine2Challenge={urllib.parse.quote(getChallenge("b64", service_cert))}&includeHdcpTestKeyInLicense=true'
|
||||||
|
# licence = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
|
||||||
|
# licence = licence['widevine2License']['license']
|
||||||
|
from js import console
|
||||||
|
import json
|
||||||
|
|
||||||
|
payload = loadBody("json")
|
||||||
|
payload['licenseChallenge'] = getChallenge("b64")
|
||||||
|
|
||||||
|
# DEBUG: Vérifier le payload avant envoi
|
||||||
|
console.log("=== REQUEST DEBUG ===")
|
||||||
|
console.log("License URL:", licUrl)
|
||||||
|
console.log("Payload:", json.dumps(payload))
|
||||||
|
console.log("Headers:", json.dumps(licHeaders))
|
||||||
|
console.log("Challenge type:", type(payload.get('licenseChallenge')))
|
||||||
|
|
||||||
licence = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
|
licence = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
|
||||||
licence = licence['widevine2License']['license']
|
console.log("Response complet:", json.dumps(licence))
|
||||||
|
payload['licenseChallenge'] = getChallenge("b64")
|
||||||
|
licence = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
|
||||||
|
# Afficher dans la console JS
|
||||||
|
licence_str = json.dumps(licence) if licence else "null"
|
||||||
|
console.log("Widevine License JSON:", licence_str)
|
||||||
|
licence = licence['widevineLicense']['license']
|
||||||
@@ -7,7 +7,7 @@ lic.drmtoday.com$$DRMToday
|
|||||||
corusappservices.com/authorization/widevine/getresourcekey$$GlobalTV
|
corusappservices.com/authorization/widevine/getresourcekey$$GlobalTV
|
||||||
b2c-www.redefine.pl/rpc/drm/$$PolSatBoxGo
|
b2c-www.redefine.pl/rpc/drm/$$PolSatBoxGo
|
||||||
widevine.entitlement.eu.theplatform.com$$thePlatform
|
widevine.entitlement.eu.theplatform.com$$thePlatform
|
||||||
cdp/catalog/GetPlaybackResources$$Amazon
|
atv-ps-eu.primevideo.com/playback/drm-vod/GetWidevineLicense$$Amazon
|
||||||
drm-license.youku.tv$$Youku
|
drm-license.youku.tv$$Youku
|
||||||
NOS71ZV1/wvls$$NosTV
|
NOS71ZV1/wvls$$NosTV
|
||||||
license.vdocipher.com/auth$$VdoCipher
|
license.vdocipher.com/auth$$VdoCipher
|
||||||
|
|||||||
Reference in New Issue
Block a user