├── .gitattributes ├── .gitignore ├── AntiChinaVideoAds.js ├── AntiChinaVideoAds_with_player.rdf ├── README.md ├── bootstrap.js ├── chrome.manifest ├── cli.mp4 ├── icon.png ├── install.rdf └── xpi └── ACVAA11191.xpi /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must end with two \r 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /AntiChinaVideoAds.js: -------------------------------------------------------------------------------- 1 | const Cc = Components.classes; 2 | const Ci = Components.interfaces; 3 | const Cr = Components.results; 4 | const Cu = Components.utils 5 | 6 | var EXPORTED_SYMBOLS = ["AntiChinaVideoAds"]; 7 | 8 | Cu.import("resource://gre/modules/NetUtil.jsm"); 9 | 10 | function AntiChinaVideoAds() {}; 11 | AntiChinaVideoAds.prototype = { 12 | SITES: { 13 | 'youku_loader': { 14 | 'player': 'chrome://AntiChinaVideoAds/content/swf/loader.swf', 15 | 're': /http:\/\/static\.youku\.com(\/v[\d\.]+)?\/v\/swf\/loaders?\.swf/i 16 | }, 17 | 'youku_player': { 18 | 'player': 'chrome://AntiChinaVideoAds/content/swf/player.swf', 19 | 're': /http:\/\/static\.youku\.com(\/v[\d\.]+)?\/v\/swf\/q?player[^\.]*\.swf/i 20 | }, 21 | 'ku6': { 22 | 'player': 'chrome://AntiChinaVideoAds/content/swf/ku6.swf', 23 | 're': /http:\/\/player\.ku6cdn\.com\/default\/common\/player\/\d{12}\/player\.swf/i 24 | }, 25 | 'ku6_out': { 26 | 'player': 'chrome://AntiChinaVideoAds/content/swf/ku6_out.swf', 27 | 're': /http:\/\/player\.ku6cdn\.com\/default\/out\/\d{12}\/player\.swf/i 28 | }, 29 | 'iqiyi': { 30 | 'player0': 'chrome://AntiChinaVideoAds/content/swf/iqiyi_out.swf', 31 | 'player1': 'chrome://AntiChinaVideoAds/content/swf/iqiyi5.swf', 32 | 'player2': 'chrome://AntiChinaVideoAds/content/swf/iqiyi.swf', 33 | 're': /https?:\/\/www\.iqiyi\.com\/(player\/\d+\/Player|common\/flashplayer\/\d+\/(Main|Coop|Share)?Player_?.*)\.swf/i 34 | }, 35 | 'tudou': { 36 | 'player': 'chrome://AntiChinaVideoAds/content/swf/tudou.swf', 37 | 're': /http:\/\/js\.tudouui\.com\/.*portalplayer[^\.]*\.swf/i 38 | }, 39 | 'tudou_olc': { 40 | 'player': 'chrome://AntiChinaVideoAds/content/swf/olc_8.swf', 41 | 're': /http:\/\/js\.tudouui\.com\/.*olc[^\.]*\.swf/i 42 | }, 43 | 'tudou_sp': { 44 | 'player': 'chrome://AntiChinaVideoAds/content/swf/sp.swf', 45 | 're': /http:\/\/js\.tudouui\.com\/.*\/socialplayer[^\.]*\.swf/i 46 | }, 47 | 'letv': { 48 | 'player': 'chrome://AntiChinaVideoAds/content/swf/letv.swf', 49 | 're': /http:\/\/.*letv[\w]*\.com\/(hz|.*\/((?!(Live|seed|Disk))(S[\w]{2,3})?(?!Live)[\w]{4}|swf))Player*\.swf/i 50 | }, 51 | 'letv_live': { 52 | 'player': 'chrome://AntiChinaVideoAds/content/swf/letvlive.swf', 53 | 're': /http:\/\/.*letv[\w]*\.com\/p\/\d+\/\d+\/\d+\/newplayer\/LivePlayer\.swf/i 54 | }, 55 | 'letvskin': { 56 | 'player': 'http://player.letvcdn.com/p/201407/24/15/newplayer/1/SSLetvPlayer.swf', 57 | 're': /http:\/\/.*letv[\w]*\.com\/p\/\d+\/\d+\/(?!15)\d*\/newplayer\/\d+\/S?SLetvPlayer\.swf/i 58 | }, 59 | 'pptv': { 60 | 'player': 'chrome://AntiChinaVideoAds/content/swf/pptv.swf', 61 | 're': /http:\/\/player.pplive.cn\/ikan\/.*\/player4player2\.swf/i 62 | }, 63 | 'pplive': { 64 | 'player': 'chrome://AntiChinaVideoAds/content/swf/pptvLive.swf', 65 | 're': /http:\/\/player.pplive.cn\/live\/.*\/player4live2\.swf/i 66 | }, 67 | 'sohu': { 68 | 'player': 'chrome://AntiChinaVideoAds/content/swf/sohu.swf', 69 | 're': /http:\/\/tv\.sohu\.com\/upload\/swf\/(?!(live|\d+)).*\d+\/(main|PlayerShell)\.swf/i 70 | }, 71 | 'sohu_liv': { 72 | 'player': 'chrome://AntiChinaVideoAds/content/swf/sohulive.swf', 73 | 're': /http:\/\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]{2,5})?(\/test)?\/(player|webplayer)\/(main|playershell)\.swf/i 74 | }, 75 | 'sohu_live': { 76 | 'player': 'chrome://AntiChinaVideoAds/content/swf/sohulive.swf', 77 | 're': /http:\/\/tv\.sohu\.com\/upload\/swf\/(live\/|)\d+\/(main|PlayerShell)\.swf/i 78 | }, 79 | 'pps': { 80 | 'player': 'chrome://AntiChinaVideoAds/content/swf/pps.swf', 81 | 're': /http:\/\/www\.iqiyi\.com\/player\/cupid\/.*\/pps[\w]+.swf/i 82 | }, 83 | 'ppsiqiyi': { 84 | 'player': 'chrome://AntiChinaVideoAds/content/swf/iqiyi.swf', 85 | 're': /http:\/\/www\.iqiyi\.com\/common\/flashplayer\/\d+\/PPSMainPlayer.*\.swf/i 86 | }, 87 | 'ppslive': { 88 | 'player': 'http://www.iqiyi.com/player/20140613210124/livePlayer.swf', 89 | 're': /http:\/\/www\.iqiyi\.com\/common\/flashplayer\/\d+\/am.*\.swf/i 90 | }, 91 | 'wanhenda': { 92 | 'player': 'http://yuntv.letv.com/bcloud.swf', 93 | 're': /http:\/\/assets\.dwstatic\.com\/.*\/vppp\.swf/i 94 | }, 95 | '17173': { 96 | 'player': 'chrome://AntiChinaVideoAds/content/swf/17173_Player_file.swf', 97 | 're': /http:\/\/f\.v\.17173cdn\.com\/\d+\/flash\/Player_file\.swf/i 98 | }, 99 | '17173_out': { 100 | 'player': 'chrome://AntiChinaVideoAds/content/swf/17173_Player_file_out.swf', 101 | 're': /http:\/\/f\.v\.17173cdn\.com(\/\d+)?\/flash\/Player_file_(custom)?out\.swf/i 102 | }, 103 | '17173_stream_customOut': { 104 | 'player': 'chrome://AntiChinaVideoAds/content/swf/17173_Player_stream_out.swf', 105 | 're': /http:\/\/f\.v\.17173cdn\.com(\/\d+)?\/flash\/Player_stream_(custom)?Out\.swf/i 106 | }, 107 | '17173_live': { 108 | 'player': 'chrome://AntiChinaVideoAds/content/swf/17173_Player_stream.swf', 109 | 're': /http:\/\/f\.v\.17173cdn\.com\/\d+\/flash\/Player_stream(_firstpage)?\.swf/i 110 | }, 111 | 'baiduAD': { 112 | 'player': 'chrome://AntiChinaVideoAds/content/swf/baiduAD.swf', 113 | 're': /http:\/\/list\.video\.baidu\.com\/swf\/advPlayer\.swf/i 114 | } 115 | }, 116 | os: Cc['@mozilla.org/observer-service;1'] 117 | .getService(Ci.nsIObserverService), 118 | init: function() { 119 | var site = this.SITES['iqiyi']; 120 | site['preHandle'] = function(aSubject) { 121 | var wnd = this.getWindowForRequest(aSubject); 122 | if(wnd) { 123 | site['cond'] = [ 124 | !/(^((?!baidu|61|178).)*\.iqiyi\.com|pps\.tv)/i.test(wnd.self.location.host), 125 | wnd.self.document.querySelector('span[data-flashplayerparam-flashurl]'), 126 | true 127 | ]; 128 | if(!site['cond']) return; 129 | 130 | for(var i = 0; i < site['cond'].length; i++) { 131 | if(site['cond'][i]) { 132 | if(site['player'] != site['player' + i]) { 133 | site['player'] = site['player' + i]; 134 | site['storageStream'] = site['storageStream' + i] ? site['storageStream' + i] : null; 135 | site['count'] = site['count' + i] ? site['count' + i] : null; 136 | } 137 | break; 138 | } 139 | } 140 | } 141 | }; 142 | site['callback'] = function() { 143 | if(!site['cond']) return; 144 | 145 | for(var i = 0; i < site['cond'].length; i++) { 146 | if(site['player' + i] == site['player']) { 147 | site['storageStream' + i] = site['storageStream']; 148 | site['count' + i] = site['count']; 149 | break; 150 | } 151 | } 152 | }; 153 | }, 154 | // getPlayer, get modified player 155 | getPlayer: function(site, callback) { 156 | NetUtil.asyncFetch(site['player'], function(inputStream, status) { 157 | var binaryOutputStream = Cc['@mozilla.org/binaryoutputstream;1'] 158 | .createInstance(Ci['nsIBinaryOutputStream']); 159 | var storageStream = Cc['@mozilla.org/storagestream;1'] 160 | .createInstance(Ci['nsIStorageStream']); 161 | var count = inputStream.available(); 162 | var data = NetUtil.readInputStreamToString(inputStream, count); 163 | 164 | storageStream.init(512, count, null); 165 | binaryOutputStream.setOutputStream(storageStream.getOutputStream(0)); 166 | binaryOutputStream.writeBytes(data, count); 167 | 168 | site['storageStream'] = storageStream; 169 | site['count'] = count; 170 | 171 | if(typeof callback === 'function') { 172 | callback(); 173 | } 174 | }); 175 | }, 176 | getWindowForRequest: function(request){ 177 | if(request instanceof Ci.nsIRequest){ 178 | try{ 179 | if(request.notificationCallbacks){ 180 | return request.notificationCallbacks 181 | .getInterface(Ci.nsILoadContext) 182 | .associatedWindow; 183 | } 184 | } catch(e) {} 185 | try{ 186 | if(request.loadGroup && request.loadGroup.notificationCallbacks){ 187 | return request.loadGroup.notificationCallbacks 188 | .getInterface(Ci.nsILoadContext) 189 | .associatedWindow; 190 | } 191 | } catch(e) {} 192 | } 193 | return null; 194 | }, 195 | observe: function(aSubject, aTopic, aData) { 196 | if(aTopic != 'http-on-examine-response') return; 197 | 198 | var http = aSubject.QueryInterface(Ci.nsIHttpChannel); 199 | 200 | var aVisitor = new HttpHeaderVisitor(); 201 | http.visitResponseHeaders(aVisitor); 202 | if (!aVisitor.isFlash()) return; 203 | 204 | for(var i in this.SITES) { 205 | var site = this.SITES[i]; 206 | if(site['re'].test(http.URI.spec)) { 207 | var fn = this, args = Array.prototype.slice.call(arguments); 208 | 209 | if(typeof site['preHandle'] === 'function') 210 | site['preHandle'].apply(fn, args); 211 | 212 | if(!site['storageStream'] || !site['count']) { 213 | http.suspend(); 214 | this.getPlayer(site, function() { 215 | http.resume(); 216 | if(typeof site['callback'] === 'function') 217 | site['callback'].apply(fn, args); 218 | }); 219 | } 220 | 221 | var newListener = new TrackingListener(); 222 | aSubject.QueryInterface(Ci.nsITraceableChannel); 223 | newListener.originalListener = aSubject.setNewListener(newListener); 224 | newListener.site = site; 225 | 226 | break; 227 | } 228 | } 229 | }, 230 | QueryInterface: function(aIID) { 231 | if(aIID.equals(Ci.nsISupports) || aIID.equals(Ci.nsIObserver)) 232 | return this; 233 | 234 | return Cr.NS_ERROR_NO_INTERFACE; 235 | }, 236 | register: function() { 237 | this.init(); 238 | this.os.addObserver(this, 'http-on-examine-response', false); 239 | }, 240 | unregister: function() { 241 | this.os.removeObserver(this, 'http-on-examine-response', false); 242 | } 243 | }; 244 | 245 | // TrackingListener, redirect youku player to modified player 246 | function TrackingListener() { 247 | this.originalListener = null; 248 | this.site = null; 249 | } 250 | TrackingListener.prototype = { 251 | onStartRequest: function(request, context) { 252 | this.originalListener.onStartRequest(request, context); 253 | }, 254 | onStopRequest: function(request, context) { 255 | this.originalListener.onStopRequest(request, context, Cr.NS_OK); 256 | }, 257 | onDataAvailable: function(request, context) { 258 | this.originalListener.onDataAvailable(request, context, this.site['storageStream'].newInputStream(0), 0, this.site['count']); 259 | } 260 | }; 261 | 262 | function HttpHeaderVisitor() { 263 | this._isFlash = false; 264 | } 265 | HttpHeaderVisitor.prototype = { 266 | visitHeader: function(aHeader, aValue) { 267 | if (aHeader.indexOf("Content-Type") !== -1) { 268 | if (aValue.indexOf("application/x-shockwave-flash") !== -1) { 269 | this._isFlash = true; 270 | } 271 | } 272 | }, 273 | isFlash: function() { 274 | return this._isFlash; 275 | } 276 | }; 277 | -------------------------------------------------------------------------------- /AntiChinaVideoAds_with_player.rdf: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 1.7.4 10 | 11 | 12 | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 13 | 10.0 14 | * 15 | https://github.com/rasso1/youkuantiads/releases/download/1031/AntiChinaVideoAds10311.xpi 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 火狐去视频广告扩展AntiChinaVideoAdsAlliances(本地播放版): 2 | 3 | 在以下作者基础上修改而成: 4 | OpenGG.Clean.Player 作者 鲁夫的爱 (一代风流人物,开帮派之先河) 5 | YoukuAntiADs@harv.c.uc 作者cinhoo (退隐江湖之风清扬,时不时出来指点2招) 6 | 播放器/代码 作者 15536900 (仍在兢兢业业镇守边关的郭大侠) 7 | 播放器 作者 catcat520 (有独到之秘的小龙女,喵喵控的应该是妹妹吧 ) 8 | 前身是cinhoo大神的youkuantiADs,改名而已。大都是cinhoo代码,只为更新而改小部分 9 | 10 | 功能介绍: 11 | 火狐浏览器扩展,自带本地播放器版,去除国内主流视频网站的几十秒无节操广告, 12 | 如爱奇艺,pps,letv,pptv,优酷,酷六,腾讯,搜狐,17173,多玩等 13 | 14 | 使用方法: 15 | 下载的扩展拉到火狐附加组件列表即可安装,关闭打开的视频页并清理浏览器缓存, 16 | 再重启下浏览器,看看是不是广告影无踪了 17 | 18 | 下崽地址(两版本): 19 | 新版启用霸气侧漏名:AntiChinaVideoAdsAlliances(中国反视频广告联盟)支持在线更新: 20 | 1.位于github的在线更新版本(下载安装后点击在线更新获取最新版本): 21 | https://github.com/rasso1/youkuantiads/releases/download/1027/AntiChinaVideoAds_with_player10272.xpi 22 | 360盘备用地址: http://yunpan.cn/Q7pgYgEB6JcGB (提取码:a5f5) 23 | 2 .火狐官方扩展中心版本(新版在线更新需通过3天官方安全审核,也可手动下载更新): 24 | https://addons.mozilla.org/zh-CN/firefox/addon/antichinavideoadsalliances/ 25 | 26 | 27 | 28 | 29 | 版本更新历史: 30 | 10月27日更新,修复乐视网盘播放,修复乐视在线直播,为美观缩写英文名(ACVAA)及缩短版本号(最新版本号1.7.2) 31 | 10月23日更新,优化图标设计,增加内容介绍,缩减安装包大小,使用新版爱奇艺播放器(最新版本号1.7.0.6) 32 | 09月28日更新,修复PPTV播放黑屏的问题。(最新版本号1.7.0.5) 33 | 09月26日更新,提交火狐官方扩展中心认证,并提供下载,该版本与通过github更新方式不同,请选择安装。 34 | 09月20日更新,增加17173定制外链广告过滤(最新版本号1.7.0.3) 35 | 09月19日二更,增加扩展图标,修改内容介绍(如有较好的图标设计或者内容介绍,欢迎提供,希望成为大家的扩展为大家) 36 | 09月19日更新,增加17173部分外链广告过滤 37 | 09月18日更新,youkuantiads名有歧义,非只过滤优酷广告,故现更名为AntiChinaVideoAdsAlliances 中国反视频广告联盟, 38 | 原youkuantiads不再提供升级服务,抱歉。 39 | 09月18日更新,修复部分爱奇艺外链无法播放问题,合2搜狐视频正则为1. 40 | 09月17日二更,修复部分搜狐电影广告未除问题。同时大家可以试用自动更新功能(一般浏览器打开扩展列表时自动检查更新, 41 | 也可在AntiChinaVideoAdsAlliances“更多”中,点击“关”,强制使用“检查更新”,左下侧即会出现更新) 42 | 09月17日更新,使用GitHub在线更新功能,更新也不再需番茄。同时修复部分搜狐电视台直播的广告未除问题。 43 | 09月15日更新, 修复因土豆更改css文件导致部分电脑无法显示播放进度条问题 44 | 09月08日更新, 修复17173的部分视频去广告 45 | 08月25日更新,增加搜狐部分视频的广告过滤和搜狐直播电视的视频广告过滤 46 | 08月24日更新,增加外站调用爱奇艺播放器时的广告过滤 47 | 08月15日更新 ,增加17173的15秒广告过滤 48 | 08月11日更新第2弹,增加多玩30秒广告过滤 49 | 08月11日更新第1弹,增加B站的45秒广告过滤 50 | 08月10日更新,修复爱奇艺广告过滤 51 | -------------------------------------------------------------------------------- /bootstrap.js: -------------------------------------------------------------------------------- 1 | const Cu = Components.utils; 2 | 3 | var y = null 4 | 5 | function startup(data, reason) { 6 | Cu.import("chrome://AntiChinaVideoAds/content/AntiChinaVideoAds.js"); 7 | 8 | if(!y) { 9 | y = new AntiChinaVideoAds(); 10 | } 11 | y.register(); 12 | } 13 | 14 | function shutdown(data, reason) { 15 | if(y) { 16 | y.unregister(); 17 | y = null; 18 | } 19 | } 20 | 21 | function install(data, reason) { 22 | } 23 | 24 | function uninstall(data, reason) { 25 | } 26 | -------------------------------------------------------------------------------- /chrome.manifest: -------------------------------------------------------------------------------- 1 | content AntiChinaVideoAds content/ 2 | -------------------------------------------------------------------------------- /cli.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasso1/ACVAA/88d08dd939ec1d6ff8a9d21f33fdf3608d66eb60/cli.mp4 -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasso1/ACVAA/88d08dd939ec1d6ff8a9d21f33fdf3608d66eb60/icon.png -------------------------------------------------------------------------------- /install.rdf: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | AntiChinaVideoAds_with_player@xxx.com 6 | ACVAA 中国反视频广告联盟 7 | 1.7.8 8 | Harv.c+15536900+catcat520+jc3213+Rasso1++ 9 | 节约60秒,您就多活1分钟! 千千万万个1分钟?柠檬酒为地球环保节能做出了贡献! 10 | 广告60秒或更多?! 嘿,阿飞,一边玩球球去! 11 | 12 | 功能介绍:去除中国主流视频网站(包括其外链)好几十秒无节操视频广告,如爱奇艺, 13 | PPS,乐视,PPTV,优酷,酷6,搜狐,土豆,17173,Bilibili,多玩等 14 | 15 | 使用方法:安装后,关闭打开的视频页面并清理浏览器缓存,再重启下浏览器即可 16 | true 17 | https://raw.githubusercontent.com/rasso1/youkuantiads/master/AntiChinaVideoAds_with_player.rdf 18 | 19 | 20 | 21 | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 22 | 10.0 23 | * 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /xpi/ACVAA11191.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rasso1/ACVAA/88d08dd939ec1d6ff8a9d21f33fdf3608d66eb60/xpi/ACVAA11191.xpi --------------------------------------------------------------------------------