Page 1 of 1

vk.com

PostPosted: Mon Jul 09, 2012 1:00 pm
by casper
Would be great to have a plugin for video / audio from vk.com

Re: vk.com

PostPosted: Tue Dec 25, 2012 10:11 pm
by neckro
no vk plugin yet ?

Re: vk.com

PostPosted: Fri Dec 28, 2012 12:01 pm
by neckro
I`m not a programmer but i have found something that may help one:

  Code:

Does anybody knows how to get url to video file from this url:

http://vk.com/video_ext.php?oid=6492&id=141771975&hash=a984f2edb68fc4f7



  Code:
Use an HTTP traffic sniffer/proxy to see what files get loaded by the page. Many browsers have it built into their developer tools (e.g. the net tab in Firebug), but I prefer to use Charles which has many other useful features for web developers.

Using Charles, I can see that the file that is loaded when I click play is http://cs12326.vk.com/u06492/video/ab94044f46.flv, which is an FLV file.

EDIT: If you want to do this programmatically, you might be out of luck because only the video player (implemented in Flash) knows from which URL to retrieve the video file. You could reverse-engineer it for this particular website (see below) but it will obviously only work for videos on vk.com, and perhaps not even all videos on vk.com.

Looking at the HTML I can see that there are four seemingly important javascript variables being defined:

var video_host = 'http://cs12326.vk.com/';
var video_uid = '06492';
var video_vtag = 'ab94044f46';
var video_no_flv = 0;
These values can be found in the video URL, so it's safe to assume that by parsing the HTML text for these variable definitions, and using the values to compile a URL, you can be able to find the file.

I'm assuming that the video_no_flv variable that is defined in the same piece of code indicates whether the video is an FLV file or not. In this page it's set to 0, so I'm assuming that means that it is an FLV file. That would mean that by searching through the HTML text string for the sub-string video_no_flv and parsing the integer after the next subsequent = will tell you whether the video file is an FLV file or not.

If it isn't, it's safe to assume that it's a MP4/F4V (both of which are different suffixes for the same type of MPEG-4 H.264 file) and that you should be able to play it on your iPhone. If that's the case, you should be able to compile the URL from the pieces mentioned above and load it.

//Pseudo-code
url = video_host + video_uid + "/video/" + video_vtag + ".m4v"
To assess whether this will really work, you will need to investigate a larger collection of videos on that site.

Also, note that to implement knowledge that you have gained through this type of reverse engineering, and to display the videos outside of the context in which they have been published, might break that website's terms of service and could be an act of felony.

Re: vk.com

PostPosted: Fri Dec 28, 2012 1:54 pm
by neckro
I have found also http://code.google.com/p/getvk/ but is not working anymore. Some coders might found this usefully.

Re: vk.com

PostPosted: Sun Jan 13, 2013 2:43 pm
by vsn
Hi,

Really great idea. I indeed wish to have such a plugin for my favourite serviio DLNA server. They have a really huge collections of video and audio.

BR,

vsn

Re: vk.com

PostPosted: Fri May 24, 2013 7:51 pm
by neckro
no vk plugin yet ?

Re: vk.com

PostPosted: Fri Nov 28, 2014 4:34 pm
by commandercool
A plugin to watch video content from vk.com is now avaiable. See thread: viewtopic.php?f=20&t=17947