This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9139|Reply: 3

iQIYI Player Advertising Analysis

[Copy link]
Posted on 10/23/2014 10:26:53 PM | | | |

Recently, I have been busy with the start of school and it is suitable to toss blindly – in the past two days, Zero has been busy with videos to advertise, and it is said that advertisements are becoming more and more rampant, and some videos have been open for more than 60s. He removed Sohu, but iQiyi's has never been done. Let me help him take a look.

The source code was given to me by him, I don't have a swf decompiler.

Probably looking at the structure, I haven't learned ActionScript. He said it was similar to Java, so I didn't bother to look at the basic syntax, so I went straight to it. Let's take a look at the head of the main file Player.as to see what citations there are.

  1.     import com.iqiyi.components.global.*;
  2.     import com.iqiyi.components.tooltip.*;
  3.     import com.qiyi.player.base.pub.*;
  4.     import com.qiyi.player.base.uuid.*;
  5.     import com.qiyi.player.core.*;
  6.     import com.qiyi.player.core.model.def.*;
  7.     import com.qiyi.player.core.model.utils.*;
  8.     import com.qiyi.player.wonder.*;
  9.     import com.qiyi.player.wonder.body.view.*;
  10.     import com.qiyi.player.wonder.common.config.*;
  11.     import com.qiyi.player.wonder.common.lso.*;
  12.     import com.qiyi.player.wonder.common.pingback.*;
  13.     import com.qiyi.player.wonder.common.sw.*;
  14.     import flash.display.*;
  15.     import flash.events.*;
  16.     import flash.media.*;
  17.     import flash.system.*;
  18.     import flash.utils.*;
Copy code

