How to capture original Tudou video files-principle implementation

Source: Internet
Author: User
Tags flv file
How to capture original Tudou video files
I used to think that HTML code is directly used to capture FLV or SWF files, but I found that potatoes could not be found, and I was depressed and did not know how to handle them. Today I finally found the principle to implement these captures, it seems that we have to study the HTTP protocol.

Video files such as Tudou cannot be directly captured by thunder, because they use flash FLV file format, and only a personalized flvplayer is captured by thunder. The opinion of icekernel is that there is obviously a better way to view the IE cache. The following describes the typical sequence of data packets: http://www.toodou.com/v/kv5fnawe4ry.

1. Get/V/kv5fnawe4ry, location
Bytes ---------------------------------------------------------------------------------------------------------------------
GET/V/kv5fnawe4ry HTTP/1.1
Accept: image/GIF, image/X-xbitmap, image/JPEG, image/pjpeg, application/vnd. MS-Excel, application/vnd. MS-PowerPoint, application/MSWord, application/X-Shockwave-flash ,*/*
Accept-language: ZH-CN
Accept-encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; sv1;. Net CLR 2.0.50727; infopath.1)
HOST: www.toodou.com
Connection: keep-alive

* **************************** Response: ************************
HTTP/1.1 302 found
Date: Wed, 16 Aug 2006 05:40:12 GMT
Server: Apache/2.2.2 (UNIX) Dav/2 PHP/4.4.2
X-powered-by: PHP/4.4.2
Set-COOKIE: toodou = 0fa1a1ba1262236ed123f0074095aaa9; Path =/; domain = .toodou.com
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-control: Private
Pragma: No-Cache
Location: http://www.toodou.com/player/player.swf? IID = 2119336
Content-Length: 0
Keep-alive: timeout = 300, max = 9858
Connection: keep-alive
Content-Type: text/html


2. Get/player/player.swf? IID = 2119336, download FLV player.
Bytes ---------------------------------------------------------------------------------------------------------------------
GET/player/player.swf? IID = 2119336 HTTP/1.1
Accept: image/GIF, image/X-xbitmap, image/JPEG, image/pjpeg, application/vnd. MS-Excel, application/vnd. MS-PowerPoint, application/MSWord, application/X-Shockwave-flash ,*/*
Accept-language: ZH-CN
Accept-encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; sv1;. Net CLR 2.0.50727; infopath.1)
HOST: www.toodou.com
Connection: keep-alive
If-modified-since: Thu, 10 Aug 2006 06:15:07 GMT
If-None-Match: "591369-6cd7-bfd150c0"
COOKIE: toodou = 0fa1a1ba1262236ed123f0074095aaa9

* **************************** Response: ************************
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 05:40:35 GMT
Server: Apache/2.2.2 (UNIX) Dav/2 PHP/4.4.2
Last-modified: Thu, 10 Aug 2006 06:15:07 GMT
Etag: "62d0e3-6cd7-bfd150c0"
Accept-ranges: bytes
Content-Length: 27863
Keep-alive: timeout = 300, max = 9947
Connection: keep-alive
Content-Type: Application/X-Shockwave-flash

CWS... X... xsi.0

.!... EC (CC... N3.. BC..., n4s... r8.f "... zp8.. x} N. S ?.... G3b... 0 .... h. JF. *. {s8... i. '.. '... l .... d. <... Y .... +. D .. kg .. 7X.>... a. w. OQ .. k.4 .. z. lu .!...... ~ $. _. C> .....
.!. M22...... 'y @..
... Mij .. V .... Q .... 2. @... h. #.,.. % .. x. a.3... O :.. f. V .)........ H '.. 0... p. VQ !...... A .... f ......... H .. g... l .. k. a, 6 ..... a.91 .. lf. ct.].) #> 6. V .. +... + 0 /..... :.. B .. {... e. t ......... g ). * qt .. hz .. q.]... certificate % d "...... k. ". 2 .... k. :.... *.. %. d. "... S + .. T ...). p. i. V (.. 0 ...... q. ". 'd. X ...... *....... $ s .. invalid. R .... B .. (.. 7. + .. t]. d. D .;. R .. H .) V .. O .. AO ........... +. hu. d... fxy... XY .... $ .?... Y2 .. DUF... p .;. /U '. J ...... d. R ^ ....... K % .. $ ........ % W. em... S ..... v. /ch .. W .. &. r. Y {> T. /.... S (..... 4. _ pp. Z .. '{. v. (..... o.6.t ..,.... g.1b .. x. l ..... 5. J .. ESM... $. Q .... V '.. $... CC .. 4. ". G .... &! Lsvl. * n/T. *. S.. P. i0.m ......! H_..z.h... a... '. RB @...
...... I .. ...... [... BVB .. /.; D .. A .,.... = ...... 2 .... e. d] LME. +. /. 9i .. <6 .. '. /... eq .. X .. '. K ........ e. ~ C. @... V %... hn0 #... d. B ......
./N,... @ gr. p. L &..!. -V ..... qlf... -.. e. d, a2 ....... 0f. 7 +. 9d /... PS... H &#.) M ...... (X... (/. '. @.. S .... /$ ....... FS. '. B ...... P .... Z .. m. {:... e8.s. I .3.5.j (. R ....... Y .... $ p ......... e. j...
. Z... _ {... h % Eq .! #... P... u.
... DB./f
Z... 9. D.
. 1 *. H... f0n... e... F ......!. S. FG. #1] T ........ a... ua.8 .... W ...... da. <......... z... J ...... I


3. Submit the IID to/player/info. php to obtain the original FLV file address.
Bytes ---------------------------------------------------------------------------------------------------------------------
Post/player/info. php HTTP/1.1
Accept :*/*
Referer: http://www.toodou.com/player/player.swf? IID = 2119336
X-flash-version: 9, 0, 16, 0
Content-Type: Application/X-WWW-form-urlencoded
Content-Length: 48
Accept-encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; sv1;. Net CLR 2.0.50727; infopath.1)
HOST: www.toodou.com
Connection: keep-alive
Cache-control: No-Cache
COOKIE: toodou = 0fa1a1ba1262236ed123f0074095aaa9

Onload = % 5 btype % 20 function % 5d × = 0 & IID = 2119336

* **************************** Response: ************************
HTTP/1.1 200 OK
Date: Wed, 16 Aug 2006 05:40:35 GMT
Server: Apache/2.2.2 (UNIX) Dav/2 PHP/4.4.2
X-powered-by: PHP/4.4.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-control: Private
Pragma: No-Cache
Content-Length: 155
Keep-alive: timeout = 300, max = 9990
Connection: keep-alive
Content-Type: text/html

R = 1 & ipic = http://image.toodou.com/data/imgs/ I /002/119/336/w.jpg&insite=0&a=flv | http://player0.toodou.com/flv/002/119/336/2119336.flv | Vi | 146400 | 0 | 0 | 5729673


Obviously, you can capture the returned results of post/player/info. php requests. You can also simulate data packets sent to the server.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.