Download Panopto Playlist Videos Bookmarklet

I always thought bookmarklets were cool. I still think they are cool. I like the idea of little tiny tools that live in a place reserved for something else entirely. Alan has 89 posts mentioning bookmarklets. That’s also a clue that they’re interesting.

What drove this was that Panopto removing the RSS feed option in their newest version. Our people used it as part of a bulk download process to get the videos out for captioning or something like that. I don’t really know the details but it is apparently a hassle to get the videos one by one.

I looked around a bit at the Panopto API but I always get annoyed by having to deal with oauth if the information is public. I’ll probably go back to this later as the bookmarklet is more than bit awkward to explain.

This does rely on you being logged in and the videos being set to allow downloads.

The pattern here is that there is a table with a particular class (session-list). Each row of that table (that we want) has a data attribute containing the session ID of the video. That session ID can be added to a URL pattern to get the download. And the little window.open function opens the download URL.

var tableRows = document.querySelector('.session-list').querySelectorAll('tr');//get the table then the rows all togeterh
tableRows.forEach((row) => {if(row.dataset){
	var dlUrl = 'https://midd.hosted.panopto.com/Panopto/Podcast/Download/'+row.dataset.id+'.mp4?mediaTargetType=videoPodcast';
window.open(dlUrl); //opens each url
	}
})

To make it work as a bookmarklet you have to wrap and remove all the line breaks etc. like so.

Nothing fancy but a marginally acceptable stop-gap until I can do something better.