Home > database >  Get vk.com video "hash" value
Get vk.com video "hash" value

Time:09-09

I want to get vk.com embed video link. So far, I can only get part of it.

"oid" and "id" are easy to get from API but i can't seem to figure out a method to get the "hash" value.

Embed link:

https://vk.com/video_ext.php?oid=-31038184&id=456242753&hash=d79895b5c0835fc7

Direct link:

https://vk.com/video-31038184_456242753

I don't know how the Hash is generated and by which method I can get it since I can't find documentation about it in the API for videos.

CodePudding user response:

Use video.get API method. Hash will be present in response.items[0].player

Example request:

https://api.vk.com/method/video.get?owner_id=-31038184&videos=-31038184_456242753&v=5.131&access_token=...

Documentation here

CodePudding user response:

:D :D :D

<?php

$vk='https://vk.com/video-31038184_456242753';

$ld=implode('',file($vk));


if($start=strpos($ld,'"hash":"')){
    $stop=strpos($ld,'"',$start 8);
}
echo $start,'  ', $stop ,'  ';
echo 'your hash is # :'.substr($ld,$start 8,$stop-$start-8).' ! :D ';

?>
  • Related