Look at the name to know the meaning, com.qiyi.player.wonder.common.config.*; Catches my eye – take a look at the configuration information. The two documents FlashVarConfig.as and SystemConfig.as. SystemConfig.as didn't find anything noticeable, but the xml configuration file referenced in the FlashVarConfig.as is worth looking into.

  1. package com.qiyi.player.wonder.common.config
  2. {

  3.     public class FlashVarConfig extends Object
  4.     {
  5.         public static const OWNER_PAGE:String = "page";
  6.         public static const OWNER_CLIENT:String = "client";
  7.         public static const OS_XP:String = "xp";
  8.         public static const OS_WIN7:String = "win7";
  9.         public static const OS_WIN8:String = "win8";
  10.         public static const PAGE_OPEN_SRC_NONE:String = "0";
  11.         public static const PAGE_OPEN_SRC_DIRECT:String = "1";
  12.         public static const PAGE_OPEN_SRC_OTHER:String = "2";
  13.         private static var _flashVarSource:Object;
  14.         private static var _albumId:String = "";
  15.         private static var _tvid:String = "0";
  16.         private static var _vid:String = "";
  17.         private static var _autoPlay:Boolean = true;
  18.         private static var _isMemberMovie:Boolean = false;
  19.         private static var _cyclePlay:Boolean = false;
  20.         private static var _components:String = "fefff7e6";
  21.         private static var _cupId:String = "";
  22.         private static var _shareStartTime:int = -1;
  23.         private static var _shareEndTime:int = -1;
  24.         private static var _preloaderURL:String = "http://dispatcher.video.qiyi.com/dispn/player/preloader.swf";
  25.         private static var _preloaderVipURL:String = "";
  26.         private static var _exclusivePreloader:String = "";
  27.         private static var _useGPU:Boolean = true;
  28.         private static var _showBrand:Boolean = true;
  29.         private static var _expandState:Boolean = false;
  30.         private static var _tipDataURL:String = "http://static.qiyi.com/ext/tips/tipdata.xml";
  31.         private static var _coop:String = "";
  32.         private static var _owner:String = "page";
  33.         private static var _os:String = "win7";
  34.         private static var _adPlayerURL:String = "";
  35.         private static var _origin:String = "";
  36.         private static var _passportID:String = "";
  37.         private static var _playListID:String = "";
Copy code

In line 31, this configuration file has this passage. And the advertising address in line 35 also caught my attention, which I will analyze later. Let's look at the configuration file first.

  1. </item>
  2. <!-- 正在为您播放片中广告, 可选择是否要跳过, 类别是1, 持续时间是8秒 -->
  3. <!-- 限制条件是:  不是正在登录中的会员 -->
  4. <!-- 每天每人次只最多显示两次这个tips -->
  5. <item id="ToSelectWhetherToSkipPlayingMiddleAD" level="1" duration="-1" type="1">
  6. <conditions>
  7. <fields>
  8. <field name="member" operator="eq" value="false"/>
  9. </fields>
  10. <frequency count="2">
  11. <restrain name="day"/>
  12. <restrain name="user"/>
  13. </frequency>
  14. </conditions>
  15. <list>
  16. <message>
  17. <![CDATA[
  18. 正在为您播放片中广告, <a href="event:ASEvent(skipAD)"><b><u>跳过广告</u></b></a>
  19. ]]>
  20. </message>
  21. </list>
  22. </item>
  23. <!-- 提示即将跳过8秒后会显示的剧中广告, 类别是1, 持续时间是8秒 -->
  24. <!-- 必须是登录的会员 -->
  25. <item id="ToCancelSkipNextMiddleAD" level="1" duration="8" type="1">
  26. <conditions>
  27. <fields>
  28. <field name="member" operator="eq" value="true"/>
  29. </fields>
  30. <frequency count="1">
  31. <restrain name="day"/>
  32. <restrain name="user"/>
  33. </frequency>
  34. </conditions>
  35. <list>
  36. <message>
  37. <![CDATA[
  38. 即将为您跳过片中广告,<a href="event:ASEvent(cancelSkipAD)"><u>不再跳过</u></a>
  39. ]]>
  40. </message>
  41. </list>
  42. </item>
  43. <!--
  44. 提示版权下线, 如果还有小于7天的时间下线, 每天一个专辑一台电脑提醒一次, 类别是1, 从起始60秒开始显示, 持续时间是10秒
  45. -->
  46. <!-- 因为优先级很高, 前面的最高优先级是10, 所以这里把level设为11. -->
  47. <!-- 这个tip是由signal发起的. Shawn.X  -->
  48. <!--
  49. 《<span>#keyword#</span>》 将于  <span>#expiredTime#</span> 版权到期.
  50. -->
  51. <item id="NoticeThisCopyrightWillExpire" level="11" duration="10" type="1">
  52. <conditions>
Copy code

It is said that it is an advertisement in the play, 8s time, that is to say, I localize it, and then hijack the browser to achieve ads, but it is obvious that this is not an advertisement before the video loads. Continue to flip - a very boring process.

Find who called get adPlayerURL() and look up. Under com\qiyi\player\wonder\plugins\ad, it is found that the ad player exists in the form of a plug-in, that is, there is a call, look up, find CupidAdPlayer at com\qiyi\cupid\adplayer\CupidAdPlayer.as to initialize. And this class is confused, which is very suspicious.

  1. public function CupidAdPlayer(param1:CupidParam)
  2.         {
  3.             this.PLAYER_TIMEOUT_LENGTHS = new Array(10000, 15000);
  4.             Log.info("init, version=" + VERSION + ", " + param1.toString());
  5.             this._videoPlayerVersion = param1.videoPlayerVersion;
  6.             this._videoId = param1.videoId;
  7.             this._tvId = param1.tvId;
  8.             this._channelId = param1.channelId;
  9.             this._collectionId = param1.collectionId;
  10.             this._playerId = param1.playerId;
  11.             this._albumId = param1.albumId;
  12.             this._userId = param1.userId;
  13.             this._webEventId = param1.webEventId;
  14.             this._videoEventId = param1.videoEventId;
  15.             this._vipRight = param1.vipRight;
  16.             this._terminal = param1.terminal;
  17.             this._duration = param1.duration;
  18.             this._passportId = param1.passportId;
  19.             this._passportCookie = param1.passportCookie;
  20.             this._passportKey = param1.passportKey;
  21.             this._videoDefinitionId = param1.videoDefinitionId;
  22.             if (this.isQiyiWebEx())
  23.             {
  24.                 this._playerUrl = this.IQIYI_WEBEX_AM_URL;
  25.             }
  26.             else if (param1.playerUrl)
  27.             {
  28.                 this._playerUrl = param1.playerUrl;
  29.             }
  30.             else
  31.             {
  32.                 this._playerUrl = this.IQIYI_WEB_AM_URL;
  33.             }
  34.             if (param1.dispatcher == null)
  35.             {
  36.                 this._dispatcher = this;
  37.             }
  38.             else
  39.             {
  40.                 this._dispatcher = param1.dispatcher;
  41.             }
  42.             this._volume = param1.volume;
  43.             this._videoIndex = param1.videoIndex;
  44.             this._stageWidth = param1.stageWidth;
  45.             this._stageHeight = param1.stageHeight;
  46.             this._displayContainer = param1.adContainer;
  47.             this._screenStatus = DisplayProperties.isFullScreen(this._displayContainer.stage) ? ("1") : ("0");
  48.             this._baiduMainVideo = param1.baiduMainVideo;
  49.             this._disablePreroll = param1.disablePreroll;
  50.             this._disableSkipAd = param1.disableSkipAd;
  51.             this._enableVideoCore = param1.enableVideoCore;
  52.             this._isUGC = param1.isUGC;
  53.             this._videoPlayerUrl = this._displayContainer.loaderInfo ? (this._displayContainer.loaderInfo.loaderURL) : ("");
  54.             this._env = this.generateEnv();
  55.             this.addAdPlayerEventListeners();
  56.             return;
  57.         }// end function
Copy code

CupidAdPlayer(param1:CupidParam) < – Look at its calling parameters, that is, the upper layer is still calling, where the parameter 1, a value is very eye-catching, vipRight judges whether it is vip, and VIP does not have an advertisement, that is to say, if I make changes to the place where I judge whether it is VIP after obtaining the user information in the session of the website in its player, causing the lower level to be called, Mistaken for VIP (just the ad player thinks you're VIP and the rest of the world is unaffected). Then let's continue to look up. I searched and searched and went back, and returned to the catalog of advertising plugins. com\qiyi\player\wonder\plugins\ad\view in the ADView.as, the head is first

  1. private var _adPlayer:CupidAdPlayer;
Copy code

Defined an instance of CupidAdPlayer named _adPlayer, look down to see who used _adPlayer. I found the ad player creation function.

  1. public function createAdPlayer(param1:CupidParam) : void
  2.         {
  3.             if (this._adPlayer)
  4.             {
  5.                 this.unloadAdPlayer();
  6.             }
  7.             this._log.info("loading adplayer...");
  8.             this._adPlayer = new CupidAdPlayer(param1);
  9.             this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_LOADING_SUCCESS, this.onAdLoadSuccess);
  10.             this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_LOADING_FAILURE, this.onAdLoadFailed);
  11.             this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_AD_START, this.onAdStartPlay);
  12.             this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_PAUSE, this.onAdAskVideoPause);
  13.             this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_RESUME, this.onAdAskVideoResume);
  14.             this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_START_LOADING, this.onAdAskVideoStartLoad);
  15.             this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_START, this.onAdAskVideoStartPlay);
  16.             this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_END, this.onAdAskVideoEnd);
  17.             this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_AD_BLOCK, this.onAdBlock);
  18.             this._adPlayer.addEventListener(AdPlayerEvent.CONTROL_VIDEO_DISPLAY_AD_TIP, this.onAskVideoShowBonusTips);
  19.             this._adPlayer.addEventListener(AdPlayerEvent.ADPLAYER_AD_VIDEO, this.onAdFlvADAction);
  20.             this._adPlayer.load();
  21.             return;
  22.         }// end function
