diff --git a/Aha Capture.zip b/Aha Capture.zip new file mode 100644 index 0000000..4a31bce Binary files /dev/null and b/Aha Capture.zip differ diff --git a/Aha Capture/background.js b/Aha Capture/background.js deleted file mode 100644 index 133285d..0000000 --- a/Aha Capture/background.js +++ /dev/null @@ -1,128 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const lic_headers = tabIDs[details.id].license_request[0]?.license_headers; - const lic_url = tabIDs[details.id].license_url; - const lic_data_json = tabIDs[details.id].license_data; - const mpd_link = tabIDs[details.id].mpd_url; - const video_link = tabIDs[details.id].player_url; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header X-Forwarded-For. - // This might help to bypass regional restrictions when performing the license request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const aha_gen_link = "https://drm-bot.herokuapp.com/aha.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', aha_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_license_link = json_resp.data; - - const final = `${video_link}*${mpd_link}*${generated_license_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The aha link and the mpd link and the generated link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getLicenseRequestData(details) { - if (details.url.includes(".mpd")) { - console.log(details.url); - tabIDs[details.tabId].mpd_url = details.url; - } else if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - const encodedString = btoa(unescape(encodeURIComponent(decodedString))); - - // If the license request does not uses json payloads the data has been sent in raw format. - // But the base64 encoded format of it will have the characters "CAES". - if (encodedString.includes("CAES")) { - tabIDs[details.tabId].license_data = `$'\\u0008\\u0004'` - tabIDs[details.tabId].license_url = details.url - tabIDs[details.tabId].req_id = details.requestId - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: ["https://streaming-vod-aha.akamaized.net/*", "https://widevine-proxy.api.aha.firstlight.ai/*"], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - } -} -chrome.webRequest.onBeforeSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: ["https://widevine-proxy.api.aha.firstlight.ai/*"], types: ["xmlhttprequest"] }, - ["requestHeaders"] -); - -chrome?.tabs?.onUpdated?.addListener((tabId, changeInfo, tab) => { - if (tab.url.includes("https://www.aha.video/player/")) { - tabIDs[tabId] = {license_data: "", license_request: [], license_url: "", req_id: "", mpd_url: "", player_url: tab.url}; - } -}); \ No newline at end of file diff --git a/Aha Capture/icon128.png b/Aha Capture/icon128.png deleted file mode 100644 index 9c4a677..0000000 Binary files a/Aha Capture/icon128.png and /dev/null differ diff --git a/Aha Capture/manifest.json b/Aha Capture/manifest.json deleted file mode 100644 index 3dc3283..0000000 --- a/Aha Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Aha Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "2.0" -} \ No newline at end of file diff --git a/Altbalaji Capture.zip b/Altbalaji Capture.zip new file mode 100644 index 0000000..d706818 Binary files /dev/null and b/Altbalaji Capture.zip differ diff --git a/Altbalaji Capture/background.js b/Altbalaji Capture/background.js deleted file mode 100644 index b98d38e..0000000 --- a/Altbalaji Capture/background.js +++ /dev/null @@ -1,130 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const lic_headers = tabIDs[details.id].license_request[0]?.license_headers; - const lic_url = tabIDs[details.id].license_url; - const lic_data_json = tabIDs[details.id].license_data; - const mpd_link = tabIDs[details.id].mpd_url; - const video_link = tabIDs[details.id].video_metadata_url; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header X-Forwarded-For. - // This might help to bypass regional restrictions when performing the license request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const alt_gen_link = "https://drm-bot.herokuapp.com/alt.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', alt_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_license_link = json_resp.data; - - const final = `${video_link}*${mpd_link}*${generated_license_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The altbalaji link and the mpd link and the generated link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot.\n\nIf you need to play this video on the site please remember to disable this extension and reload the page."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getLicenseRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.url.includes(".mpd")) { - console.log(details.url); - tabIDs[details.tabId].mpd_url = details.url; - } else if (details.url.includes("videos")) { - console.log(details.url); - tabIDs[details.tabId].video_metadata_url = details.url; - } else if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - const encodedString = btoa(unescape(encodeURIComponent(decodedString))); - - // If the license request does not uses json payloads the data has been sent in raw format. - // But the base64 encoded format of it will have the characters "CAES". - if (encodedString.includes("CAES")) { - tabIDs[details.tabId] = {license_data: `$'\\u0008\\u0004'`, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? "", video_metadata_url: tabIDs[details.tabId].video_metadata_url ?? ""}; - - // If the license request uses json payloads the charcters "CAES" will be there in almost all cases. - } else if (decodedString.includes("CAES") || details.url.includes("license") && decodedString.includes("token") && decodedString.length > 4000 || decodedString.includes("8, 1, 18")) { - tabIDs[details.tabId] = {license_data: decodedString, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? "", video_metadata_url: tabIDs[details.tabId].video_metadata_url ?? ""}; - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: ["https://api.cloud.altbalaji.com/media/videos/*", "https://cdn.cloud.altbalaji.com/*", "https://api.cloud.altbalaji.com/player/drm/widevine-modular"], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - - return { cancel: true }; /* This license request holds an one time token values in the payload. So blocking it before it is sent to the server and capturing them! */ - } -} -chrome.webRequest.onBeforeSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: ["https://api.cloud.altbalaji.com/player/drm/widevine-modular"], types: ["xmlhttprequest"] }, - ["requestHeaders", "blocking"] -); \ No newline at end of file diff --git a/Altbalaji Capture/icon128.png b/Altbalaji Capture/icon128.png deleted file mode 100644 index 1c346c8..0000000 Binary files a/Altbalaji Capture/icon128.png and /dev/null differ diff --git a/Altbalaji Capture/manifest.json b/Altbalaji Capture/manifest.json deleted file mode 100644 index 602b12c..0000000 --- a/Altbalaji Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Altbalaji Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "webRequestBlocking", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "2.0" -} \ No newline at end of file diff --git a/Clearkey Capture/icon128.png b/Clearkey Capture.zip similarity index 52% rename from Clearkey Capture/icon128.png rename to Clearkey Capture.zip index 9f510f0..a09f3f0 100644 Binary files a/Clearkey Capture/icon128.png and b/Clearkey Capture.zip differ diff --git a/Clearkey Capture/background.js b/Clearkey Capture/background.js deleted file mode 100644 index 3978c56..0000000 --- a/Clearkey Capture/background.js +++ /dev/null @@ -1,60 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(dataId, tabTd) { - let clearkeyData = tabIDs[dataId].clearkey_data; - const clearkey_gen_link = "https://drm-bot.herokuapp.com/clearkey.php"; - var data = new FormData(); - data.append('playlist', clearkeyData); - data.append('api', 'api'); - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', clearkey_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_clearkey_link = json_resp.data; - const final = `${tabIDs[dataId].mpd_url}*${generated_clearkey_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: tabTd}); - chrome.browserAction.setBadgeText({text: "📋", tabId: tabTd}); - console.log("The required data to download this clearkey video has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - } - gen_link.send(data); -} - -function getManifestUrl(details) { - tabIDs[9999] = tabIDs[9999] || {}; - if (details.url.includes(".mpd")) { - tabIDs[9999] = {mpd_url: details.url, clearkey_data: ""}; - console.log(`MPD URL:- ${details.url}`); - } -} -chrome.webRequest.onBeforeRequest.addListener( - getManifestUrl, - { urls: [""], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (!request || !sender.tab) - return; - tabIDs[9999] = tabIDs[9999] || {}; - if (tabIDs[9999].clearkey_data === "") { - tabIDs[9999].clearkey_data = request; - console.log(`CLEARKEY DATA:- ${tabIDs[9999].clearkey_data}`); - requestToClipboard(9999, sender.tab.id); - } -}); \ No newline at end of file diff --git a/Clearkey Capture/content-script.js b/Clearkey Capture/content-script.js deleted file mode 100644 index 7c7de53..0000000 --- a/Clearkey Capture/content-script.js +++ /dev/null @@ -1,21 +0,0 @@ -(() => { - "use strict"; - - window.addEventListener("message", (event) => { - if (event.source != window) - return; - - if (event.data.type && event.data.type === "38405bbb-36ef-454d-8b32-346f9564c979") { - if (event.data.log) - chrome.runtime.sendMessage(event.data.log); - } - }, false); - - const script = document.createElement("script"); - script.type = "text/javascript"; - script.defer = false; - script.async = false; - script.src = chrome.extension.getURL("/eme-logger-mod.js"); - (document.head || document.documentElement).appendChild(script); - script.remove(); -})(); \ No newline at end of file diff --git a/Clearkey Capture/eme-logger-mod.js b/Clearkey Capture/eme-logger-mod.js deleted file mode 100644 index 4555323..0000000 --- a/Clearkey Capture/eme-logger-mod.js +++ /dev/null @@ -1,30 +0,0 @@ -(async () => { - const b64 = { - decode: s => Uint8Array.from(atob(s), c => c.charCodeAt(0)), - encode: b => btoa(String.fromCharCode(...new Uint8Array(b))) - }; - - const fnproxy = (object, func) => new Proxy(object, { apply: func }); - - const proxy = (object, key, func) => Object.defineProperty(object, key, { - value: fnproxy(object[key], func) - }); - - proxy(MediaKeySession.prototype, 'update', async (_target, _this, _args) => { - const [response] = _args; - const resp = b64.encode(response) - if (resp) { - if (resp.startsWith("eyJ")) { - console.groupCollapsed( - `[EME] MediaKeySession::update\n` + - ` Session ID: ${_this.sessionId || '(not available)'}\n` + - ` Clearkeys Response: ${resp}` - ); - window.postMessage({ type: "38405bbb-36ef-454d-8b32-346f9564c979", log: resp }, "*"); - } - } - console.trace(); - console.groupEnd(); - return _target.apply(_this, _args); - }); -})(); \ No newline at end of file diff --git a/Clearkey Capture/manifest.json b/Clearkey Capture/manifest.json deleted file mode 100644 index b75e1aa..0000000 --- a/Clearkey Capture/manifest.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "Clearkey Capture", - "version": "2.0", - "manifest_version": 2, - "background": { - "scripts": [ - "background.js" - ] - }, - "content_scripts": [ - { - "matches": [ - "*://*/*" - ], - "js": [ - "content-script.js" - ], - "all_frames": false, - "run_at": "document_start" - } - ], - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ - "*://*/*", - "clipboardWrite", - "tabs", - "webRequest", - "activeTab", - "storage" - ], - "web_accessible_resources": [ - "eme-logger-mod.js" - ] -} \ No newline at end of file diff --git a/Jio Capture/icon128.png b/Jio Capture.zip similarity index 81% rename from Jio Capture/icon128.png rename to Jio Capture.zip index 1a1bc84..6c7ea54 100644 Binary files a/Jio Capture/icon128.png and b/Jio Capture.zip differ diff --git a/Jio Capture/background.js b/Jio Capture/background.js deleted file mode 100644 index a5035cc..0000000 --- a/Jio Capture/background.js +++ /dev/null @@ -1,124 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - const lic_headers = tabIDs[tabId].license_request[0]?.license_headers; - const lic_url = tabIDs[tabId].license_url; - const lic_data_json = tabIDs[tabId].license_data; - const video_link = tabIDs[tabId].video_metadata_url; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header X-Forwarded-For. - // This might help to bypass regional restrictions when performing the license request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const jio_gen_link = "https://drm-bot.herokuapp.com/jio.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', jio_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_license_link = json_resp.data; - - const final = `${video_link}*${generated_license_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: tabId}); - chrome.browserAction.setBadgeText({text: "📋", tabId: tabId}); - console.log("The jio link and the generated link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot.\n\nIf you need to play this video on the site please remember to disable this extension and reload the page."); - tabIDs[tabId].timeout_id = setTimeout(() => {chrome.browserAction.setBadgeText({text: "", tabId: tabId});}, 20000); - - } - gen_link.send(data); - } - get_ip.send(); -} - -function getLicenseRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.url.includes("playbackrights") && details.method == "POST") { - console.log(details.url); - tabIDs[details.tabId].video_metadata_url = details.url; - } else if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - const encodedString = btoa(unescape(encodeURIComponent(decodedString))); - - // If the license request does not uses json payloads the data has been sent in raw format. - // But the base64 encoded format of it will have the characters "CAES". - if (encodedString.includes("CAES")) { - tabIDs[details.tabId] = {license_data: `$'\\u0008\\u0004'`, license_request: [], license_url: details.url, req_id: details.requestId, video_metadata_url: tabIDs[details.tabId].video_metadata_url ?? ""}; - - // If the license request uses json payloads the charcters "CAES" will be there in almost all cases. - } else if (decodedString.includes("CAES") || details.url.includes("license") && decodedString.includes("token") && decodedString.length > 4000 || decodedString.includes("8, 1, 18")) { - tabIDs[details.tabId] = {license_data: decodedString, license_request: [], license_url: details.url, req_id: details.requestId, video_metadata_url: tabIDs[details.tabId].video_metadata_url ?? ""}; - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: ["https://prod.media.jio.com/apis/common/v3/playbackrights/*", "https://prod.media.jio.com/proxy*"], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - console.log(tabIDs) - requestToClipboard(details.tabId); - } -} -chrome.webRequest.onBeforeSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: ["https://prod.media.jio.com/proxy*"], types: ["xmlhttprequest"] }, - ["requestHeaders"] -); \ No newline at end of file diff --git a/Jio Capture/manifest.json b/Jio Capture/manifest.json deleted file mode 100644 index 372e797..0000000 --- a/Jio Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Jio Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "2.0" -} \ No newline at end of file diff --git a/Learnyst Capture.zip b/Learnyst Capture.zip new file mode 100644 index 0000000..8cf597d Binary files /dev/null and b/Learnyst Capture.zip differ diff --git a/Learnyst Capture/background.js b/Learnyst Capture/background.js deleted file mode 100644 index 569f12a..0000000 --- a/Learnyst Capture/background.js +++ /dev/null @@ -1,122 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const lic_headers = tabIDs[details.id].license_request[0]?.license_headers; - const lic_url = tabIDs[details.id].license_url; - const lic_data_json = tabIDs[details.id].license_data; - const mpd_link = tabIDs[details.id].mpd_url; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header X-Forwarded-For. - // This might help to bypass regional restrictions when performing the license request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const license_gen_link = "https://drm-bot.herokuapp.com/learnyst.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', license_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_license_link = json_resp.data; - - const final = `${mpd_link}*${generated_license_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The mpd link and the generated link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getLicenseRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.url.includes(".mpd") && details.url.includes("sdrm")) { - console.log(details.url); - tabIDs[details.tabId].mpd_url = details.url; - } else if (details.url.includes("sessions.bugsnag.com")) { - chrome.tabs.executeScript(details.tabId, {file: 'clear_storage.js'}); - console.log("Cleared storage"); - } else if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - - if (decodedString.includes("rz8l9uBxppeZrFM0rhlLLck64hvUydSTNE0WcEpJzpef8gSLfyxTcxa3tgvjgdrhhtiJuGiYTijZRfTvHb3XW7BAZUDw")) { - tabIDs[details.tabId] = {license_data: decodedString, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? ""}; - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: ["https://drmv4-ax.learnyst.com/drmlicense/widevine", "https://streaming-cdn.learnyst.com/*", "https://sessions.bugsnag.com/"], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - - return { cancel: true }; /* This license request holds an encrypted one time token value (singleUseToken) in the payload. Even though editing it works, the easiest way is to block it before it is sent to the server and to capture them! */ - } -} -chrome.webRequest.onBeforeSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: ["https://drmv4-ax.learnyst.com/drmlicense/widevine"], types: ["xmlhttprequest"] }, - ["requestHeaders", "blocking"] -); \ No newline at end of file diff --git a/Learnyst Capture/clear_storage.js b/Learnyst Capture/clear_storage.js deleted file mode 100644 index 9502789..0000000 --- a/Learnyst Capture/clear_storage.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() { - var ses = ` -window.localStorage.clear();`; - var script = document.createElement('script'); - script.innerHTML = ses; - document.body.appendChild(script); -})(); \ No newline at end of file diff --git a/Learnyst Capture/icon128.png b/Learnyst Capture/icon128.png deleted file mode 100644 index 460367e..0000000 Binary files a/Learnyst Capture/icon128.png and /dev/null differ diff --git a/Learnyst Capture/manifest.json b/Learnyst Capture/manifest.json deleted file mode 100644 index 6c4ac47..0000000 --- a/Learnyst Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Learnyst Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "webRequestBlocking", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "3.0" -} \ No newline at end of file diff --git a/Mystry Capture/icon128.png b/Mystry Capture.zip similarity index 65% rename from Mystry Capture/icon128.png rename to Mystry Capture.zip index bfc38e7..68e5c4a 100644 Binary files a/Mystry Capture/icon128.png and b/Mystry Capture.zip differ diff --git a/Mystry Capture/background.js b/Mystry Capture/background.js deleted file mode 100644 index d40826c..0000000 --- a/Mystry Capture/background.js +++ /dev/null @@ -1,130 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const lic_headers = tabIDs[details.id].license_request[0]?.license_headers; - const lic_url = tabIDs[details.id].license_url; - const lic_data_json = tabIDs[details.id].license_data; - const mpd_link = tabIDs[details.id].mpd_url; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header X-Forwarded-For. - // This might help to bypass regional restrictions when performing the license request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const license_gen_link = "https://drm-bot.herokuapp.com/gen.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', license_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_license_link = json_resp.data; - - const final = `${mpd_link}*${generated_license_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The mpd link and the generated link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getLicenseRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.url.includes(".mpd")) { - console.log(details.url); - tabIDs[details.tabId].mpd_url = details.url; - } else if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - const encodedString = btoa(unescape(encodeURIComponent(decodedString))); - - // If the license request does not uses json payloads the data has been sent in raw format. - // But the base64 encoded format of it will have the characters "CAES". - if (encodedString.includes("CAES")) { - tabIDs[details.tabId] = {license_data: `$'\\u0008\\u0004'`, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? ""}; - - // If the license request uses json payloads the charcters "CAES" will be there in almost all cases. - } else if (decodedString.includes("CAES") || details.url.includes("license") && decodedString.includes("token") && decodedString.length > 4000 || decodedString.includes("8, 1, 18")) { - tabIDs[details.tabId] = {license_data: decodedString, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? ""}; - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: [""], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - - // Some license requests can hold one time token values in their headers or payload. So blocking such requests before they are sent to the server and capturing them! - // If your license request also holds one time values add them in the below line, seprating by an || operator. Remember to disable the extension if you actually need to play the video of these services! - if (details.url.includes("api2.hbogoasia.com/onwards-widevine") || details.requestHeaders.includes("prepladder.com") || details.url.includes("scvm1sc0.anycast.nagra.com")) { - return { cancel: true }; - } - } -} -chrome.webRequest.onBeforeSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: [""], types: ["xmlhttprequest"] }, - ["requestHeaders", "blocking"] -); \ No newline at end of file diff --git a/Mystry Capture/manifest.json b/Mystry Capture/manifest.json deleted file mode 100644 index b52235b..0000000 --- a/Mystry Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Mystery Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "webRequestBlocking", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "3.0" -} \ No newline at end of file diff --git a/PSSH Capture.zip b/PSSH Capture.zip new file mode 100644 index 0000000..99fed0d Binary files /dev/null and b/PSSH Capture.zip differ diff --git a/PSSH Capture/background.js b/PSSH Capture/background.js deleted file mode 100644 index 4f4cc95..0000000 --- a/PSSH Capture/background.js +++ /dev/null @@ -1,140 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const lic_headers = tabIDs[details.id].license_request[0]?.license_headers; - const lic_url = tabIDs[details.id].license_url; - const lic_data_json = tabIDs[details.id].license_data; - const widevine_pssh = tabIDs[details.id].pssh; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header X-Forwarded-For. - // This might help to bypass regional restrictions when performing the license request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const license_gen_link = "https://drm-bot.herokuapp.com/gen.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', license_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_license_link = json_resp.data; - - const final = `${widevine_pssh}^${generated_license_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The pssh and the generated link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getLicenseRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - const encodedString = btoa(unescape(encodeURIComponent(decodedString))); - - // If the license request does not uses json payloads the data has been sent in raw format. - // But the base64 encoded format of it will have the characters "CAES". - if (encodedString.includes("CAES")) { - tabIDs[details.tabId].license_data = `$'\\u0008\\u0004'`; - tabIDs[details.tabId].license_url = details.url; - tabIDs[details.tabId].req_id = details.requestId; - - // If the license request uses json payloads the charcters "CAES" will be there in almost all cases. - } else if (decodedString.includes("CAES") || details.url.includes("license") && decodedString.includes("token") && decodedString.length > 4000 || decodedString.includes("8, 1, 18")) { - tabIDs[details.tabId].license_data = decodedString; - tabIDs[details.tabId].license_url = details.url; - tabIDs[details.tabId].req_id = details.requestId; - - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: [""], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - - // Some license requests can hold one time token values in their headers or payload. So blocking such requests before they are sent to the server and capturing them! - // If your license request also holds one time values add them in the below line, seprating by an || operator. Remember to disable the extension if you actually need to play the video of these services! - if (details.url.includes("api2.hbogoasia.com/onwards-widevine") || details.requestHeaders.includes("prepladder.com") || details.url.includes("scvm1sc0.anycast.nagra.com")) { - return { cancel: true }; - } - } -} -chrome.webRequest.onBeforeSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: [""], types: ["xmlhttprequest"] }, - ["requestHeaders", "blocking", "extraHeaders"] -); - -chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (!request || !sender.tab) - return; - tabIDs[sender.tab.id] = tabIDs[sender.tab.id] || {}; - tabIDs[sender.tab.id] = {license_data: "", license_request: [], license_url: "", req_id: "", pssh: request}; - console.log(`PSSH:- ${tabIDs[sender.tab.id].pssh}`); -}); \ No newline at end of file diff --git a/PSSH Capture/content-script.js b/PSSH Capture/content-script.js deleted file mode 100644 index ff4544d..0000000 --- a/PSSH Capture/content-script.js +++ /dev/null @@ -1,21 +0,0 @@ -(() => { - "use strict"; - - window.addEventListener("message", (event) => { - if (event.source != window) - return; - - if (event.data.type && event.data.type === "38405bbb-36ef-454d-8b32-346f9564c978") { - if (event.data.log) - chrome.runtime.sendMessage(event.data.log); - } - }, false); - - const script = document.createElement("script"); - script.type = "text/javascript"; - script.defer = false; - script.async = false; - script.src = chrome.extension.getURL("/eme-logger-mod.js"); - (document.head || document.documentElement).appendChild(script); - script.remove(); -})(); \ No newline at end of file diff --git a/PSSH Capture/eme-logger-mod.js b/PSSH Capture/eme-logger-mod.js deleted file mode 100644 index 3b8f3ff..0000000 --- a/PSSH Capture/eme-logger-mod.js +++ /dev/null @@ -1,25 +0,0 @@ -(async () => { - const b64 = { - decode: s => Uint8Array.from(atob(s), c => c.charCodeAt(0)), - encode: b => btoa(String.fromCharCode(...new Uint8Array(b))) - }; - - const fnproxy = (object, func) => new Proxy(object, { apply: func }); - - const proxy = (object, key, func) => Object.defineProperty(object, key, { - value: fnproxy(object[key], func) - }); - - proxy(MediaKeySession.prototype, 'generateRequest', async (_target, _this, _args) => { - const [initDataType, initData] = _args; - const pssh = b64.encode(initData); - console.groupCollapsed( - `PSSH: ${b64.encode(initData)}` - ); - console.trace(); - console.groupEnd(); - if (pssh) - window.postMessage({ type: "38405bbb-36ef-454d-8b32-346f9564c978", log: pssh }, "*"); - return _target.apply(_this, _args); - }); -})(); \ No newline at end of file diff --git a/PSSH Capture/icon.png b/PSSH Capture/icon.png deleted file mode 100644 index 1914d6f..0000000 Binary files a/PSSH Capture/icon.png and /dev/null differ diff --git a/PSSH Capture/icon128.png b/PSSH Capture/icon128.png deleted file mode 100644 index 906e4a4..0000000 Binary files a/PSSH Capture/icon128.png and /dev/null differ diff --git a/PSSH Capture/manifest.json b/PSSH Capture/manifest.json deleted file mode 100644 index 56945a2..0000000 --- a/PSSH Capture/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "PSSH Capture", - "version": "3.0", - "manifest_version": 2, - "background": { - "scripts": [ - "background.js" - ] - }, - "content_scripts": [ - { - "matches": [ - "*://*/*" - ], - "js": [ - "content-script.js" - ], - "all_frames": false, - "run_at": "document_start" - } - ], - "browser_action": {"default_icon": "icon.png"}, - "permissions": [ - "*://*/*", - "clipboardWrite", - "tabs", - "webRequest", - "activeTab", - "storage", - "webRequestBlocking" - ], - "web_accessible_resources": [ - "eme-logger-mod.js" - ] -} \ No newline at end of file diff --git a/Voot Capture.zip b/Voot Capture.zip new file mode 100644 index 0000000..d56ad4f Binary files /dev/null and b/Voot Capture.zip differ diff --git a/Voot Capture/background.js b/Voot Capture/background.js deleted file mode 100644 index 77e58ba..0000000 --- a/Voot Capture/background.js +++ /dev/null @@ -1,124 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const lic_headers = tabIDs[details.id].license_request[0]?.license_headers; - const lic_url = tabIDs[details.id].license_url; - const lic_data_json = tabIDs[details.id].license_data; - const mpd_link = tabIDs[details.id].mpd_url; - if (!lic_headers) - return; - - // Fetching the user's ip for setting the header x-forwarded-for. - // This might help to bypass regional restrictions when performing the playback request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_license_data = "curl "; - curl_license_data += `'${lic_url}' \\`; - for (; i < lic_headers.length; ++i) - curl_license_data += `\n -H '${lic_headers[i].name.toLowerCase()}: ${lic_headers[i].value}' \\`; - curl_license_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_license_data += "\n --data-raw "; - - if (lic_data_json.includes("u0008")) { - curl_license_data += `${lic_data_json} \\`; - } else { - curl_license_data += `'${lic_data_json}' \\`; /* It is not the same as above line. Note the additional ' symbol at the start and end! */ - } - - curl_license_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const voot_gen_link = "https://drm-bot.herokuapp.com/voot.php"; - var data = new FormData(); - data.append('playlist', curl_license_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', voot_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_playback_link = json_resp.data; - - const final = `${mpd_link}*${generated_playback_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The required voot link of widevine license curl data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getLicenseRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.url.includes(".mpd")) { - console.log(details.url); - tabIDs[details.tabId].mpd_url = details.url; - } else if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - const encodedString = btoa(unescape(encodeURIComponent(decodedString))); - - // If the license request does not uses json payloads the data has been sent in raw format. - // But the base64 encoded format of it will have the characters "CAES". - if (encodedString.includes("CAES")) { - tabIDs[details.tabId] = {license_data: `$'\\u0008\\u0004'`, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? ""}; - - // If the license request uses json payloads the charcters "CAES" will be there in almost all cases. - } else if (decodedString.includes("CAES") || details.url.includes("license") && decodedString.includes("token") && decodedString.length > 4000 || decodedString.includes("8, 1, 18")) { - tabIDs[details.tabId] = {license_data: decodedString, license_request: [], license_url: details.url, req_id: details.requestId, mpd_url: tabIDs[details.tabId].mpd_url ?? ""}; - } else { - return; - } - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getLicenseRequestData, - { urls: ["https://prod.media.jio.com/wvproxy*", "https://jiostreamingdash.akamaized.net/*"], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getLicenseRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].license_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].license_request.push({license_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - } -} -chrome.webRequest.onSendHeaders.addListener( - getLicenseRequestHeaders, - { urls: ["https://prod.media.jio.com/wvproxy*"], types: ["xmlhttprequest"] }, - ["requestHeaders"] -); \ No newline at end of file diff --git a/Voot Capture/icon128.png b/Voot Capture/icon128.png deleted file mode 100644 index b5a5f58..0000000 Binary files a/Voot Capture/icon128.png and /dev/null differ diff --git a/Voot Capture/manifest.json b/Voot Capture/manifest.json deleted file mode 100644 index c23bc23..0000000 --- a/Voot Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Voot Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "3.0" -} \ No newline at end of file diff --git a/Zee5 Capture/icon128.png b/Zee5 Capture.zip similarity index 86% rename from Zee5 Capture/icon128.png rename to Zee5 Capture.zip index cab9c35..3b1c822 100644 Binary files a/Zee5 Capture/icon128.png and b/Zee5 Capture.zip differ diff --git a/Zee5 Capture/background.js b/Zee5 Capture/background.js deleted file mode 100644 index 030d9cb..0000000 --- a/Zee5 Capture/background.js +++ /dev/null @@ -1,102 +0,0 @@ -const tabIDs = {}; -const textDecoder = new TextDecoder(); - -function requestToClipboard(tabId) { - chrome.tabs.get(tabId, (details) => { - const req_headers = tabIDs[details.id].playback_request[0]?.playback_headers; - const req_url = tabIDs[details.id].playback_url; - const req_data_json = tabIDs[details.id].playback_data; - if (!req_headers) - return; - - // Fetching the user's ip for setting the header x-forwarded-for. - // This might help to bypass regional restrictions when performing the playback request in some cases. - - const ip_retrieve_link = "https://ipinfo.io/ip"; - - var get_ip = new XMLHttpRequest(); - get_ip.open('GET', ip_retrieve_link, true); - get_ip.onload = function () { - var ip_resposnse = this.responseText; - console.log(ip_resposnse); - - var i = 0; - let curl_playback_data = "curl "; - curl_playback_data += `'${req_url}' \\`; - for (; i < req_headers.length; ++i) - curl_playback_data += `\n -H '${req_headers[i].name.toLowerCase()}: ${req_headers[i].value}' \\`; - curl_playback_data += `\n -H 'x-forwarded-for: ${ip_resposnse}' \\`; - curl_playback_data += "\n --data-raw "; - curl_playback_data += `'${req_data_json}' \\`; - curl_playback_data += "\n --compressed"; - - // Generating the curl license text link for https://t.me/drm_downloader_robot - const zee5_gen_link = "https://drm-bot.herokuapp.com/zee5.php"; - var data = new FormData(); - data.append('playlist', curl_playback_data); - data.append('api', 'api'); - - var gen_link = new XMLHttpRequest(); - gen_link.open('POST', zee5_gen_link, true); - gen_link.onload = function () { - var gen_link_resposnse = this.responseText; - let json_resp = JSON.parse(gen_link_resposnse); - console.log(json_resp); - let generated_playback_link = json_resp.data; - - const final = `${generated_playback_link}`; - console.log(final); - - const copyText = document.createElement("textarea"); - copyText.style.position = "absolute"; - copyText.style.left = "-5454px"; - copyText.style.top = "-5454px"; - copyText.style.opacity = 0; - document.body.appendChild(copyText); - copyText.value = final; - copyText.select(); - document.execCommand("copy"); - document.body.removeChild(copyText); - - chrome.browserAction.setBadgeBackgroundColor({color: "#FF0000", tabId: details.id}); - chrome.browserAction.setBadgeText({text: "📋", tabId: details.id}); - console.log("The required zee5 link's data has been copied to your clipboard successfully!\n\nNow go to https://t.me/drm_downloader_robot and paste it and send it to the bot."); - - } - gen_link.send(data); - } - get_ip.send(); - }); -} - -function getPlaybackRequestData(details) { - tabIDs[details.tabId] = tabIDs[details.tabId] || {}; - if (details.requestBody && details.requestBody.raw && details.method == "POST") { - for (var j = 0; j < details.requestBody.raw.length; ++j) { - try { - const decodedString = textDecoder.decode(details.requestBody.raw[j].bytes); - tabIDs[details.tabId] = {playback_data: decodedString, playback_request: [], playback_url: details.url, req_id: details.requestId}; - } catch (e) { - console.error(e); - } - } - } -} -chrome.webRequest.onBeforeRequest.addListener( - getPlaybackRequestData, - { urls: ["https://spapi.zee5.com/singlePlayback/getDetails/*"], types: ["xmlhttprequest"] }, - ["requestBody"] -); - -function getPlaybackRequestHeaders(details) { - if (details.method == "POST" && tabIDs[details.tabId] && tabIDs[details.tabId].playback_url === details.url && tabIDs[details.tabId].req_id === details.requestId) { - console.log(details.url); - tabIDs[details.tabId].playback_request.push({playback_headers: details.requestHeaders}); - requestToClipboard(details.tabId); - } -} -chrome.webRequest.onSendHeaders.addListener( - getPlaybackRequestHeaders, - { urls: ["https://spapi.zee5.com/singlePlayback/getDetails/*"], types: ["xmlhttprequest"] }, - ["requestHeaders"] -); \ No newline at end of file diff --git a/Zee5 Capture/manifest.json b/Zee5 Capture/manifest.json deleted file mode 100644 index 0160169..0000000 --- a/Zee5 Capture/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "background": { - "persistent": true, - "scripts": [ "background.js" ] - }, - "manifest_version": 2, - "name": "Zee5 Capture", - "browser_action": {"default_icon": "icon128.png"}, - "permissions": [ "activeTab", "webRequest", "*://*/*", "tabs", "clipboardWrite", "storage" ], - "version": "3.0" -} \ No newline at end of file