Skip to content

Commit

Permalink
Version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacopo Jannone committed Sep 16, 2020
1 parent 7178363 commit 995c44c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 53 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WebXDownloader

This is a browser extension that helps downloading Webex meeting recordings. It provides the direct URL to the HSL stream and the `ffmpeg` command needed in order to download the stream and convert it into an mp4 video file.
This is a browser extension that helps downloading Webex meeting recordings. It adds a button to the video playback controls that enables downloading of the recording in mp4 format. It also provides the direct URL to the HSL stream and allows the chat transcript to be saved in JSON or plain text format.

![demo](demo.gif)

Expand All @@ -21,8 +21,4 @@ Download the `.xpi` file from the [latest release](https://github.com/jacopo-j/W

## Usage

Just browse to the meeting recording page and launch the extension.

In order to convert the video stream into an mp4 file, select "Full ffmpeg command" and copy-paste the output into your terminal. Of course you'll need to have [ffmpeg](https://ffmpeg.org) installed.

> :warning: **Friendly reminder**: always mind what you paste into your terminal. While some basic escaping was put in place, you should double check that everything looks fine before running.
Just browse to the meeting recording page and you will find a download button on the right side of the playback control bar. If you want to copy the HLS stream URL or download the chat transcript, launch the extension from your browser.
Binary file modified demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ var observer = new MutationObserver(function(mutations) {
i.addEventListener("click", function() {
window.location = mp4Url;
})
})
.catch(exception => {
console.log("Error")
});
})
.catch(exception => {
console.log("Error")
});

})
.catch(exception => {
console.log("Error")
});
})
.catch(exception => {
console.log("Error")
});
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
"name": "WebXDownloader",
"manifest_version": 2,
"version": "1.0.1",
"version": "1.1",
"description": "Extracts the HLS stream of Webex meeting recordings",
"browser_action": {
"default_icon": "icon.png",
Expand Down
14 changes: 6 additions & 8 deletions src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
.fail {
background-color: rgb(248, 201, 201);
}

#chat {
margin-top: 0.5em;
}
</style>
</head>
<body>
Expand All @@ -61,16 +65,10 @@
<div id="success" style="display: none;">
<div class="title">Success!</div>
<br>
<div class="subtitle">Output format:</div>
<input checked name="format" type="radio" id="hls-opt"></input>
<label for="hls-opt">Plain HLS stream URL</label>
<br>
<input name="format" type="radio" id="ffmpeg-opt"></input>
<label for="ffmpeg-opt">Full <code>ffmpeg</code> command</label>
<br><br>
<div class="subtitle">HLS stream URL:</div>
<textarea id="content" disabled></textarea>
<input id="copy" type="button" value="Copy to clipboard" />
<br><br><br>
<br><br>
<div id="chat" style="display: none;">
<div class="subtitle">Chat transcript:</div>
<input checked name="chat" type="radio" id="chat-opt"></input>
Expand Down
29 changes: 0 additions & 29 deletions src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,6 @@ function copyLink() {
text.disabled = true;
}

function sanitizeShellArg(arg) {
/*
* IMPORTANT! This is NOT a safe way to sanitize shell arguments and
* should never be used for directly running commands in a shell.
*
* In this case we are just providing users with a command that they
* should copy and manually run in their terminal. Thus, we are only
* trying to prevent commands from accidentally breaking in case
* they contain any special character.
*
* Users should always double check what they paste into their
* terminal.
*/
let sanitized = arg.replace(/([$`\\!"])/g, '\\$1');
return `"${sanitized}"`;
}

function updateContent() {
let content = document.getElementById("content");
if (document.getElementById("hls-opt").checked) {
content.innerText = content.dataset.content;
} else if (document.getElementById("ffmpeg-opt").checked) {
let title = document.getElementById("content").dataset.title + ".mp4";
content.innerText = `ffmpeg -i '${content.dataset.content}' -c copy ${sanitizeShellArg(title)}`;
}
}

function downloadChat() {
let download = document.getElementById("download");
let link = document.createElement("a");
Expand Down Expand Up @@ -64,8 +37,6 @@ function renderSuccess(title, url, chat) {
document.getElementById("content").dataset.content = url;
document.getElementById("content").dataset.title = title;
document.getElementById("copy").onclick = copyLink;
document.getElementById("hls-opt").onclick = updateContent;
document.getElementById("ffmpeg-opt").onclick = updateContent;
if (chat.length > 0) {
document.getElementById("chat").style.display = "block";
document.getElementById("download").dataset.content = JSON.stringify(chat);
Expand Down

0 comments on commit 995c44c

Please sign in to comment.