Copy code

I saw that it could also pass parameters, indicating that it was still being called. Finally found the source in the ADViewMediator.as under com\qiyi\player\wonder\plugins\ad\view. His function is finally called like this

  1. private function createADPlayer() : void
  2.         {
  3.             sendNotification(BodyDef.NOTIFIC_PLAYER_STOP_LOAD);
  4.             ProcessesTimeRecord.STime_adInit = getTimer();
  5.             var _loc_1:* = facade.retrieveProxy(PlayerProxy.NAME) as PlayerProxy;
  6.             var _loc_2:* = facade.retrieveProxy(UserProxy.NAME) as UserProxy;
  7.             var _loc_3:* = new CupidParam();
  8.             _loc_3.playerUrl = FlashVarConfig.adPlayerURL;
  9.             _loc_3.videoId = _loc_1.curActor.loadMovieParams.vid;
  10.             _loc_3.tvId = _loc_1.curActor.loadMovieParams.tvid;
  11.             _loc_3.channelId = _loc_1.curActor.movieModel.channelID;
  12.             _loc_3.playerId = FlashVarConfig.cupId;
  13.             _loc_3.albumId = _loc_1.curActor.movieModel.albumId;
  14.             _loc_3.dispatcher = null;
  15.             _loc_3.adContainer = this._ADView;
  16.             _loc_3.stageWidth = GlobalStage.stage.stageWidth;
  17.             _loc_3.stageHeight = GlobalStage.stage.stageHeight;
  18.             _loc_3.userId = _loc_1.curActor.uuid;
  19.             _loc_3.webEventId = UUIDManager.instance.getWebEventID();
  20.             _loc_3.videoEventId = UUIDManager.instance.getVideoEventID();
  21.             _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("0");
  22.             _loc_3.terminal = "iqiyiw";
  23.             _loc_3.duration = _loc_1.curActor.movieModel.duration / 1000;
  24.             _loc_3.passportId = _loc_2.passportID;
  25.             _loc_3.passportCookie = _loc_2.P00001;
  26.             _loc_3.passportKey = KeyUtils.getPassportKey(0);
  27.             _loc_3.enableVideoCore = true;
  28.             _loc_3.disableSkipAd = _loc_1.curActor.movieModel.forceAD;
  29.             _loc_3.volume = Settings.instance.mute ? (0) : (Settings.instance.volumn);
  30.             _loc_3.isUGC = UGCUtils.isUGC(_loc_1.curActor.movieModel.tvid);
  31.             _loc_3.collectionId = FlashVarConfig.collectionID;
  32.             _loc_3.videoDefinitionId = _loc_1.curActor.movieModel.curDefinitionInfo.type.id;
  33.             _loc_3.videoPlayerVersion = WonderVersion.VERSION_WONDER;
  34.             this._ADView.createAdPlayer(_loc_3);
  35.             return;
  36.         }// end function
