Last active
October 21, 2022 19:59
-
-
Save acafourek/b1d67ea21d30c88d7155d21e3ef3fbfd to your computer and use it in GitHub Desktop.
Create download link for Zoom Cloud Recordings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created to download Zoom Cloud recordings that do not have downloads enabled | |
* Intended to be used as a bookmarklet - fetches embedded player video source and makes it available as a link to download. | |
* July 2022 | |
**/ | |
(function(){ | |
//get all <video> tags from the page -- this will return an HTMLCollection, NOT an Array | |
let videos = document.getElementsByTagName('video'); | |
//if we found videos and have more than 0 | |
if (typeof videos == "object" && videos.length > 0) { | |
let vidSrc = videos[0].src; | |
//if vidSrc is defined and not empty | |
if (typeof vidSrc == "string" && vidSrc.length > 0) { | |
console.log('Zoom video found: '+vidSrc); | |
//if the video is a cloud recording or a cloud recording with a download link | |
if(vidSrc.includes("zoom.us/replay") || vidSrc.includes("zoom.us/recording")) { | |
//Create download link element | |
const anchor = document.createElement("a"); | |
anchor.href = vidSrc; | |
anchor.id = "zoom-download-link"; | |
anchor.setAttribute('class', 'zm-button'); | |
anchor.style= "background-color:#0e71eb; color: white; margin: 20px;"; | |
anchor.textContent = 'Right click and select "Save Link As" to download recording'; | |
//add anchor link to the page | |
document.body.prepend(anchor); | |
} else { | |
console.log('No Zoom Cloud Recording found'); | |
} | |
} else { | |
console.log('No Zoom video source found.'); | |
} | |
} else { | |
console.log('No videos found'); | |
} | |
})(); | |
//Minified version for use in a bookmarklet: | |
javascript:(function(){let videos=document.getElementsByTagName('video');if(typeof videos=="object"&&videos.length>0){let vidSrc=videos[0].src;if(typeof vidSrc=="string"&&vidSrc.length>0){console.log('Zoom video found: '+vidSrc);if(vidSrc.includes("zoom.us/replay")||vidSrc.includes("zoom.us/recording")){const anchor=document.createElement("a");anchor.href=vidSrc;anchor.id="zoom-download-link";anchor.setAttribute('class','zm-button');anchor.style="background-color:#0e71eb; color: white; margin: 20px;";anchor.textContent='Right click and select "Save Link As" to download recording';document.body.prepend(anchor)}else{console.log('No Zoom Cloud Recording found')}}else{console.log('No Zoom video source found.')}}else{console.log('No videos found')}})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment