码迷,mamicode.com
首页 > Web开发 > 详细

关于各种视频网站去广告

时间:2015-12-19 06:37:32      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:

问题:

找个几个chrome扩展,发现这些原理都是通过代理替换swf播放器,并且替换crossdomain.xml修改跨域策略。

但绝大多数都与SwitchyOmega冲突。

核心替换规则如下:

            youku_loader: {
                find: /^http:\/\/static\.youku\.com(\/v[\d\.]*)?\/v\/swf\/loaders?[^\.]*\.swf/,
                replace: "http://sub.adtchrome.com/loader.swf"
            },
            youku_player: {
                find: /^http:\/\/static\.youku\.com(\/v[\d\.]*)?\/v\/swf\/(q?player[^\.]*|\w{13})\.swf/,
                replace: "http://sub.adtchrome.com/player.swf"
            },
            pps_pps: {
                find: /^http:\/\/www\.iqiyi\.com\/player\/cupid\/common\/pps_flvplay_s\.swf/,
                replace: "http://2015.adtchrome.com/pps.swf"
            },
            iqiyi_2: {
                find: /^https?:\/\/www\.iqiyi\.com\/(player\/(\d+\/Player|[a-z0-9]*)|common\/flashplayer\/\d+\/((PPS)?Main|Share)?Player.*_(.|\w{1,3}\d+))\.swf/,
                replace: "http://2015.adtchrome.com/iqiyi5.swf"
            },
            ku6: {
                find: /^http:\/\/player\.ku6cdn\.com\/default\/.*\/\d+\/(v|player|loader)\.swf/,
                replace: "http://2015.adtchrome.com/ku6.swf"
            },
            ku6_topic: {
                find: /^http:\/\/player\.ku6\.com\/inside\/(.*)\/v\.swf/,
                replace: "http://2015.adtchrome.com/ku6.swf?vid=$1"
            },
            sohu: {
                find: /^http:\/\/tv\.sohu\.com\/upload\/swf(\/p2p)?\/\d+\/Main\.swf/,
                replace: "http://www.ahzhulang.com/sohu/sohu_20150104.swf"
            },
            sohu2: {
                find: /^http:\/\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/testplayer\/Main0?\.swf/,
                replace: "http://www.ahzhulang.com/sohu/sohu_20150104.swf"
            },
            sohu_share: {
                find: /^http:\/\/share\.vrs\.sohu\.com\/my\/v\.swf&/,
                replace: "http://www.ahzhulang.com/sohu/sohu_20150104.swf?"
            },
            sohu_sogou: {
                find: /^http:\/\/share\.vrs\.sohu\.com\/(\d+)\/v\.swf/,
                replace: "http://www.ahzhulang.com/sohu/sohu_20150104.swf?vid=$1"
            },
            letv: {
                find: /^http:\/\/player\.letvcdn\.com\/.*p\/.*\/newplayer\/LetvPlayer\.swf/,
                replace: "http://2015.adtchrome.com/letv.swf"
            },
            letv_pcc: {
                find: /http:\/\/www.letv.com\/.*\/playerapi\/pccs_(?!(live|sdk)).*_?(\d+)\.xml/i,
                replace: "http://www.letv.com/cmsdata/playerapi/pccs_sdk_20141113.xml"
            },
            letv_topic: {
                find: /^http:\/\/player\.hz\.letv\.com\/hzplayer\.swf\/v_list=zhuanti/,
                replace: "http://2015.adtchrome.com/letv.swf"
            },
            letv_duowan: {
                find: /^http:\/\/assets\.dwstatic\.com\/video\/vpp\.swf/,
                replace: "http://yuntv.letv.com/bcloud.swf"
            },
            "17173_in": {
                find: /http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/PreloaderFile(Customer)?\.swf/,
                replace: "http://2015.adtchrome.com/17173.in.Vod.swf"
            },
            "17173_out": {
                find: /http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/PreloaderFileFirstpage\.swf/,
                replace: "http://2015.adtchrome.com/17173.out.Vod.swf"
            },
            "17173_live": {
                find: /http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/Player_stream(_firstpage)?\.swf/,
                replace: "http://2015.adtchrome.com/17173.in.Live.swf"
            },
            "17173_live_out": {
                find: /http:\/\/f\.v\.17173cdn\.com\/(\d+\/)?flash\/Player_stream_(custom)?Out\.swf/,
                replace: "http://2015.adtchrome.com/17173.out.Live.swf"
            }

 

解决:

1.设置自动代理规则

技术分享

2.设置videoproxy代理

技术分享

3.因为之前用django撸了一个,反向代理服务器,所以再添加对应规则

技术分享

 

之后看视频的时候切换对应的规则即可去广告

关于各种视频网站去广告

标签:

原文地址:http://www.cnblogs.com/howmp/p/5058585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!