Copy code

The key point is

  1. _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("0");
Copy code

This sentence determines whether the user is a VIP or not, first judges the user's level according to the local variable loc_2 and returns 1 if it matches the defined VIP level. We made a slight modification to him, and he became a pseudo-VIP.

  1. _loc_3.vipRight = _loc_2.userLevel != UserDef.USER_LEVEL_NORMAL ? ("1") : ("1");
Copy code

In this way, just modify it in Hex, and the test ad is successfully removed (using Chrome's plug-in function, change the player address to be local, and pass the playback parameters as they are).

In addition, under com\qiyi\cupid\adplayer\model AdBlockedBlackScreen.as there is a local detection function that prohibits Chrome's plug-in blocking.

  1. public static function isInBlacklist(param1:String) : Boolean
  2.         {
  3.             if (!param1)
  4.             {
  5.                 return false;
  6.             }
  7.             if (StringUtils.beginsWith(param1, "chrome-extension://"))
  8.             {
  9.                 return true;
  10.             }
  11.             var _loc_2:* = new URLParser(param1);
  12.             var _loc_3:* = _loc_2.getHost();
  13.             return HOST_BLACKLIST.indexOf(_loc_3) != -1;
  14.         }// end function
Copy code

Just change the return of the second if to false.






Previous:Freezing Point Restoration Genie 7.5 in Win7 alternative cracking
Next:VMware virtual machines are installed on MAC OSX Mountain Lion
Posted on 10/23/2014 11:25:57 PM |
Xiao Ningzi is so powerful
Posted on 10/24/2014 9:57:25 PM |
This ad-blocking plugin isn't bad

Score

Number of participants1MB+1 contribute+1 Collapse reason
admin + 1 + 1 Very powerful!

See all ratings

 Landlord| Posted on 10/24/2014 10:01:44 PM |
Unparalleled published on 2014-10-24 21:57
This ad-blocking plugin isn't bad

Adblock Plus is the most popular ad filtering software available on Firefox, Chrome, Opera, Safari, Android, and Internet Explorer. Filter all annoying web ads: remove video ads on Youtube, filter Facebook ads, get rid of pop-up ads and many more other ads. On Google Chrome, Adblock Plus is one of the fastest-growing plugins.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com