Get Youku Video Download link (Wireshark capture analysis)

Source: Internet
Author: User

Just a couple of words.

The previous two days to write a Python script, trying to analyze the source of the Web page to get Youku video, the results only get the video of the Pure play address, download the pure play address to get the file also can not play the video properly.

Here's a way to share the playback address (you can expand the folding if you want to see it):

#Experimental video address: http://v.youku.com/v_show/id_XMTY3OTYyODM2NA==.html?f=27873045&from=y1.2-3.2#Parse to play address: http://static.youku.com/v1.0.0646/v/swf/loader.swf? videoids=xmty3otyyodm2na==&showid=0&category=98&cp=0&light=on&thx=off&uncookie=0& frame=0&pvid=1470928536391fwghzj&uepflag=0&tid=0&isautoplay=true&version=/v1.0.159& show_ce=0&wintype=interior&type=folder&fid=27873045&pt=1&ob=1&plchid=&playmode=2 &embedid=ajqxotkwnza5mqj2lnlvdwt1lmnvbqivdl9zag93l2lkx1hnvfkzt1rjmu5qqtrnqt09lmh0bww=&ysuid= 1470556998734i3t&vext=bc%3d%26pid%3d1470928536391fwghzj%26uncookie%3d0%26frame%3d0%26type%3d1%26fob%3d1% 26fpo%3d1%26svt%3d0%26cna%3dpcwtek7f7lucaxdtly6srtly%26emb% 3dajqxotkwnza5mqj2lnlvdwt1lmnvbqivdl9zag93l2lkx1hnvfkzt1rjmu5qqtrnqt09lmh0bww%3d%26dn%3d%e7%bd%91%e9%a1%b5% 26hwc%3d1%26mtype%3doth&cna=pcwtek7f7lucaxdtly6srtly&pagestarttime=0#but it's not, Khan.#parsing method:#<div class= "Player" id= "Player" ... <object type= "Application/x-shockwave-flash"#data= "(. *?)" ... id= "Movie_player";#<param name= "Flashvars" value= "(. *?)" A..#regular extraction of items, (. *?) To extract objects, stored in items#items[0] = ' http://static.youku.com/v1.0.0646/v/swf/loader.swf '#items[1] = ' videoids=xmty3otyyodm2na==&showid=0&category=98&cp=0&light=on&thx=off& uncookie=0&frame=0&pvid=1470928536391fwghzj&uepflag=0&tid=0&isautoplay=true&version=/ V1.0.159&show_ce=0&wintype=interior&type=folder&fid=27873045&pt=1&ob=1&plchid= &playmode=2&embedid=AjQxOTkwNzA5MQJ2LnlvdWt1LmNvbQIvdl9zaG93L2lkX1hNVFkzT1RjMU5qQTRNQT09Lmh0bWw=& ysuid=1470556998734i3t&vext=bc%3d%26pid%3d1470928536391fwghzj%26uncookie%3d0%26frame%3d0%26type%3d1%26fob% 3d1%26fpo%3d1%26svt%3d0%26cna%3dpcwtek7f7lucaxdtly6srtly%26emb% 3dajqxotkwnza5mqj2lnlvdwt1lmnvbqivdl9zag93l2lkx1hnvfkzt1rjmu5qqtrnqt09lmh0bww%3d%26dn%3d%e7%bd%91%e9%a1%b5% 26hwc%3d1%26mtype%3doth&cna=pcwtek7f7lucaxdtly6srtly&pagestarttime=0 '#URL = items[0] + '? ' + items[1]#The URL is the play address
View Code

Today, when studying hotlinking, I thought I could find the download link of the video directly in the package that Youku returned.

Pondering for a second, the heart felt that this method should be feasible, and then open the grab bag artifact Wireshark.

At the same time, click on the Youku homepage to open a video and let it start playing. Wireshark soon appeared a lot of packages, I added the filter condition "http", let it crawl only the HTTP protocol related packets.

The focus is on the package that starts with GET in info, because the package is the easiest to analyze, and the download links for audio and video images are often included in the application layer of these packages.

For example, a picture of a logo is obtained.

I'm looking for links to video-related packages, and I've probably found two of them:

These two links are available to play, but not all of them. And I have opened a lot of links, can play the basic is advertising ...

Then I /youku the beginning of the key analysis, don't ask me why, the man's intuition =_=

After the link is copied, try to download the Thunder, the results found that the file is very small, and can not be played after downloading.

Similar links have many segments, they download the same file name, but the size is different, and can not be played after a separate download. I guess this is the relationship of the TCP protocol chunked transfer.

At this point I found that there were some parameters behind the link, so I pasted the whole link into Notepad and then deleted the parameter part.

Get a new link, copy it into the Thunderbolt, find that it can be downloaded, and the size is not the same as before.

I guess this video should be playable, sure enough, after the download it will be able to play smoothly, and it is the video I play in the web.

Here basically can be sure this method is to get Youku video download link, but there is a little problem, with the link we get to download the video only 6 minutes, and the original video has 26 minutes, it is conceivable that the downloaded video should be part of the full video. But I think the other part of the link is in the Wireshark, the same way to analyze the package can be other parts of the link. I'm not going to experiment here.

Summarize

The way to get the download link of Youku video is to use the Wireshark software to grab the packet, capture the packet transmitted in the network and analyze it, get the address of the requested video directly and then download it.

freecode#: www.cnblogs.com/yym2013

Get Youku Video Download link (Wireshark capture analysis)

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.