Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Created September 23, 2021 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrichardsz/ac10c16773a11cd8d02eed40bc4cb2bb to your computer and use it in GitHub Desktop.
Save jrichardsz/ac10c16773a11cd8d02eed40bc4cb2bb to your computer and use it in GitHub Desktop.
youtube screen
  • just create a book mark with this url
  • play the video and stop it
  • click in the bookmark
javascript:"use strict";!function(window,document){var canvas=document.createElement("canvas"),video=document.querySelector("video"),ctx=canvas.getContext("2d");canvas.width=parseInt(video.offsetWidth),canvas.height=parseInt(video.offsetHeight),ctx.drawImage(video,0,0,canvas.width,canvas.height);var base64ImageData=canvas.toDataURL("image/jpeg"),filename="snap-"+canvas.width+"x"+canvas.height+"-"+video.currentTime+".jpg",a=document.createElement("a");a.download=filename,a.href=base64ImageData;var img=document.createElement("img");img.src=base64ImageData,img.alt=filename,img.title="Click to save "+filename,window.open().document.body.appendChild(a).appendChild(img)}(window,document);

https://github.com/ReeganExE/youtube-screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment