grab XMLHttpRequest ? vk.com videos
#1
for few days i try ro understand vk.com videos direkt link..this page use XMLHttpRequest for real video and i dont know how to locate and capture that.
any body knows has knowlage about XMLHttpRequest and python...??

there is 2 request first response canlcel for a while second get the video but page adress dont change and page dont refresh...
until this week i can watch that movie with that code:
Code:
scan=re.compile('video_host = \'(.*?)/\';\nvar video_uid = \'(.*?)\';\nvar video_vtag = \'(.*?)\'').findall(link)
        for a,b,c in scan:
                print (a,b,c)
                videoLink=a +'/u'+ b +'/video/' + c + '.360.mp4'
                xbmctools.addVideoLink(videoTitle+' Part '+str(i),videoLink,'')

Image
Reply
#2
Somewhere in the source of the page should be a link. Once you have that link, you just call urllib2.open() on it. Search the page for the text you're seeing in the Name column in Chrome
Reply
#3
(2012-09-16, 22:10)Bstrdsmkr Wrote: Somewhere in the source of the page should be a link. Once you have that link, you just call urllib2.open() on it. Search the page for the text you're seeing in the Name column in Chrome

Thanks for answer i can use urllib urllib2 mechanize beautiful soup ant many modules. But there is no link in that page html code , there is only one link is same url with page and u can see the bottom on picture there is XHR Request which i couldnt handle....
Reply
#4
Usually the server will give a different respond for XHR, which means you have to send XHR to get the XHR version. What was the question again?
Reply
#5
this is sample link
Code:
http://cs509522.userapi.com/u175995076/video/7c8453b781.360.mp4

it makes 3 request with get

this is the first one
--------------------------------------------------------------------------------------------------------------------------------------------
Request URL:http://cs509522.userapi.com/u175995076/video/7c8453b781.360.mp4
Request Method:GET
Status Code:206 Partial Content
Request Headersview parsed
GET /u175995076/video/7c8453b781.360.mp4 HTTP/1.1
Host: cs509522.userapi.com
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-9,utf-8;q=0.7,*;q=0.3
Range: bytes=9871-9871
If-Range: Wed, 27 Jun 2012 17:05:18 GMT
Response Headersview source
Cache-Control:max-age=1468800
Connection:keep-alive
Content-Length:1
Content-Range:bytes 9871-9871/378782596
Content-Type:video/mp4
Date:Mon, 24 Sep 2012 20:52:40 GMT
Expires:Thu, 11 Oct 2012 20:52:40 GMT
Last-Modified:Wed, 27 Jun 2012 17:05:18 GMT
Server:nginx/1.2.1
-------------------------------------------------------------
and response is "canceled"

2 request is empty

3 request is exactly same the first one
-----------------------------------------------------------------
Request URL:http://cs509522.userapi.com/u175995076/video/7c8453b781.360.mp4
Request Method:GET
Status Code:206 Partial Content (from cache)

----------------------------------------------------------------------
there is no response but for 30 sec later video starts to play on browser but no luck with xbmc

please help me on vk.com videos many of turkish web site use this host and i need to solve for turkish xbmc fun & followers.....
Reply
#6
@drascom,
As you know you can use vk.com links in below format and it doesn't change plays the videos vithout any problem.

http://vk.com/video_ext.php?oid=18215905...644f16c99a
Reply

Logout Mark Read Team Forum Stats Members Help
grab XMLHttpRequest ? vk.com videos0