Attempt for RedBee
This commit is contained in:
18
content.js
18
content.js
@@ -17,3 +17,21 @@ document.addEventListener('pssh', (e) => {
|
||||
pageURL: document.URL
|
||||
},null);
|
||||
});
|
||||
|
||||
//Fetch from original origin
|
||||
chrome.runtime.onMessage.addListener(
|
||||
async function (request, sender, sendResponse) {
|
||||
if(request.type=="FETCH"){
|
||||
console.log("DEBUG")
|
||||
let res = await fetch(request.u, {
|
||||
method: request.m,
|
||||
headers: request.h,
|
||||
body: request.b
|
||||
}).then((r)=>r.json()).then((r)=>{
|
||||
btoa(String.fromCharCode(...new Uint8Array(r)))
|
||||
})
|
||||
sendResponse({res: res});
|
||||
return true
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<select id="scheme">
|
||||
<option value="CommonWV">CommonWV</option>
|
||||
<option value="DRMToday">DRMToday</option>
|
||||
<option value="RedBee">Red Bee Media</option>
|
||||
</select><br>
|
||||
|
||||
<input type="button" id="guess" value="Guess!"><br>
|
||||
|
||||
6
popup.js
6
popup.js
@@ -33,6 +33,12 @@ function copyResult(){
|
||||
navigator.clipboard.writeText(this.value);
|
||||
}
|
||||
|
||||
window.corsFetch = (u, m, h, b) => {
|
||||
chrome.runtime.sendMessage({type:"FETCH", u:u, m:m, h:h, b:b}, function(response) {
|
||||
console.log(response)
|
||||
});
|
||||
}
|
||||
|
||||
if(psshs.length!=0){
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('noEME').style.display='none';
|
||||
|
||||
14
python/schemes/RedBee.py
Normal file
14
python/schemes/RedBee.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import base64
|
||||
import re
|
||||
import js
|
||||
req = base64.b64decode(licBody.encode()).decode()
|
||||
b64challenge = base64.b64encode(challenge).decode()
|
||||
req = re.sub(r'(?<=\"message\":\").*(?=\"})', b64challenge, req)
|
||||
print(req)
|
||||
# res = await (await pyfetch(licUrl,
|
||||
# method="POST",
|
||||
# headers=licHeaders,
|
||||
# body=req
|
||||
# )).json()
|
||||
res = js.window.corsFetch(licUrl, "POST", licHeaders, req)
|
||||
licence = base64.b64decode(res['license'].encode())
|
||||
Reference in New Issue
Block a user