Easily download a video (lecture) for offline viewing, from stream.sfu.ca/Media/Play/*
javascript:const file=window.location.pathname.split("/")[3];fetch("https://stream.sfu.ca/Media/PlayerService/PlayerService.svc/json/GetPlayerOptions",{credentials:"include",headers:{"User-Agent":window.navigator.userAgent,Accept:"application/json, text/javascript, */*; q=0.01","Accept-Language":"en-US,en;q=0.5","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},referrer:window.location.toString(),body:JSON.stringify({getPlayerOptionsRequest:{ResourceId:file,QueryString:"",UseScreenReader:false,UrlReferrer:""}}),method:"POST",mode:"cors"}).then(response=>response.json()).then(function(data){for(const stream of data["d"]["Presentation"]["Streams"]){for(const url of stream["VideoUrls"]){if(url["MimeType"]!=null&&url["MimeType"].includes("x-mpegurl"))continue;if(url["Location"]!=null){window.open(url["Location"]);return}}}alert("Unable to find video URL.")}).catch(error=>{alert("Unable to find the video URL due to error.")});
- Copy the
Bookmarklet
- In your browser create a bookmark to the current page. Doen't matter what said page is.
- Edit the said bookmark's URL property/attribute, paste in the contents of the bookmarklet. 📌
- Replacing the original URL.
CTRL + d
,More..
, Pasting in theBookmarklet
- Replacing the original URL.
- Go to the lecture, click the title to view at the webpage that has the URL
stream.sfu.ca/Media/Play/*
, rather thancanvas.sfu.ca/courses/*/modules/items/*
. Note: if there is no title, the should be a button on the bottom right for a pop-up. Looks like a little box with a arrow pointing top-right - Click the
Bookmarklet
- Be sure to allow popups
- On the new tab, right-click, save-as, ... 🤯
- [optional] run something akin to
for i in *.mp4; do ffmpeg -i "$i" -vcodec libx265 -crf 30 "$i_compressed.mp4"; done
to useffmpeg
to compress for long term storage. See the docs for-crf 30
. see this site Enjoy 😇
Or the pop-out button on the bottom-right corner