ceterumcenseo icon

Extract Video URL JS (simple)

ceterumcenseo | PRO | 05/14/24 07:54:28 PM UTC (Edited) | 0 ⭐ | 1899 👁️ | Never ⏰ | []
JavaScript |

590 B

|

None

|

0 👍

/

0 👎

// Ensure the video you want to download is playing before you copy this script into the
// developer tools console of the browser and hit the return key. It will extract the raw
// video URL on websites that use no advanced techniques. If you get an URL that starts
// with 'blob:' you are out of luck. When multiple videos are present, this code will
// choose the one with the largest canvas.
 
let videos = Array.from(document.querySelectorAll('video'));
videos.sort((a,b) => -a.clientHeight*a.clientWidth+b.clientHeight*b.clientWidth);
console.log(videos.filter(v => !v.paused)?.[0]?.src);

Comments