Skip to content

Instantly share code, notes, and snippets.

@vladislav805
Created August 23, 2017 16:53
Show Gist options
  • Save vladislav805/87063e0ae9c779e9471f21dd3cab14d3 to your computer and use it in GitHub Desktop.
Save vladislav805/87063e0ae9c779e9471f21dd3cab14d3 to your computer and use it in GitHub Desktop.
#!/bin/bash
TOKEN="..."
echo "Enter URL to video (in format OID_VID)"
read vkUrl
#vkUrl="203384908_456239021"
hls=$(wget -qO - "https://api.vk.com/method/video.get?videos=$vkUrl&access_token=$TOKEN&v=5.56" | grep -iowE "hls\"\:\"http[^\"]*\"" | grep -iowE "http.[^\"]*" | sed 's!\\/!/!g')
res=$(wget -qO - "$hls" | grep -iowE "https:.*")
for i in $res; do
echo $i;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment