Skip to content

Instantly share code, notes, and snippets.

@composite
Created February 20, 2026 07:16
Show Gist options
  • Select an option

  • Save composite/6843055c0b5f907879bf52a49a48b4b1 to your computer and use it in GitHub Desktop.

Select an option

Save composite/6843055c0b5f907879bf52a49a48b4b1 to your computer and use it in GitHub Desktop.
Grab all videos bookmarklet

Grab all videos URL Bookmarklet

Source

[...new Set(Array.from(document.querySelectorAll('video,source')).map(s=>s.src))].forEach((s,i)=>s&&prompt(`Video ${i+1} URL (Copy to clipboard yourself):`,s))

Add to bookmark yourself

  1. Add bookmark this page
  2. Edit added bookmark in browser's bookmark manager
  3. Edit bookmark name you desired, and edit URL to below:
javascript:(function()%7B%5B...new%20Set(Array.from(document.querySelectorAll(%27video%2Csource%27)).map(s%3D%3Es.src))%5D.forEach((s%2Ci)%3D%3Es%26%26prompt(%60Video%20%24%7Bi%2B1%7D%20URL%20(Copy%20to%20clipboard%20yourself)%3A%60%2Cs))%7D)()
  1. Done. when you run the bookmarklet on the site where the video was found, it will display prompts for you equal to the number of videos.

Limitations

It doesn't grab non-video elements. The bookmarklet is just simply grabbing src attributes in <video> and <source> tags.

If you want rich and easy grabbing URL feature for download, consider using any video downloader extension on your browser.

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