From aee4b27b66b5043d2514046b904eb839f4edfd1f Mon Sep 17 00:00:00 2001 From: Jacopo Jannone Date: Mon, 24 May 2021 13:48:29 +0200 Subject: [PATCH] Support different authentication mode --- src/content.js | 9 +++++++-- src/manifest.json | 2 +- src/popup.js | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/content.js b/src/content.js index f591f38..5b087a3 100644 --- a/src/content.js +++ b/src/content.js @@ -1,12 +1,17 @@ -const REGEX = /^https?:\/\/(.+?)\.webex\.com\/(?:recordingservice|webappng)\/sites\/(.+?)\/.*([a-f0-9]{32})/g; +const REGEX = /^https?:\/\/(.+?)\.webex\.com\/(?:recordingservice|webappng)\/sites\/([^\/]+)\/.*?([a-f0-9]{32})(.*)/g; const MATCH = REGEX.exec(location.href); const SUBDOMAIN = MATCH[1]; const SITENAME = MATCH[2]; const RECORDING_ID = MATCH[3]; -const API_URL = `https://${SUBDOMAIN}.webex.com/webappng/api/v1/recordings/${RECORDING_ID}/stream?siteurl=${SITENAME}`; +const AUTH_PARAMS = MATCH[4]; +var API_URL = `https://${SUBDOMAIN}.webex.com/webappng/api/v1/recordings/${RECORDING_ID}/stream`; var PASSWORD; var API_RESPONSE = -1; +if (AUTH_PARAMS) { + API_URL += AUTH_PARAMS; +} + var observer = new MutationObserver(function(mutations) { if (document.getElementsByClassName('buttonRightContainer').length) { // wait for this diff --git a/src/manifest.json b/src/manifest.json index 13d8970..2c2dc41 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "description": "Enables downloading of Webex meeting recordings", - "version": "1.2", + "version": "1.2.1", "permissions": [ "storage", "tabs", diff --git a/src/popup.js b/src/popup.js index e4a2e4b..e939a76 100644 --- a/src/popup.js +++ b/src/popup.js @@ -1,4 +1,4 @@ -const REGEX = /^https?:\/\/(.+?)\.webex\.com\/(?:recordingservice|webappng)\/sites\/(.+?)\/.*([a-f0-9]{32})/g; +const REGEX = /^https?:\/\/(.+?)\.webex\.com\/(?:recordingservice|webappng)\/sites\/([^\/]+)\/.*?([a-f0-9]{32})/g; function copyLink() { let text = document.getElementById("content");