[old article moved] a way to shield Youku video ads

Source: Internet
Author: User
Tags flv file

11 old article, sedate that plugin let me enjoy a long time, but later on to buy members. I have lost the code, but it doesn't matter, the idea is clear, I later tested on Chrome, the same can be used.

= = = Text = =

Demand: Youku recently engaged in an ad anti-blocking, resulting in the method of modifying the host can not be used. We need a new way to get around this anti-blocking mechanism.

Basic idea: The new version of Youku flv Player cannot download ads will strike 30 seconds, since the ads can not be blocked, then we replace the ad file, with a fake ad file for FLV player to play.

Realize:
First grab the bag, or use Fiddle2 intercept request, will find Youku ads is an flv file, and potatoes and Sina advertising is f4v file or SWF file (not commonly used to first don't care). We can find the features of the ad URL and replace it.
Specific replacement method, there are two options (such as the driver of the BT method I will not say):

    • The first is to write a pseudo-proxy service registered into the system, while using PAC script to automatically switch agents based on the URL, found that the ad URL to switch to the pseudo-agent we wrote, and the job of the pseudo-agent is to provide false advertising files.
    • The second approach is to use the browser plugin to intercept and replace requests. This is to be developed for different browsers, such as the Chrome extension is JS-based, and its interception request interface is called Experimental.webrequest, is an experimental api,google not recommended, and both Chrome and Firefox support Npapi, and IE's plug-in mechanism is COM-based. There is an open source project called Firebreath, which is a cross-browser and operating system browser plugin framework, is a good thing, but I have not used it before.

We first for the next Total browser experiment function can be realized, the author is for IE.
IE plugin is a notorious thing, but it is more convenient for developers, because it is more "free", you can use C + + to do anything. There are three types of IE plugins:

    • The first is the ancient ActiveX, which everyone must be familiar with. PS: Tell a joke, I have done a project before the company, request to provide CS and BS client. Our CS client is ready, and the BS client is CS client encapsulated into a huge ActiveX put into the Web page, and CS client is QT4 developed, you can imagine how big the ActiveX ...

    • The second kind called bho (Browser Helper Object), the same old technology, a lot of rogue plugins and disgusting toolbar is this thing, but Google's Chrome frame is also based on this thing, visible technology such as knife, the difference between people. BHO can allow you to embed the DLL into the IE process, blocking some IE operations, such as forward and backward, but too low-level, such as grasping the bag is certainly not.
    • the third kind of special, called Asynchronous pluggable protocols, this thing is also very common, it can allow you to intercept a protocol under the request, such as http://, Thunder interception thrunder://is the use of this technology. Asynchronous pluggable protocols can be permanently intercepted, need to write the registry, can also be temporarily intercepted in the process, call an API can, but only for this process is valid. This temporary interception is used by many ebook software and software that uses WebBrowser controls to create a gorgeous GUI.

I use the method is to write a bho embedded in the IE process, block IE navigate event, if the video site is interested in the asynchronous pluggable protocols intercept all HTTP requests, find the ad file request, with the false ad file replacement. The fake ad file is a short flv or SWF, bypassing the anti-blocking mechanism.

Results:
At present, just the basic function, can intercept Youku, potatoes, Sina and qi Yi video ads (other I do not how to use), and temporarily not for the external chain of video. Temporarily only support IE, the next step with Firebreath to do a generic version.

(False ad duration two seconds):


Problems that exist:
Youku player can play the fake ads normally, but neither potatoes nor Sina can, after receiving the file they will fail to play, then start the normal video playback. I specifically downloaded their own ad files as fake ads, or not. Maybe they used some kind of signature mechanism, which is still to be researched, fortunately they are not as anti-blocking as Youku, I temporarily intercepted their ads, now can be used normally.

Download: Touch Me

[old article moved] a way to shield Youku video ads

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.