Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vyach-vasiliev/3077333cc4bbc33def8b04d7678d1f78 to your computer and use it in GitHub Desktop.
Save vyach-vasiliev/3077333cc4bbc33def8b04d7678d1f78 to your computer and use it in GitHub Desktop.
Download video from post of VK (bookmarklet)

🔥 Download video from post of VK (bookmarklet)

How to install

It's really easy!

  1. Press ctrl+B (or cmd+B on Mac).
  2. Move this link Download video from VK to the bookmarks bar.
  3. Then, right click on the new bookmark, click Edit and paste the script contents above into the URL field.
  4. Now, open the page with the video and click on the new bookmark.
  5. Wait for the request to select the quality for downloading, enter it and press Enter.

✨ The download will start. Enjoy! ✨

image

Similar bookmarklets

javascript:
(/vk(video)?\.(ru|com)\/video-/.test(location.href) ? true : alert("Only available on VK video page."))
&& (videoId=location.pathname.split("video")[1])
&& fetch("/al_video.php?act=show", {
"headers": {"content-type": "application/x-www-form-urlencoded","x-requested-with": "XMLHttpRequest"},
"body": "al=1&autoplay=1&claim=&force_no_repeat=true&is_video_page=true&list=&module=direct&show_next=1&video="+videoId,
"method": "POST",
}).then(response=>response.json()).then(data=>
(params=data.payload[1][4].player.params[0])
&&(qs={url2160:[7,2160],url1440:[6,1440],url1080:[5,1080],url720:[3,720],url480:[2,480],url360:[1,360],url240:[0,240],url144:[4,144]})
&& (link_by_qt=Object.entries(params).filter(([key, val]) => key in qs).map(([name, url]) => ({ [qs[name][1]]: url })).sort((a, b) => Object.keys(b) - Object.keys(a)))
&& link_by_qt.map(m=>Object.entries(m).map(({qs, url})=>qs+"p"))
&& (ps="Select quality:\n" + link_by_qt.map(m=>Object.entries(m).map(([qs, url])=>link_by_qt.indexOf(m)+"-"+qs+"p")).join("\n"))
&& (answ=prompt(ps)) && link_by_qt[answ] && window.open(Object.values(link_by_qt[answ])[0], "_blank")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment