M3u8

解析 或 破解 vip影视 的时候,使用的 《在线播放器》 和 《在线VIP解析接口》 和 《第三方影视野鸡网站》 全局通用 拦截和过滤 (解析资源/采集资源) 的 插播广告切片

  1. // ==UserScript==
  2. // @name M3u8
  3. // @description 解析 或 破解 vip影视 的时候,使用的 《在线播放器》 和 《在线VIP解析接口》 和 《第三方影视野鸡网站》 全局通用 拦截和过滤 (解析资源/采集资源) 的 插播广告切片
  4. // @version 20250403
  5. // @author 江小白
  6. // @include /\.php\?vod_id=\d+?$/
  7. // @include /\/\?id=[a-zA-Z\d]+?$/
  8. // @include /\/[pP]lay(?:er)?(?:\/|\?id=\d)/
  9. // @include /(?:lay|ideo).*?\.html/
  10. // @include /\.m3u8(?:\?(?!.+?&)|$)/
  11. // @include /^https?:\/\/[^\/]+?\/$/
  12. // @include /^https?:\/\/(?:movie\.douban\.com\/subject|m\.douban\.com\/movie)\//
  13. // @include /^https?:\/\/.+?(?<!(?:refer(?:rer)?|ori(?:gin)?))[&#=\?]https?(?::\/\/|:\\\/\\\/|%3A%2F%2F)/
  14. // @include /^https?:\/\/(?!.+?https?(?::\/\/|:\\\/\\\/|%3A%2F%2F)).+?[\?&](?:url|rul)=(?!http).{5,}/
  15. // @include /^https?:\/\/[^\/]+?\/(?:play|share)\/[a-z0-9]+?\/?\s*?$/
  16. // @include /^https?:\/\/[^\/]+?\/vod(?:\/[^\/]+?(?:\/\d[^\/]+?\d)?\.html|detail\/\d[^\/]+?\d\.html)/
  17. // @include /^https?:\/\/(?!.+?https?(?::\/\/|:\\\/\\\/|%3A%2F%2F)).+?\/(?:index\.php\/vod\/detail\/id\/\d+?|p\/\d[^\.]+?\d)\.html/
  18. // @exclude /^https?:\/\/(?:[^\/]+?\.)?(?:(?:ggpht|qpic|gstatic|[yg]timg|youtu|google|cloudflare)|(?:roajsdl|vvvdj|bing|jd|tmall|taobao|meizu|asus|nike|vmall|fliggy|adidas|gome|\w*?suning|liangxinyao|xiaomiyoupin|mmstat|\w*?video\w*?\.qq)\.)/
  19. // @exclude /^https?:\/\/(?:.+?\]|(?:[^\/]+?\/(?!api)){1,}\w+?\?\w*?id=.+?(?<!&key=.+?)[&#=\?]https?(?::\/\/|:\\\/\\\/|%3A%2F%2F)|(?:[^\/]+?\/(?:proxyhttp|[a-zA-Z]*?kv\?)|.+?\.\w+?\/\d+?)$)/
  20. // @exclude /(?:^https?:\/\/(?!.+?https?(?::\/\/|:\\\/\\\/|%3A%2F%2F)).+?\.(?:ts|vob|3gp|rmvb|flac|[fh]lv|og[gv]|m(?:3u8|p[34]|kv|4a|ov|pg|idi|peg)|w(?:[am]v|ma|ebm)|a(?:ac|pe|vi|lac))|\.(?:js(?:on)?|rb|swf|png|xml|bmp|pac|gif|apk|exe|zip|txt|aspx|docx?|jpe?g|p(?:y|df|ng)|i(?:co|dx|mage)|r(?:ss|ar|[0-9]{2,2})|s(?:h|vg|rt|ub)|(?:c|le)ss|w(?:ebp|off2)))(?:#|\?|\\|&|$)|\/0\/(?:\d+?_){1,}\d+?\/0$/
  21. // @run-at document-start
  22. // @namespace https://gf.qytechs.cn/users/769699
  23. // ==/UserScript==
  24.  
  25. (function() {
  26. try {
  27. if (typeof location['m3u8去插播广告'] === 'undefined') {
  28. try {
  29. Object.defineProperty(location, 'm3u8去插播广告', {
  30. value: 'm3u8去插播广告',
  31. writable: false,
  32. enumerable: false,
  33. configurable: false
  34. });
  35. } catch (e) {}
  36. let m3u8wz, wzm3u8, mp4wz, flvwz, tswz, playsharewz, urlFromArgBy, ggbmd, shouldStopExecution, 打印开关, spbfurl, gggzdp, gggzpd, ggsjgg, ggzlhx, ggljbmd, ggljdmb, hhzz, bhhzz, dypd, m3u8gglj, m3u8ggljdypd, m3u8bflj;
  37. m3u8gglj = '';
  38. m3u8bflj = '';
  39. hhzz = '[\\n\\r\\u0085\\u2028\\u2029]';
  40. bhhzz = '[^\\n\\r\\u0085\\u2028\\u2029]';
  41. wzm3u8 = /\.m3u8(?:\?(?!.+?&)|$)/i;
  42. m3u8wz = /\.(?:m3u8|png|css)(?:#|\?|\\|&|$)|(?<!thread|forum|read)\.php(?!(?:[a-z0-9\/]|\?\w+?=.+?\.(?:m(?:p4|kv)|flv|ts)(?:#|\?|\\|&|$)))|\/(?!.+?\.m(?:3u8|p4)(?:#|\?|\\|&|$)).+?(?<![a-z0-9])m(?:3u8|p4)(?![a-z0-9])/i;
  43. mp4wz = /\.m(?:p4|kv)(?:#|\?|\\|&|$)|^https?:\/\/(?:[^\/]+?\.)?pstatp.+?\/obj\/[^\.]+?$|type=video_mp4&(?!.+\.[a-z]{2,5}(?:#|\?|\\|&|$))|\.php\?\w+?=.+?\.mp4/i;
  44. flvwz = /\.flv(?:#|\?|\\|&|$)/i;
  45. tswz = /\.ts(?:#|\?|\\|&|$)/i;
  46. playsharewz = /^https?:\/\/[^\/]+?\/{1,}(?:play|share)\/{1,}[a-zA-Z0-9]+?(?:\/{1,})?$/i;
  47. dypd = /^\s*?(?:0{1,}|(?<!开\s*?)关(?:\s*?[闭掉])?)\s*?$/;
  48. 打印开关 = '关';
  49. ggsjgg = '4|20';
  50. ggzlhx = 'ts|png|jpe?g|txt';
  51. ggljbmd = /&(?:[a-z]*?(?:sign|token|version)|[a-z]+?_?key)=/i;
  52. ggbmd = /(?:\.php|\_(?:ts|mp4)\/.+?\.m3u8)(?:#|\?|\\|&|$)/i;
  53. ggljdmb = new RegExp('\\.(?:' + ggzlhx + ')' + hhzz + '+?#EXTINF','i');
  54. shouldStopExecution = false;
  55. try {
  56. if (!shouldStopExecution) {
  57. /*以下是 M3U8 插播广告 过滤核心代码 不懂勿动*/
  58. const tyad0 = '#EXTINF'
  59. , tyad1 = tyad0 + '\\s*?:\\s*?'
  60. , tyad2 = '#EXT-X-DISCONTINUITY'
  61. , tyad3 = tyad2 + hhzz
  62. , tyad4 = '(?:' + ggzlhx + ')'
  63. , tyad5 = '\\.' + tyad4
  64. , tyad6 = tyad5 + hhzz + '+'
  65. , tyad7 = '#EXT-X-ENDLIST'
  66. , tyad8 = '(?:[a-z\\d]+?(?:\\s*?[\\_\\-]\\s*?)?)?\\d+?'
  67. , tyad9 = '#EXT-X-TARGETDURATION'
  68. , tyad10 = new RegExp('^\\s*?(?:(?!.*?0{3,})[a-z\\d]+?|' + tyad8 + '|https?:\\\/\\\/' + bhhzz + '+?0{3,}\\d+?)\\s*?$','i')
  69. , tyad11 = new RegExp('^' + tyad0,'i')
  70. , tyad12 = new RegExp('^\\s*?' + tyad1,'i')
  71. , tyad13 = '[\\S\\s]+?'
  72. , tyad14 = new RegExp(tyad8 + tyad5,'i')
  73. , tyad15 = '#EXT-X-PLAYLIST-TYPE'
  74. , tyada = bhhzz + '+?' + tyad6
  75. , tyadb = tyad1 + '\\d+?(?:\\.\\d+?)?\\s*?,' + hhzz + '+?'
  76. , tyadc = tyad3 + '+'
  77. , tyadd = tyadc + '?' + tyadb
  78. , tyade = tyada + '?[\\s\\S]*?' + tyadc
  79. , tyadf = '(?<=' + tyad9 + '\\s*?:\\s*?'
  80. , tyadg = ')(?:\\.0{1,})?\\s*?,'
  81. , tyadh = '(?:#EXT-X-[^:]+?:\\s*?'
  82. , tyadi = tyad1 + '\\d+?\\.\\d+?'
  83. , tyad100 = ggsjgg + tyadg
  84. , tyad101 = hhzz + '+?' + tyadh + bhhzz
  85. , tyad102 = tyad1 + '(?:' + tyad100 + hhzz
  86. , tyad103 = tyad101 + '+?' + hhzz
  87. , tyad104 = tyad1 + '\\d+?(?:\\.\\d+?)?,'
  88. , tyad105 = 'https?:\\\/\\\/'
  89. , tyad106 = '+?\\\/\\d+?_\\w{1,10}\\.ts'
  90. , tyad107 = new RegExp('^((?:' + bhhzz + '+?|\\s*?))(?=0{3}\\d+?' + tyad5 + ')','i')
  91. , tyad108 = '[a-z\\d]{10,}0{2}\\d+?\\.'
  92. , tyad109 = '(?:(?=' + tyad7 + ')|' + tyad3 + ')'
  93. , tyad1010 = '^\\s*?#EXTM3U\\s*?'
  94. , tyad1011 = hhzz + '+?' + bhhzz + '+?'
  95. , tyad1012 = tyad1011 + hhzz + '+?'
  96. , tyad1013 = tyad104 + tyad1012 + ')'
  97. , tyad1014 = tyad3 + '+?'
  98. , tyad1015 = tyad104 + hhzz + '+?'
  99. , tyad1016 = tyad6 + '?'
  100. , tyad1017 = bhhzz + '+?' + hhzz + '+?'
  101. , tyad1018 = '0{3}'
  102. , tyad1019 = tyad1011 + hhzz + '+?'
  103. , tyad1020 = tyad104 + tyad1019
  104. , tyad1021 = '#EXT-X-KEY\\s*?:\\s*?METHOD\\s*?='
  105. , tyad1022 = bhhzz + '+?' + tyad5
  106. , tyad1023 = '(?<=' + hhzz + '+)' + tyad1022
  107. , tyad1024 = tyad105 + bhhzz
  108. , tyad1025 = tyad1022 + hhzz + '+?'
  109. , tyad1026 = '(?<=' + hhzz + '+)' + tyad1014 + tyad1
  110. , tyad1027 = hhzz + '+?' + tyad105
  111. , tyad1028 = tyad1027 + tyad1017
  112. , tyad1029 = tyad1011 + tyad1016
  113. , tyad1030 = tyad1015 + tyad1024 + tyad106 + hhzz
  114. , tyad1031 = tyad1010 + hhzz + '+?'
  115. , tyad1032 = tyad1031 + '(?:#EXT-X-' + tyad1017 + '){1,}('
  116. , tyad1033 = tyad1011 + '(?<!' + tyad1018 + bhhzz + '+?)'
  117. , tyad1034 = tyad1033 + hhzz + '+?'
  118. , tyad1035 = tyad1033 + tyad5 + hhzz + '+?'
  119. , tyad1036 = tyadb + tyad1025
  120. , tyad1037 = tyad1028 + '(?:' + tyad1
  121. , tyad1038 = hhzz + '+?' + tyad1024 + '+?' + hhzz + '+?'
  122. , tyad1039 = tyadb + tyad1024 + '+?'
  123. , tyad1040 = tyad1029 + tyad1
  124. , tyad1041 = tyad1 + '\\d+?(?:\\.0{1,})?,'
  125. , tyad1042 = '(?:' + tyad1041 + tyad1038 + ')'
  126. , tyad1043 = tyadi + '\\s*?,' + hhzz
  127. , tyad1044 = '+?[a-z\\d]+?' + tyad6 + '?'
  128. , tyad1045 = tyad1043 + tyad1044 + '){'
  129. , tyad1046 = '\\s*?,' + hhzz + tyad1044
  130. , tyad1047 = '(?=#EXT-X-)'
  131. , tyad1048 = '){0,}'
  132. , tyad1049 = tyad1048 + tyad1 + '\\d+?\\.3{3,}\\s*?,'
  133. , tyad1050 = tyad1046 + '(?:' + tyad1043 + tyad1044 + tyad1048 + ')'
  134. , tyad1051 = new RegExp(tyad1010 + tyad13 + tyad5 + '(?:\\?' + bhhzz + '+?)?' + hhzz + '+?' + tyad1 + tyad13 + tyad7 + '\\s*?$','i')
  135. , itemts = new RegExp(tyad5,'i')
  136. , itemm3u8 = new RegExp(tyad1010 + '#EXT-X-','i')
  137. , itemsdpgza = tyad1026 + '(?<!0)(3)\\.\\1(?:((?<!0)\\d)\\2){2,}\\d+?,' + tyad1028 + '(?:' + tyad104 + tyad1028 + tyad1048 + tyad109
  138. , itemspdgza = '(?:' + tyad1015 + '[a-z\\d]{10,}0{2}\\d+?' + tyad1016 + '){5,}'
  139. , itemstygza = '(?<=(?:' + tyad1015 + tyad108 + tyad4 + hhzz + '+?){1,})' + tyad1014 + '(?:' + tyad1015 + '(?!' + tyad108 + tyad4 + ')' + tyada + '?){1,}' + tyad109
  140. , itemstygza1 = '(?<=' + tyad1020 + ')' + tyad1014 + tyadb + tyad1017 + tyad1 + '3\\.3{3,}\\s*?,' + tyad1034 + '(?:' + tyadb + tyad1017 + tyad1049 + tyad1034 + tyad109
  141. , itemstygza2 = new RegExp(tyad1032 + tyadb + '(\\\/' + bhhzz + '+?\\\/)[^\\\/]+?' + tyad1016 + '(?:' + tyadb + '\\2[^\\\/]+?' + tyad1016 + '){3,})' + tyad1014 + '#EXT-X-KEY\\s*?:\\s*?METHOD=NONE' + hhzz + '+?' + tyad1039 + tyad1016,'i')
  142. , itemstygza3 = new RegExp(tyad1039 + tyad6,'igm')
  143. , itemstygza4 = new RegExp(tyad1032 + '?:' + tyadb + '(?<!' + tyad105 + ')[a-z0-9\\\/]+?' + tyad6 + '?){3,}' + tyad1014 + '(?:' + tyad1039 + tyad6 + '){3,}','i')
  144. , itemstygza5 = new RegExp('(?<=(?<=' + hhzz + '+)' + tyad1014 + tyadi + tyad1018 + tyad1050 + tyad2 + '(?:' + hhzz + '+?' + tyad1045 + '1,}(?:' + tyadi + '3{5}' + tyad1050 + '{2,}' + tyad1047,'gi')
  145. , itemstygza6 = new RegExp('(?<=' + hhzz + '+)' + tyad1014 + '(?:#EXT-X-' + bhhzz + '+' + hhzz + '+){1,}(?=(?:' + tyad7 + '|' + tyad1 + '\\d))','gim')
  146. , itemstygza7 = new RegExp('(?<=' + tyadb + tyad1017 + ')(?:#EXT-X-(?!(?:DISCONTINUITY|ENDLIST))' + tyad1017 + '){1,}(?=(?:' + tyad2 + '|#EXT-X-|' + tyad1 + '\\d))','gim')
  147. , itemsPaichu = [/*动态排除指定资源 正规则表达式,以达到智能删除插播广告的效果*/
  148. new RegExp(tyad1031 + '(?![\\S\\s]*?(?:' + tyad1015 + '[a-z\\d]{10,}0{2}\\d+?' + tyad1016 + '){2,})[\\S\\s]*?' + tyad1014 + '(?:' + tyad1015 + '(?:[a-z]+?\\d+?|\\d+?[a-z]+?){10,}' + tyad1016 + '){2,}','i')]
  149. , itemsHandle = [{
  150. reUrl: wzm3u8,
  151. reAds: [new RegExp(itemsdpgza,'gim'), new RegExp(itemstygza,'gim'), new RegExp(itemstygza1,'gim'), new RegExp('(?<=' + tyad1031 + '(?:#EXT-X-(?!KEY)' + tyad1017 + '){1,})(?:' + tyad1021 + tyad1017 + '(?:' + tyad1014 + ')?){1,}(?=' + tyad1021 + ')','gim'), /*动态拼接采集资源 正规则表达式,以达到智能删除插播广告的效果*/
  152. new RegExp(tyad1026 + '((?<!0)\\d\\.([1-9])(?!\\2)\\d{4,5}(?<!\\2)\\2),' + tyad1037 + '\\1,' + tyad1028 + '){2,6}' + tyad109,'gim'), new RegExp(tyad1014 + tyad1036 + tyad1 + '3\\.3{3,}\\s*?,' + tyad1035 + '(?:' + tyad1036 + tyad1049 + tyad1035 + '(?:' + tyad1036 + tyad1048 + tyad109,'gim'), new RegExp('(?<=' + tyad1030 + '+?(?:' + tyad1014 + tyad1048 + ')' + tyad1014 + '(?:' + tyad104 + hhzz + tyad1024 + '+?\\\/\\w{50,}\\.ts' + hhzz + '+?){1,}' + tyad1014 + '(?=' + tyad1030 + ')','gim'), new RegExp(tyadf + '(?:' + tyad100 + '?' + bhhzz + '+?' + tyad103 + '+?' + tyad1048 + ')' + tyad102 + '+?' + bhhzz + '+?-' + bhhzz + '+?\\d' + tyad1016 + '(?=' + tyad1 + ')','gim'), new RegExp(tyadf + bhhzz + '+?' + tyad103 + '+' + tyad1048 + ')(?:' + tyad1014 + ')?' + tyad102 + '+?[a-z\\d]+?0{4,}' + tyad1016 + '[\\s\\S]+?' + hhzz + '+[a-z\\d]+?0{2,}\\d' + tyad1016 + '(?<![\\s\\S]+?10' + tyad5 + '\\n*?[\\s\\S]*?' + hhzz + '+)(?=(?:' + tyad3 + '+|' + tyad1 + '\\d+(?:\\.\\d+)?\\s*?,' + hhzz + '+?[a-z\\d]+?10' + tyad1016 + '))','gi'), ],
  153. }]
  154. , itemsHandleby = [/*播放黑木耳采集资源的时候,额外增加该数组规则,避免其他的误杀*/
  155. {
  156. reUrl: /^https?:\/\/(?:[^\/]+?\.)?(?:hmr|heimuer)/i,
  157. reAds: [new RegExp('(\\n' + tyad2 + ')\\n.+\\n.+\\1','i'), new RegExp('(\\n' + tyad2 + ')(\\n.+\\n).+\\2.+\\2.+(\\2.+)?\\1','gi'), new RegExp('(?<=' + tyad1014 + ')' + tyad1039 + tyad5 + tyad1017 + tyad1047,'gim'), new RegExp(tyad1026 + '((?<!0)\\d\\.(?!0)\\d{4,5}[1-9]),' + tyad1037 + '\\1,' + tyad1028 + '){2,6}' + tyad109,'gim'), new RegExp(tyad1026 + '(\\d+?(?:\\.(?!0{1,},)\\d+?)?),' + tyad1037 + '\\1,' + tyad1028 + '){1,}' + tyad109,'gim'), ]
  158. }, /*播放华为采集资源的时候,额外增加该数组规则,避免其他资源误杀*/
  159. {
  160. reUrl: /^https?:\/\/(?:[^\/]+?\.)?nikanba/i,
  161. reAds: [new RegExp('(?<=' + tyad2 + ')' + hhzz + '+?' + tyad1 + '10,' + tyad1027 + tyada + '?' + tyad2 + '(?=' + hhzz + ')','gim'), new RegExp(tyad1014 + tyad1 + '2,' + tyad1040 + '3,' + tyad1040 + '1,' + tyad1029 + '(?:' + tyad104 + tyad1011 + tyad6 + '?' + tyad1048 + tyad3 + '+','gim'), ]
  162. }, ];
  163. const logysa = '%c[江小白-'
  164. , logysb = '-已经发现] ✂\n%c对比'
  165. , logysc = '-已经发现] ✂\n%c已经生效的广告正则:\n%c'
  166. , logysd = "的广告正则:\n%c"
  167. , logyse = '\n%c已经删除的广告内容:\n'
  168. , logysf = 'border-left:5px solid #A0B;color:#A0B;padding:3px'
  169. , logysg = 'color:blue;'
  170. , logysh = 'color:red;'
  171. , logysi = 'color:black;'
  172. , logysj = '广告标识'
  173. , logysk = '额外删除-具体内容] ✂%c'
  174. , logysl = '时间差异-具体内容] ✂\n%c'
  175. , logysm = '长度差异-具体内容] ✂\n%c'
  176. , logysn = '长短差异-具体内容] ✂\n%c'
  177. , logyso = '时间标识'
  178. , logysq = '名称差异-具体内容] ✂\n%c';
  179. /*以上是 M3U8 插播广告 过滤核心代码 不懂勿动*/
  180. const urlFromArg = arg=>typeof arg === 'string' ? arg : arg instanceof Request ? arg.url : String(arg);
  181. const isValidM3U8Url = url=>{
  182. return (wzm3u8.test(url) && m3u8wz.test(url) && !mp4wz.test(url) && !flvwz.test(url) && !tswz.test(url) && !playsharewz.test(url));
  183. }
  184. ;
  185. const matchM3u = url=>{
  186. try {
  187. if (isValidM3U8Url(url)) {
  188. spbfurl = url;
  189. const matchedItem = itemsHandle.find(item=>item.reUrl.test(url) && isValidM3U8Url(url) && !ggbmd.test(url));
  190. itemsHandleby.forEach(byItem=>byItem.reUrl.test(url) && isValidM3U8Url(url) && byItem.reAds.forEach(newReAd=>matchedItem.reAds.find(ad=>ad.source === newReAd.source && ad.flags === newReAd.flags) || matchedItem.reAds.push(newReAd)));
  191. return matchedItem;
  192. } else {
  193. return null;
  194. }
  195. } catch (e) {
  196. return null;
  197. }
  198. }
  199. ;
  200. const M3umatch = text=>{
  201. try {
  202. if (!text || !itemts.test(text) || !itemm3u8.test(text)) {
  203. return true;
  204. } else {
  205. return false;
  206. }
  207. } catch (e) {
  208. return false;
  209. }
  210. }
  211. ;
  212. const M3umatchu3M = (array,regExp)=>{
  213. return array.some(function(item) {
  214. return item.toString() === regExp.toString();
  215. });
  216. }
  217. ;
  218. const m3u8text = (text)=>{
  219. try {
  220. const regex = /^[a-z\d]{20,}/i;
  221. const lines = text.split('\n');
  222. let count = 0;
  223. for (let line of lines) {
  224. const trimmedLine = line.trim();
  225. if (itemts.test(trimmedLine)) {
  226. const match = trimmedLine.match(itemts);
  227. if (match) {
  228. const extension = match[0];
  229. const fileName = trimmedLine.slice(0, -extension.length);
  230. if (!regex.test(fileName)) {
  231. return false;
  232. }
  233. }
  234. }
  235. if (/0{2,}\d+$/.test(trimmedLine)) {
  236. count++;
  237. if (count >= 20) {
  238. return false;
  239. }
  240. }
  241. }
  242. return true;
  243. } catch (e) {
  244. return false;
  245. }
  246. }
  247. ;
  248. const endlist = (text)=>{
  249. try {
  250. if (!itemm3u8.test(text)) {
  251. return text;
  252. } else {
  253. if (ggljbmd.test(text)) {
  254. return text;
  255. } else {
  256. if (!new RegExp(tyad5,'i').test(text)) {
  257. return text;
  258. } else {
  259. const lines = text.trim().split('\n');
  260. const lastLine = lines[lines.length - 1];
  261. if (lastLine.trim() !== tyad7) {
  262. lines.push(tyad7);
  263. }
  264. return lines.join('\n');
  265. }
  266. }
  267. }
  268. } catch (e) {
  269. return text;
  270. }
  271. }
  272. ;
  273. const deleteAbnormalTs = (text,jxbgza,jxbgzb,jxbgzc,jxbgzd,jxbgze)=>{
  274. try {
  275. if (!shouldStopExecution) {
  276. if (text) {
  277. if (!itemm3u8.test(text)) {
  278. return text;
  279. } else {
  280. if (ggljbmd.test(text)) {
  281. shouldStopExecution = true;
  282. return text;
  283. } else {
  284. if (ggljdmb.test(text)) {
  285. if (new RegExp(tyad1023,'i').test(text)) {
  286. if (!new RegExp(tyad5 + '\\?','i').test(text)) {
  287. if (new RegExp(tyad5 + hhzz,'i').test(text)) {
  288. if (!jxbgzd) {
  289. jxbgzd = new RegExp('^\\s*?' + tyad8 + '\\s*?$','i');
  290. } else if (jxbgzd == '空') {
  291. jxbgzd = /^\s*?空\s*?$/;
  292. }
  293. try {
  294. const rgtya = tyad1015
  295. , rgtyb = jxbgza + tyad1016
  296. , regex = '(?<=' + rgtya + ')(' + jxbgzb + ')(?=' + rgtyb + ')'
  297. , regexx = new RegExp(regex,'gi')
  298. , tsPaths = text.match(new RegExp('(?:(?<=' + tyad1015 + '))?' + bhhzz + '+?(?=' + tyad1016 + ')','gi'))
  299. , matches = text.match(regexx)
  300. , paths = {};
  301. if (!jxbgze || jxbgze == '空' || (Number.isInteger(Number(jxbgze)) && tsPaths && tsPaths.length < jxbgze)) {
  302. for (let i = 0; i < matches.length; i++) {
  303. const path = matches[i];
  304. if (!paths[path]) {
  305. paths[path] = [];
  306. }
  307. paths[path].push(path);
  308. }
  309. let maxCount = 0
  310. , maxPath = '';
  311. for (const path in paths) {
  312. if (paths[path].length > maxCount) {
  313. maxCount = paths[path].length;
  314. maxPath = path;
  315. }
  316. }
  317. if (maxCount > matches.length * 0.66 && Object.keys(paths).length < matches.length * 0.66) {
  318. let deleteCount = 0;
  319. for (const path in paths) {
  320. if (path !== maxPath) {
  321. deleteCount += paths[path].length;
  322. }
  323. }
  324. if (deleteCount <= maxCount) {
  325. for (const path in paths) {
  326. if (path !== maxPath) {
  327. paths[path].forEach(p=>{
  328. /*console.log("排除测试:\n"+p);*/
  329. if (!jxbgzd.test(p)) {
  330. text = text.replace(new RegExp(rgtya + p + rgtyb,'gi'), (match)=>{
  331. if (!dypd.test(打印开关)) {
  332. try {
  333. console.log(logysa + "广告资源" + logysb + jxbgzc + logysd + regexx + logyse + "%c" + match.replace(new RegExp(tyad1023,'gi'), tsLink=>{
  334. if (!tsLink.startsWith('http')) {
  335. if (m3u8gglj) {
  336. return new URL(tsLink,m3u8gglj).href;
  337. } else {
  338. return tsLink;
  339. }
  340. } else {
  341. return tsLink;
  342. }
  343. }
  344. ), logysf, logysg, logysh, logysg, logysi);
  345. } catch (e) {
  346. try {
  347. console.log(logysa + "广告资源" + logysb + jxbgzc + logysd + regexx + logyse + "%c" + match, logysf, logysg, logysh, logysg, logysi);
  348. } catch (e) {}
  349. }
  350. }
  351. return '';
  352. }
  353. );
  354. }
  355. }
  356. );
  357. }
  358. }
  359. } else {
  360. return text;
  361. }
  362. }
  363. }
  364. } catch (e) {}
  365. }
  366. }
  367. }
  368. return endlist(text);
  369. } else {
  370. return text;
  371. }
  372. }
  373. }
  374. } else {
  375. return text;
  376. }
  377. } else {
  378. return text;
  379. }
  380. } catch (e) {
  381. return text;
  382. }
  383. }
  384. ;
  385. const durationtaragt = (text)=>{
  386. try {
  387. if (!itemm3u8.test(text)) {
  388. return text;
  389. } else {
  390. const lines = text.split('\n');
  391. const outputLines = [];
  392. let extinfCount = 0;
  393. let tsCount = 0;
  394. let lastExtinf = null;
  395. for (let i = 0; i < lines.length; i++) {
  396. const line = lines[i].trim();
  397. if (tyad12.test(line)) {
  398. const durationPart = line.split(',', 1)[0].replace(tyad12, '').trim();
  399. if (!isNaN(durationPart) && durationPart.trim() !== '') {
  400. extinfCount++;
  401. lastExtinf = line;
  402. } else {
  403. lastExtinf = null;
  404. }
  405. } else if (itemts.test(line)) {
  406. tsCount++;
  407. if (lastExtinf) {
  408. outputLines.push(lastExtinf);
  409. outputLines.push(line);
  410. lastExtinf = null;
  411. } else {
  412. outputLines.push(line);
  413. }
  414. } else if (line) {
  415. outputLines.push(line);
  416. }
  417. }
  418. if (extinfCount > tsCount) {
  419. const finalLines = [];
  420. let shouldKeepTs = false;
  421. for (let i = 0; i < outputLines.length; i++) {
  422. const line = outputLines[i];
  423. if (tyad12.test(line)) {
  424. shouldKeepTs = true;
  425. finalLines.push(line);
  426. } else if (itemts.test(line)) {
  427. if (shouldKeepTs) {
  428. finalLines.push(line);
  429. shouldKeepTs = false;
  430. }
  431. } else {
  432. finalLines.push(line);
  433. }
  434. }
  435. return finalLines.join('\n').trim();
  436. } else {
  437. return outputLines.join('\n').trim();
  438. }
  439. }
  440. } catch (e) {
  441. return text;
  442. }
  443. }
  444. ;
  445. const taragtduration = (text)=>{
  446. try {
  447. if (!itemm3u8.test(text)) {
  448. return text;
  449. } else {
  450. var lines = text.split('\n');
  451. var maxDuration = 0;
  452. var minDuration = Infinity;
  453. var targetDurationLineIndex = -1;
  454. var originalTargetDuration = 0;
  455. for (var i = 0; i < lines.length; i++) {
  456. if (lines[i].match(tyad12)) {
  457. var duration = parseFloat(lines[i].split(',')[0].split(':')[1]);
  458. if (duration > maxDuration) {
  459. maxDuration = duration;
  460. }
  461. if (duration < minDuration) {
  462. minDuration = duration;
  463. }
  464. } else if (lines[i].match(new RegExp('^\\s*?' + tyad9 + '\\s*?:','i'))) {
  465. targetDurationLineIndex = i;
  466. originalTargetDuration = parseInt(lines[i].split(':')[1], 10);
  467. }
  468. }
  469. if (targetDurationLineIndex === -1) {
  470. return text;
  471. } else {
  472. var newTargetDuration;
  473. if (maxDuration === minDuration) {
  474. var multiplier = maxDuration < 10 ? 1.5 : 1.23;
  475. newTargetDuration = Math.ceil(maxDuration * multiplier);
  476. } else {
  477. newTargetDuration = Math.ceil(maxDuration + minDuration);
  478. }
  479. if (newTargetDuration === originalTargetDuration) {
  480. var multiplier = maxDuration < 10 ? 1.5 : 1.23;
  481. newTargetDuration = Math.ceil(maxDuration * multiplier);
  482. }
  483. if (newTargetDuration === originalTargetDuration) {
  484. var multiplier = originalTargetDuration < 10 ? 1.5 : 1.23;
  485. newTargetDuration = Math.ceil(originalTargetDuration * multiplier);
  486. }
  487. if (newTargetDuration !== originalTargetDuration) {
  488. lines[targetDurationLineIndex] = tyad9 + ':' + newTargetDuration;
  489. try {
  490. if (!dypd.test(打印开关)) {
  491. console.log(logysa + logyso + "-已经发现] ✂" + '已经把《' + tyad9 + '》数值从原来的值<' + originalTargetDuration + '>修改成<' + newTargetDuration + '>', logysf);
  492. }
  493. } catch (e) {}
  494. return lines.join('\n');
  495. } else {
  496. return text;
  497. }
  498. }
  499. }
  500. } catch (e) {
  501. return text;
  502. }
  503. }
  504. ;
  505. const proqca = (text,item)=>{
  506. try {
  507. if (!shouldStopExecution) {
  508. if (text) {
  509. if (!itemm3u8.test(text)) {
  510. return text;
  511. } else {
  512. if (ggljbmd.test(text)) {
  513. shouldStopExecution = true;
  514. return text;
  515. } else {
  516. try {
  517. if ((!(new RegExp(itemsdpgza,'i').test(text) && ggljdmb.test(text))) && !new RegExp(tyad1014 + tyad1021,'i').test(text)) {
  518. gggzdp = true;
  519. } else {
  520. try {
  521. itemsHandle.forEach(item=>{
  522. item.reAds = item.reAds.filter(re=>re.source !== itemsdpgza);
  523. }
  524. );
  525. } catch (e) {}
  526. gggzdp = false;
  527. }
  528. } catch (e) {
  529. gggzdp = false;
  530. }
  531. if (ggljdmb.test(text) || !!gggzdp) {
  532. try {
  533. if (!gggzpd) {
  534. gggzpd = true;
  535. try {
  536. if (new RegExp(itemspdgza,'i').test(text) && new RegExp(itemstygza1,'i').test(text)) {
  537. itemsHandle.forEach(item=>{
  538. item.reAds = item.reAds.filter(re=>re.source !== itemstygza1);
  539. }
  540. );
  541. }
  542. } catch (e) {}
  543. try {
  544. if (!(new RegExp(itemspdgza,'i').test(text) && new RegExp(itemstygza,'i').test(text))) {
  545. itemsHandle.forEach(item=>{
  546. item.reAds = item.reAds.filter(re=>re.source !== itemstygza);
  547. }
  548. );
  549. }
  550. } catch (e) {}
  551. if (!dypd.test(打印开关)) {
  552. console.table(itemsPaichu);
  553. console.table(itemsHandle);
  554. }
  555. }
  556. } catch (e) {}
  557. let modifiedText;
  558. try {
  559. if (itemsPaichu.some(regex=>regex.test(text))) {
  560. try {
  561. if (!M3umatchu3M(itemsHandle[0].reAds, itemstygza5)) {
  562. itemsHandle[0].reAds.push(itemstygza5);
  563. }
  564. } catch (e) {}
  565. modifiedText = text;
  566. } else {
  567. if (new RegExp(tyadb + bhhzz + '+?\\.(?:' + ggzlhx + ')\\?' + tyad1017,'i').test(text)) {
  568. modifiedText = text;
  569. } else {
  570. if (m3u8text(text)) {
  571. modifiedText = text;
  572. } else {
  573. try {
  574. if (text.match(itemstygza2)) {
  575. const matchessc = text.match(itemstygza3);
  576. if (matchessc) {
  577. try {
  578. if (!dypd.test(打印开关)) {
  579. console.log(logysa + "资源广告" + logysc + itemstygza3 + logyse, logysf, logysg, logysh, logysg);
  580. matchessc.forEach(match=>{
  581. console.log(match);
  582. }
  583. );
  584. }
  585. } catch (e) {}
  586. modifiedText = text.replace(itemstygza3, '');
  587. } else {
  588. modifiedText = deleteAbnormalTs(text, '[^\\.]+?', '(?:' + bhhzz + '+\\\/|\\b)', '路径');
  589. }
  590. } else {
  591. modifiedText = deleteAbnormalTs(text, '[^\\.]+?', '(?:' + bhhzz + '+\\\/|\\b)', '路径');
  592. }
  593. } catch (e) {
  594. modifiedText = text;
  595. }
  596. try {
  597. if (!text.match(itemstygza4)) {
  598. modifiedText = deleteAbnormalTs(modifiedText, '(?:\\d+?|[a-z]+?)', '\\w+?(?:[^\\d]\\d{2})?', '名称');
  599. }
  600. } catch (e) {}
  601. try {
  602. modifiedText = deleteAbnormalTs(modifiedText, '\\d+?', '\\w+(?=\\d{3})', '名称', '空', 100);
  603. } catch (e) {}
  604. try {
  605. modifiedText = deleteAbnormalTs(modifiedText, '\\d+?', '\\w+(?=\\d{4})', '名称', '空');
  606. } catch (e) {}
  607. try {
  608. modifiedText = deleteAbnormalTs(modifiedText, '\\d+?', '[^0]\\d+[^0]0{2,}\\d0', '名称', /(?<=[^0]0{3,})\d+$/);
  609. } catch (e) {}
  610. }
  611. }
  612. }
  613. } catch (e) {
  614. modifiedText = text;
  615. }
  616. for (const reAd of item.reAds) {
  617. const matches = modifiedText.match(reAd);
  618. if (matches) {
  619. matches.forEach(match=>{
  620. try {
  621. if (!dypd.test(打印开关)) {
  622. try {
  623. console.log(logysa + "资源广告" + logysc + reAd + logyse + "%c" + match.replace(new RegExp(tyad1023,'gi'), tsLink=>{
  624. if (!tsLink.startsWith('http')) {
  625. if (m3u8gglj) {
  626. return new URL(tsLink,m3u8gglj).href;
  627. } else {
  628. return tsLink;
  629. }
  630. } else {
  631. return tsLink;
  632. }
  633. }
  634. ), logysf, logysg, logysh, logysg, logysi);
  635. } catch (e) {
  636. try {
  637. if (!dypd.test(打印开关)) {
  638. console.log(logysa + "资源广告" + logysc + reAd + logyse + "%c" + match, logysf, logysg, logysh, logysg, logysi);
  639. }
  640. } catch (e) {}
  641. }
  642. }
  643. } catch (e) {}
  644. }
  645. );
  646. }
  647. modifiedText = modifiedText.replace(reAd, "");
  648. }
  649. if (modifiedText.length < text.length) {
  650. return endlist(modifiedText);
  651. } else {
  652. return text;
  653. }
  654. } else {
  655. return text;
  656. }
  657. }
  658. }
  659. } else {
  660. return text;
  661. }
  662. } else {
  663. return text;
  664. }
  665. } catch (e) {
  666. return text;
  667. }
  668. }
  669. ;
  670. const proqcb = (text)=>{
  671. try {
  672. if (!shouldStopExecution) {
  673. if (text) {
  674. if (!itemm3u8.test(text)) {
  675. return text;
  676. } else {
  677. if (ggljbmd.test(text)) {
  678. shouldStopExecution = true;
  679. return text;
  680. } else {
  681. if (!shouldStopExecution) {
  682. const lines = text.split('\n');
  683. const tsLines = lines.filter(line=>line.trim().match(tyad5));
  684. const tsLinesWith00 = tsLines.filter(line=>line.includes('00'));
  685. const totalTsLines = tsLines.length;
  686. const tsLinesWith00Count = tsLinesWith00.length;
  687. if (tsLinesWith00Count / totalTsLines >= 0.666) {
  688. const prefixes = tsLinesWith00.map(line=>{
  689. const index = line.indexOf('00');
  690. return line.substring(0, index + 2);
  691. }
  692. );
  693. let commonPrefix = prefixes[0];
  694. const backupArray = [];
  695. for (let i = 1; i < prefixes.length; i++) {
  696. let currentPrefix = '';
  697. for (let j = 0; j < Math.min(commonPrefix.length, prefixes[i].length); j++) {
  698. if (commonPrefix[j] === prefixes[i][j]) {
  699. currentPrefix += commonPrefix[j];
  700. backupArray.push(currentPrefix);
  701. } else {
  702. break;
  703. }
  704. }
  705. commonPrefix = currentPrefix;
  706. if (commonPrefix === '') {
  707. break;
  708. }
  709. }
  710. const uniqueBackupArray = Array.from(new Set(backupArray));
  711. let longestItem = '';
  712. for (const item of uniqueBackupArray) {
  713. if (item.length > longestItem.length) {
  714. longestItem = item;
  715. }
  716. }
  717. const tsLinesToDelete = tsLines.filter(line=>!line.startsWith(longestItem));
  718. const tsLinesToDeleteCount = tsLinesToDelete.length;
  719. if (tsLinesToDeleteCount / totalTsLines > 0.666) {
  720. return text;
  721. } else {
  722. const deletedLines = [];
  723. const newLines = [];
  724. let i = 0;
  725. while (i < lines.length) {
  726. if (lines[i].includes(tyad0) && i + 1 < lines.length && lines[i + 1].trim().match(tyad5)) {
  727. const tsLine = lines[i + 1];
  728. const fileName = tsLine.split('/').pop();
  729. if (tyad14.test(fileName)) {
  730. newLines.push(lines[i], lines[i + 1]);
  731. i += 2;
  732. } else if (!tsLine.startsWith(longestItem)) {
  733. deletedLines.push(lines[i], lines[i + 1]);
  734. i += 2;
  735. } else {
  736. newLines.push(lines[i], lines[i + 1]);
  737. i += 2;
  738. }
  739. } else {
  740. newLines.push(lines[i]);
  741. i += 1;
  742. }
  743. }
  744. try {
  745. if (!dypd.test(打印开关)) {
  746. if (deletedLines.length > 0) {
  747. try {
  748. console.log(logysa + logysq + deletedLines.reverse().map(line=>{
  749. return line.replace(new RegExp(tyad1022,'gi'), tsLink=>{
  750. if (!tsLink.startsWith('http')) {
  751. if (m3u8gglj) {
  752. return new URL(tsLink,m3u8gglj).href;
  753. } else {
  754. return tsLink;
  755. }
  756. } else {
  757. return tsLink;
  758. }
  759. }
  760. );
  761. }
  762. ).join('\n'), logysf, logysi);
  763. } catch (e) {}
  764. }
  765. }
  766. } catch (e) {}
  767. return endlist(newLines.join('\n'));
  768. }
  769. } else {
  770. return text;
  771. }
  772. } else {
  773. return text;
  774. }
  775. }
  776. }
  777. } else {
  778. return text;
  779. }
  780. } else {
  781. return text;
  782. }
  783. } catch (e) {
  784. return text;
  785. }
  786. }
  787. ;
  788. const proqcc = (text)=>{
  789. try {
  790. if (!shouldStopExecution) {
  791. if (text) {
  792. if (!itemm3u8.test(text)) {
  793. return text;
  794. } else {
  795. if (ggljbmd.test(text)) {
  796. shouldStopExecution = true;
  797. return text;
  798. } else {
  799. if (!shouldStopExecution) {
  800. let tsFileNameLength = 0;
  801. let tsFileNameLengthTolerance = 1;
  802. let firstExtInfRow = '';
  803. let extInfJudgeRowCounter = 0;
  804. let sameExtInfNameCounter = 0;
  805. let extInfBenchmarkCounter = 5;
  806. let previousTsNameIndex = -1;
  807. let firstTsNameIndex = -1;
  808. let tsType = 0;
  809. let extXMode = 0;
  810. let violentFilterModeFlag = false;
  811. let result = [];
  812. let deletedLines = [];
  813. const numberBeforeTsRegex = new RegExp('(\\d+)' + tyad5,'i');
  814. const tsExtensionRegex = new RegExp(tyad5,'i');
  815. const lines = text.split('\n');
  816. function extractNumberBeforeTs(str) {
  817. const match = numberBeforeTsRegex.exec(str);
  818. if (match) {
  819. return parseInt(match[1], 10);
  820. }
  821. return null;
  822. }
  823. ;function getTsIndex(str) {
  824. const match = tsExtensionRegex.exec(str);
  825. if (match) {
  826. return match.index;
  827. }
  828. return -1;
  829. }
  830. ;if (violentFilterModeFlag) {
  831. tsType = 2;
  832. } else {
  833. let normalIntTsCounter = 0;
  834. let diffIntTsCounter = 0;
  835. let lastTsNameLength = 0;
  836. for (let i = 0; i < lines.length; i++) {
  837. const line = lines[i];
  838. if (extInfJudgeRowCounter === 0 && line.startsWith(tyad0)) {
  839. firstExtInfRow = line;
  840. extInfJudgeRowCounter++;
  841. } else if (extInfJudgeRowCounter === 1 && line.startsWith(tyad0)) {
  842. if (line !== firstExtInfRow) {
  843. firstExtInfRow = '';
  844. }
  845. extInfJudgeRowCounter++;
  846. }
  847. let currentTsNameLength = getTsIndex(line);
  848. if (currentTsNameLength > 0) {
  849. if (extInfJudgeRowCounter === 1) {
  850. tsFileNameLength = currentTsNameLength;
  851. }
  852. lastTsNameLength = currentTsNameLength;
  853. let tsNameIndex = extractNumberBeforeTs(line);
  854. if (tsNameIndex === null) {
  855. if (extInfJudgeRowCounter === 1) {
  856. tsType = 1;
  857. } else if (extInfJudgeRowCounter === 2 && (tsType === 1 || currentTsNameLength === tsFileNameLength)) {
  858. tsType = 1;
  859. break;
  860. } else {
  861. diffIntTsCounter++;
  862. }
  863. } else {
  864. if (normalIntTsCounter === 0) {
  865. previousTsNameIndex = tsNameIndex;
  866. firstTsNameIndex = tsNameIndex;
  867. previousTsNameIndex = firstTsNameIndex - 1;
  868. }
  869. if (currentTsNameLength !== tsFileNameLength) {
  870. if (currentTsNameLength === lastTsNameLength + 1 && tsNameIndex === previousTsNameIndex + 1) {
  871. if (diffIntTsCounter) {
  872. if (tsNameIndex === previousTsNameIndex + 1) {
  873. tsType = 0;
  874. previousTsNameIndex = firstTsNameIndex - 1;
  875. break;
  876. } else {
  877. tsType = 2;
  878. break;
  879. }
  880. }
  881. normalIntTsCounter++;
  882. previousTsNameIndex = tsNameIndex;
  883. } else {
  884. diffIntTsCounter++;
  885. }
  886. } else {
  887. if (diffIntTsCounter) {
  888. if (tsNameIndex === previousTsNameIndex + 1) {
  889. tsType = 0;
  890. previousTsNameIndex = firstTsNameIndex - 1;
  891. break;
  892. } else {
  893. tsType = 2;
  894. break;
  895. }
  896. }
  897. normalIntTsCounter++;
  898. previousTsNameIndex = tsNameIndex;
  899. }
  900. }
  901. }
  902. if (i === lines.length - 1) {
  903. tsType = 2;
  904. }
  905. }
  906. }
  907. for (let i = 0; i < lines.length; i++) {
  908. const line = lines[i];
  909. if (tsType === 0) {
  910. if (line.startsWith(tyad2) && lines[i + 1] && lines[i + 2]) {
  911. if (i > 0 && lines[i - 1].startsWith(tyad15)) {
  912. result.push(line);
  913. continue;
  914. } else {
  915. let currentTsNameLength = getTsIndex(lines[i + 2]);
  916. if (currentTsNameLength > 0) {
  917. if (currentTsNameLength - tsFileNameLength > tsFileNameLengthTolerance) {
  918. if (lines[i + 3] && lines[i + 3].startsWith(tyad2)) {
  919. deletedLines.push(lines[i], lines[i + 1], lines[i + 2], lines[i + 3]);
  920. i += 3;
  921. } else {
  922. deletedLines.push(lines[i], lines[i + 1], lines[i + 2]);
  923. i += 2;
  924. }
  925. continue;
  926. } else {
  927. tsFileNameLength = currentTsNameLength;
  928. }
  929. let currentTsNameIndex = extractNumberBeforeTs(lines[i + 2]);
  930. if (currentTsNameIndex !== previousTsNameIndex + 1) {
  931. if (lines[i + 3] && lines[i + 3].startsWith(tyad2)) {
  932. deletedLines.push(lines[i], lines[i + 1], lines[i + 2], lines[i + 3]);
  933. i += 3;
  934. } else {
  935. deletedLines.push(lines[i], lines[i + 1], lines[i + 2]);
  936. i += 2;
  937. }
  938. continue;
  939. }
  940. }
  941. }
  942. }
  943. if (line.startsWith(tyad0) && lines[i + 1]) {
  944. let currentTsNameLength = getTsIndex(lines[i + 1]);
  945. if (currentTsNameLength > 0) {
  946. if (currentTsNameLength - tsFileNameLength > tsFileNameLengthTolerance) {
  947. if (lines[i + 2] && lines[i + 2].startsWith(tyad2)) {
  948. deletedLines.push(lines[i], lines[i + 1], lines[i + 2]);
  949. i += 2;
  950. } else {
  951. deletedLines.push(lines[i], lines[i + 1]);
  952. i += 1;
  953. }
  954. continue;
  955. } else {
  956. tsFileNameLength = currentTsNameLength;
  957. }
  958. let currentTsNameIndex = extractNumberBeforeTs(lines[i + 1]);
  959. if (currentTsNameIndex === previousTsNameIndex + 1) {
  960. previousTsNameIndex++;
  961. } else {
  962. if (lines[i + 2].startsWith(tyad2)) {
  963. deletedLines.push(lines[i], lines[i + 1], lines[i + 2]);
  964. i += 2;
  965. } else {
  966. deletedLines.push(lines[i], lines[i + 1]);
  967. i += 1;
  968. }
  969. continue;
  970. }
  971. }
  972. }
  973. } else if (tsType === 1) {
  974. if (line.startsWith(tyad0)) {
  975. if (line === firstExtInfRow && sameExtInfNameCounter <= extInfBenchmarkCounter && extXMode === 0) {
  976. sameExtInfNameCounter++;
  977. } else {
  978. extXMode = 1;
  979. }
  980. if (sameExtInfNameCounter > extInfBenchmarkCounter) {
  981. extXMode = 1;
  982. }
  983. }
  984. if (line.startsWith(tyad2)) {
  985. if (i > 0 && lines[i - 1].startsWith(tyad15)) {
  986. result.push(line);
  987. continue;
  988. } else {
  989. if (lines[i + 1] && lines[i + 1].startsWith(tyad0) && lines[i + 2] && getTsIndex(lines[i + 2]) > 0) {
  990. let extXDiscontinuityConditionFlag = false;
  991. if (extXMode === 1) {
  992. extXDiscontinuityConditionFlag = lines[i + 1] !== firstExtInfRow && sameExtInfNameCounter > extInfBenchmarkCounter;
  993. }
  994. if (lines[i + 3] && lines[i + 3].startsWith(tyad2) && extXDiscontinuityConditionFlag) {
  995. deletedLines.push(lines[i], lines[i + 1], lines[i + 2], lines[i + 3]);
  996. i += 3;
  997. }
  998. continue;
  999. }
  1000. }
  1001. }
  1002. } else {
  1003. if (line.startsWith(tyad2)) {
  1004. if (i > 0 && lines[i - 1].startsWith(tyad15)) {
  1005. result.push(line);
  1006. continue;
  1007. } else {
  1008. continue;
  1009. }
  1010. }
  1011. }
  1012. result.push(line);
  1013. }
  1014. try {
  1015. if (!dypd.test(打印开关)) {
  1016. if (deletedLines.length > 0) {
  1017. try {
  1018. console.log(logysa + logysq + deletedLines.reverse().map(line=>{
  1019. return line.replace(new RegExp(tyad1022,'gi'), tsLink=>{
  1020. if (!tsLink.startsWith('http')) {
  1021. if (m3u8gglj) {
  1022. return new URL(tsLink,m3u8gglj).href;
  1023. } else {
  1024. return tsLink;
  1025. }
  1026. } else {
  1027. return tsLink;
  1028. }
  1029. }
  1030. );
  1031. }
  1032. ).join('\n'), logysf, logysi);
  1033. } catch (e) {}
  1034. }
  1035. }
  1036. } catch (e) {}
  1037. return endlist(result.join('\n'));
  1038. } else {
  1039. return text;
  1040. }
  1041. }
  1042. }
  1043. } else {
  1044. return text;
  1045. }
  1046. } else {
  1047. return text;
  1048. }
  1049. } catch (e) {
  1050. return text;
  1051. }
  1052. }
  1053. ;
  1054. const removeprunerm3u8a = (text)=>{
  1055. try {
  1056. if (!shouldStopExecution) {
  1057. if (text) {
  1058. if (!itemm3u8.test(text)) {
  1059. return text;
  1060. } else {
  1061. if (ggljbmd.test(text)) {
  1062. shouldStopExecution = true;
  1063. return text;
  1064. } else {
  1065. let deletedContent = '';
  1066. text = text.replace(itemstygza6, (match)=>{
  1067. deletedContent += match + '\n';
  1068. return '';
  1069. }
  1070. );
  1071. try {
  1072. if (deletedContent.trim() !== '') {
  1073. if (!dypd.test(打印开关)) {
  1074. console.log(logysa + logysk + deletedContent, logysf, logysi);
  1075. }
  1076. }
  1077. } catch (e) {}
  1078. return endlist(text);
  1079. }
  1080. }
  1081. } else {
  1082. return text;
  1083. }
  1084. } else {
  1085. return text;
  1086. }
  1087. } catch (e) {
  1088. return text;
  1089. }
  1090. }
  1091. ;
  1092. const removeprunerm3u8b = (text)=>{
  1093. try {
  1094. if (!shouldStopExecution) {
  1095. if (text) {
  1096. if (!itemm3u8.test(text)) {
  1097. return text;
  1098. } else {
  1099. if (ggljbmd.test(text)) {
  1100. shouldStopExecution = true;
  1101. return text;
  1102. } else {
  1103. let deletedContent = '';
  1104. let addedMatches = new Set();
  1105. text = text.replace(itemstygza7, (match)=>{
  1106. match = match.trim();
  1107. if (!addedMatches.has(match) && match !== '') {
  1108. deletedContent += match + '\n';
  1109. addedMatches.add(match);
  1110. }
  1111. return '';
  1112. }
  1113. );
  1114. try {
  1115. if (deletedContent.trim() !== '') {
  1116. if (!dypd.test(打印开关)) {
  1117. console.log(logysa + logysk + deletedContent, logysf, logysi);
  1118. }
  1119. }
  1120. } catch (e) {}
  1121. return endlist(text);
  1122. }
  1123. }
  1124. } else {
  1125. return text;
  1126. }
  1127. } else {
  1128. return text;
  1129. }
  1130. } catch (e) {
  1131. return text;
  1132. }
  1133. }
  1134. ;
  1135. const removeprunerm3u8c = (text)=>{
  1136. try {
  1137. if (!shouldStopExecution) {
  1138. if (text) {
  1139. if (!itemm3u8.test(text)) {
  1140. return text;
  1141. } else {
  1142. if (ggljbmd.test(text)) {
  1143. shouldStopExecution = true;
  1144. return text;
  1145. } else {
  1146. const lines = text.split('\n');
  1147. const extinfLines = lines.filter(line=>tyad11.test(line));
  1148. const extinfValues = extinfLines.map(line=>parseFloat(line.split(':')[1].split(',')[0]));
  1149. const valueCounts = extinfValues.reduce((acc,value)=>{
  1150. acc[value] = (acc[value] || 0) + 1;
  1151. return acc;
  1152. }
  1153. , {});
  1154. const maxCount = Math.max(...Object.values(valueCounts));
  1155. const maxValue = Object.keys(valueCounts).find(key=>valueCounts[key] === maxCount);
  1156. const maxValueRatio = maxCount / extinfValues.length;
  1157. let deletedLines = [];
  1158. if (maxValueRatio > 0.987) {
  1159. const newLines = [];
  1160. let skipNextTs = false;
  1161. for (let i = 0; i < lines.length; i++) {
  1162. if (tyad11.test(lines[i])) {
  1163. if (firstExtinf) {
  1164. firstExtinf = false;
  1165. newLines.push(lines[i]);
  1166. skipNextTs = false;
  1167. } else if (i === lines.length - 1 || !tyad11.test(lines[i + 1])) {
  1168. lastExtinf = true;
  1169. newLines.push(lines[i]);
  1170. skipNextTs = false;
  1171. } else {
  1172. const value = parseFloat(lines[i].split(':')[1].split(',')[0]);
  1173. if (value != maxValue) {
  1174. deletedLines.push(lines[i], lines[i + 1]);
  1175. skipNextTs = true;
  1176. } else {
  1177. newLines.push(lines[i]);
  1178. skipNextTs = false;
  1179. }
  1180. }
  1181. } else if (skipNextTs) {
  1182. skipNextTs = false;
  1183. } else {
  1184. newLines.push(lines[i]);
  1185. }
  1186. }
  1187. if (deleteCount > maxValueRatio * extinfValues.length) {
  1188. return text;
  1189. } else {
  1190. text = endlist(newLines.join('\n'));
  1191. }
  1192. }
  1193. try {
  1194. if (deletedLines.length > 0) {
  1195. if (!dypd.test(打印开关)) {
  1196. console.log(logysa + logysl + deletedLines.map(line=>{
  1197. return line.replace(new RegExp(tyad1022,'gi'), tsLink=>{
  1198. if (!tsLink.startsWith('http')) {
  1199. if (m3u8gglj) {
  1200. return new URL(tsLink,m3u8gglj).href;
  1201. } else {
  1202. return tsLink;
  1203. }
  1204. } else {
  1205. return tsLink;
  1206. }
  1207. }
  1208. );
  1209. }
  1210. ).join('\n'), logysf, logysi);
  1211. }
  1212. }
  1213. } catch (e) {}
  1214. return text;
  1215. }
  1216. }
  1217. } else {
  1218. return text;
  1219. }
  1220. } else {
  1221. return text;
  1222. }
  1223. } catch (e) {
  1224. return text;
  1225. }
  1226. }
  1227. ;
  1228. const removeprunerm3u8d = (text)=>{
  1229. try {
  1230. if (!shouldStopExecution) {
  1231. if (text) {
  1232. if (!itemm3u8.test(text)) {
  1233. return text;
  1234. } else {
  1235. if (ggljbmd.test(text)) {
  1236. shouldStopExecution = true;
  1237. return text;
  1238. } else {
  1239. const lines = text.split('\n');
  1240. const urlLengths = [];
  1241. const urlsWithIndex = [];
  1242. lines.forEach((line,index)=>{
  1243. const match = line.match(new RegExp(tyad5 + '\\s*?$','i'));
  1244. if (match) {
  1245. urlsWithIndex.push({
  1246. url: line,
  1247. index
  1248. });
  1249. urlLengths.push(line.length);
  1250. }
  1251. }
  1252. );
  1253. const lengthCounts = urlLengths.reduce((acc,length)=>{
  1254. acc[length] = (acc[length] || 0) + 1;
  1255. return acc;
  1256. }
  1257. , {});
  1258. const total = urlLengths.length;
  1259. let dominantLength = null;
  1260. for (const length in lengthCounts) {
  1261. if (lengthCounts[length] / total >= 0.789) {
  1262. dominantLength = parseInt(length);
  1263. break;
  1264. }
  1265. }
  1266. let deletedUrls = [];
  1267. if (dominantLength !== null) {
  1268. urlsWithIndex.forEach(({url, index})=>{
  1269. if (url.length !== dominantLength && !tyad14.test(url)) {
  1270. deletedUrls.push(url);
  1271. }
  1272. }
  1273. );
  1274. if (deletedUrls.length > lengthCounts[dominantLength]) {
  1275. return text;
  1276. } else {
  1277. deletedUrls.forEach((url)=>{
  1278. const {index} = urlsWithIndex.find(u=>u.url === url);
  1279. if (index >= 0) {
  1280. lines.splice(index, 1);
  1281. if (index - 1 >= 0 && !new RegExp(tyad7,'i').test(lines[index - 1])) {
  1282. lines.splice(index - 1, 1);
  1283. }
  1284. }
  1285. }
  1286. );
  1287. }
  1288. }
  1289. if (deletedUrls.length > 0) {
  1290. if (!dypd.test(打印开关)) {
  1291. console.log(logysa + logysm + deletedUrls.map(line=>{
  1292. return line.replace(new RegExp(tyad1022,'gi'), tsLink=>{
  1293. if (!tsLink.startsWith('http')) {
  1294. if (m3u8gglj) {
  1295. return new URL(tsLink,m3u8gglj).href;
  1296. } else {
  1297. return tsLink;
  1298. }
  1299. } else {
  1300. return tsLink;
  1301. }
  1302. }
  1303. );
  1304. }
  1305. ).join('\n'), logysf, logysi);
  1306. }
  1307. }
  1308. return endlist(lines.join('\n'));
  1309. }
  1310. }
  1311. } else {
  1312. return text;
  1313. }
  1314. } else {
  1315. return text;
  1316. }
  1317. } catch (e) {
  1318. return text
  1319. }
  1320. }
  1321. ;
  1322. const removeprunerm3u8e = (text)=>{
  1323. try {
  1324. if (!shouldStopExecution) {
  1325. if (text) {
  1326. if (!itemm3u8.test(text)) {
  1327. return text;
  1328. } else {
  1329. if (ggljbmd.test(text)) {
  1330. shouldStopExecution = true;
  1331. return text;
  1332. } else {
  1333. const lines = text.split('\n');
  1334. const matchedLines = [];
  1335. const allLines = lines.map((line,index)=>({
  1336. line,
  1337. index
  1338. }));
  1339. allLines.forEach(item=>{
  1340. const match = item.line.match(tyad107);
  1341. if (match) {
  1342. matchedLines.push({
  1343. ...item,
  1344. matchedGroup: match[1]
  1345. });
  1346. }
  1347. }
  1348. );
  1349. if (matchedLines.length === 0) {
  1350. return text;
  1351. } else {
  1352. const matchedGroupCounts = {};
  1353. matchedLines.forEach(item=>{
  1354. matchedGroupCounts[item.matchedGroup] = (matchedGroupCounts[item.matchedGroup] || 0) + 1;
  1355. }
  1356. );
  1357. const minCount = Math.min(...Object.values(matchedGroupCounts));
  1358. const lessFrequentMatchedGroups = Object.keys(matchedGroupCounts).filter(group=>matchedGroupCounts[group] === minCount);
  1359. let filteredMatchedGroups = lessFrequentMatchedGroups.map(group=>{
  1360. const lastSlashIndex = group.lastIndexOf('/');
  1361. if (lastSlashIndex !== -1) {
  1362. group = group.substring(0, lastSlashIndex + 1);
  1363. }
  1364. if (!group.match(/^https?:\/\//) && !group.startsWith('/')) {
  1365. return null;
  1366. }
  1367. return group;
  1368. }
  1369. ).filter(group=>group !== null);
  1370. const totalMatched = matchedLines.length;
  1371. let dominantMatchedGroup;
  1372. for (const matchedGroup in matchedGroupCounts) {
  1373. if (matchedGroupCounts[matchedGroup] / totalMatched > 0.66) {
  1374. dominantMatchedGroup = matchedGroup;
  1375. break;
  1376. }
  1377. }
  1378. if (!dominantMatchedGroup) {
  1379. return text;
  1380. } else {
  1381. let diffCount = 0;
  1382. for (let i = allLines.length - 1; i >= 0; i--) {
  1383. if (allLines[i].line.startsWith(tyad0)) {
  1384. const nextLineIndex = i + 1;
  1385. let nextLine;
  1386. if (nextLineIndex < allLines.length) {
  1387. nextLine = allLines[nextLineIndex].line;
  1388. } else {
  1389. nextLine = undefined;
  1390. }
  1391. let match;
  1392. if (nextLine) {
  1393. match = nextLine.match(tyad107);
  1394. } else {
  1395. match = undefined;
  1396. }
  1397. if (!match || match[1] !== dominantMatchedGroup) {
  1398. diffCount++;
  1399. }
  1400. }
  1401. }
  1402. if (diffCount / totalMatched > 0.66) {
  1403. return text;
  1404. } else {
  1405. const deletedLines = [];
  1406. if (filteredMatchedGroups.length > 0) {
  1407. for (let i = allLines.length - 1; i >= 0; i--) {
  1408. if (allLines[i].line.startsWith(tyad0)) {
  1409. const nextLineIndex = i + 1;
  1410. let nextLine;
  1411. if (nextLineIndex < allLines.length) {
  1412. nextLine = allLines[nextLineIndex].line;
  1413. } else {
  1414. nextLine = undefined;
  1415. }
  1416. const cleanedNextLine = nextLine ? nextLine.replace(new RegExp(tyad5 + '.*?$','i'), '') : '';
  1417. if (!tyad10.test(cleanedNextLine)) {
  1418. const isFilteredMatched = filteredMatchedGroups.some(group=>nextLine && nextLine.startsWith(group));
  1419. if (isFilteredMatched) {
  1420. deletedLines.push(nextLine);
  1421. deletedLines.push(allLines[i].line);
  1422. allLines.splice(i, 2);
  1423. }
  1424. }
  1425. }
  1426. }
  1427. } else {
  1428. for (let i = allLines.length - 1; i >= 0; i--) {
  1429. if (allLines[i].line.startsWith(tyad0)) {
  1430. const nextLineIndex = i + 1;
  1431. let nextLine;
  1432. if (nextLineIndex < allLines.length) {
  1433. nextLine = allLines[nextLineIndex].line;
  1434. } else {
  1435. nextLine = undefined;
  1436. }
  1437. const cleanedNextLine = nextLine ? nextLine.replace(new RegExp(tyad5 + '.*?$','i'), '') : '';
  1438. let match;
  1439. if (nextLine) {
  1440. match = nextLine.match(tyad107);
  1441. } else {
  1442. match = undefined;
  1443. }
  1444. if (!match || match[1] !== dominantMatchedGroup) {
  1445. if (!tyad10.test(cleanedNextLine)) {
  1446. deletedLines.push(nextLine);
  1447. deletedLines.push(allLines[i].line);
  1448. allLines.splice(i, 2);
  1449. }
  1450. }
  1451. }
  1452. }
  1453. }
  1454. const tsToDeleteCount = deletedLines.length / 2;
  1455. if (tsToDeleteCount > totalMatched) {
  1456. return text;
  1457. } else {
  1458. try {
  1459. if (deletedLines.length > 0) {
  1460. try {
  1461. if (!dypd.test(打印开关)) {
  1462. console.log(logysa + logysn + deletedLines.reverse().map(line=>{
  1463. return line.replace(new RegExp(tyad1022,'gi'), tsLink=>{
  1464. if (!tsLink.startsWith('http')) {
  1465. if (m3u8gglj) {
  1466. return new URL(tsLink,m3u8gglj).href;
  1467. } else {
  1468. return tsLink;
  1469. }
  1470. } else {
  1471. return tsLink;
  1472. }
  1473. }
  1474. );
  1475. }
  1476. ).join('\n'), logysf, logysi);
  1477. }
  1478. } catch (e) {}
  1479. }
  1480. } catch (e) {}
  1481. return endlist(allLines.map(item=>item.line).join('\n'));
  1482. }
  1483. }
  1484. }
  1485. }
  1486. }
  1487. }
  1488. } else {
  1489. return text;
  1490. }
  1491. } else {
  1492. return text;
  1493. }
  1494. } catch (e) {
  1495. return text;
  1496. }
  1497. }
  1498. ;
  1499. const prunerm3u8 = (text)=>{
  1500. try {
  1501. if (!shouldStopExecution) {
  1502. if (text) {
  1503. if (!itemm3u8.test(text)) {
  1504. return text;
  1505. } else {
  1506. if (ggljbmd.test(text)) {
  1507. shouldStopExecution = true;
  1508. return text;
  1509. } else {
  1510. if (!shouldStopExecution) {
  1511. const lines = text.split('\n');
  1512. const keyCount = lines.filter(line=>new RegExp(tyad1021,'i').test(line)).length;
  1513. if (keyCount >= 2) {
  1514. return text;
  1515. } else {
  1516. let discontinuityCount = 0;
  1517. const filteredLines = lines.filter(line=>{
  1518. if (new RegExp(tyad2,'i').test(line)) {
  1519. discontinuityCount++;
  1520. return false;
  1521. }
  1522. return true;
  1523. }
  1524. );
  1525. try {
  1526. if (!dypd.test(打印开关)) {
  1527. if (discontinuityCount > 1) {
  1528. console.log(logysa + logysj + "-已经发现] ✂" + '已删除《' + discontinuityCount + '》个' + tyad2 + logysj, logysf);
  1529. }
  1530. }
  1531. } catch (e) {}
  1532. return endlist(removeprunerm3u8a(filteredLines.join('\n')));
  1533. }
  1534. } else {
  1535. return text;
  1536. }
  1537. }
  1538. }
  1539. } else {
  1540. return text;
  1541. }
  1542. } else {
  1543. return text;
  1544. }
  1545. } catch (e) {
  1546. return text;
  1547. }
  1548. }
  1549. ;
  1550. let realFetch = self.fetch;
  1551. self.fetch = new Proxy(self.fetch,{
  1552. apply: function(target, thisArg, args) {
  1553. try {
  1554. let url = urlFromArg(args[0]);
  1555. let item = matchM3u(url);
  1556. if (item) {
  1557. if (ggljbmd.test(url) || shouldStopExecution) {
  1558. shouldStopExecution = true;
  1559. return Reflect.apply(target, thisArg, args);
  1560. } else {
  1561. m3u8gglj = url;
  1562. try {
  1563. if (isValidM3U8Url(m3u8gglj)) {
  1564. m3u8bflj = m3u8gglj;
  1565. try {
  1566. console.clear();
  1567. } catch (e) {}
  1568. console.log("播放链接:" + m3u8bflj);
  1569. }
  1570. } catch (e) {}
  1571. if (!shouldStopExecution) {
  1572. return realFetch.apply(thisArg, args).then(realResponse=>{
  1573. try {
  1574. if (!realResponse || !realResponse.ok) {
  1575. return realResponse;
  1576. } else {
  1577. return realResponse.text().then(textin=>{
  1578. try {
  1579. if (M3umatch(textin)) {
  1580. return realResponse;
  1581. } else {
  1582. if (!new RegExp(tyad5,'i').test(textin)) {
  1583. return realResponse;
  1584. } else {
  1585. if (!tyad1051.test(textin)) {
  1586. return realResponse;
  1587. } else {
  1588. let textout = proqca(textin, item);
  1589. try {
  1590. textout = proqcb(textout);
  1591. } catch (e) {}
  1592. try {
  1593. textout = proqcc(textout);
  1594. } catch (e) {}
  1595. try {
  1596. textout = prunerm3u8(textout);
  1597. } catch (e) {}
  1598. try {
  1599. textout = removeprunerm3u8e(textout);
  1600. } catch (e) {}
  1601. try {
  1602. textout = removeprunerm3u8b(textout);
  1603. } catch (e) {}
  1604. try {
  1605. textout = removeprunerm3u8c(textout);
  1606. } catch (e) {}
  1607. try {
  1608. textout = removeprunerm3u8d(textout);
  1609. } catch (e) {}
  1610. try {
  1611. textout = durationtaragt(textout);
  1612. } catch (e) {}
  1613. try {
  1614. textout = taragtduration(textout);
  1615. } catch (e) {}
  1616. try {
  1617. textout = endlist(textout);
  1618. } catch (e) {}
  1619. /*console.log("realFetch测试广告:\n"+textout);*/
  1620. try {
  1621. if (M3umatch(textout)) {
  1622. return realResponse;
  1623. }
  1624. } catch (e) {}
  1625. if (textout !== textin) {
  1626. return new Response(textout,{
  1627. status: realResponse.status,
  1628. statusText: realResponse.statusText,
  1629. headers: realResponse.headers
  1630. });
  1631. } else {
  1632. return realResponse;
  1633. }
  1634. }
  1635. }
  1636. }
  1637. } catch (e) {
  1638. return realResponse;
  1639. }
  1640. }
  1641. );
  1642. }
  1643. } catch (e) {
  1644. return realResponse;
  1645. }
  1646. }
  1647. );
  1648. } else {
  1649. return Reflect.apply(target, thisArg, args);
  1650. }
  1651. }
  1652. } else {
  1653. return Reflect.apply(target, thisArg, args);
  1654. }
  1655. } catch (e) {
  1656. return Reflect.apply(target, thisArg, args);
  1657. }
  1658. }
  1659. });
  1660. let originalOpen = self.XMLHttpRequest.prototype.open;
  1661. self.XMLHttpRequest.prototype.open = new Proxy(self.XMLHttpRequest.prototype.open,{
  1662. apply: async function(target, thisArg, args) {
  1663. try {
  1664. if (!shouldStopExecution) {
  1665. let url = urlFromArg(args[1]);
  1666. let item = matchM3u(url);
  1667. if (item) {
  1668. if (ggljbmd.test(url) || shouldStopExecution) {
  1669. shouldStopExecution = true;
  1670. return Reflect.apply(target, thisArg, args);
  1671. } else {
  1672. m3u8gglj = url;
  1673. try {
  1674. if (isValidM3U8Url(m3u8gglj)) {
  1675. m3u8bflj = m3u8gglj;
  1676. try {
  1677. console.clear();
  1678. } catch (e) {}
  1679. console.log("播放链接:" + m3u8bflj);
  1680. }
  1681. } catch (e) {}
  1682. try {
  1683. thisArg.addEventListener('readystatechange', async function() {
  1684. try {
  1685. if (thisArg.readyState !== 4) {
  1686. return;
  1687. } else {
  1688. const type = thisArg.responseType;
  1689. if (type !== '' && type !== 'text') {
  1690. return;
  1691. } else {
  1692. let textin = thisArg.responseText;
  1693. try {
  1694. if (M3umatch(textin)) {
  1695. return;
  1696. }
  1697. } catch (e) {}
  1698. if (!new RegExp(tyad5,'i').test(textin)) {
  1699. return;
  1700. } else {
  1701. if (!tyad1051.test(textin)) {
  1702. return;
  1703. } else {
  1704. let textout = proqca(textin, item);
  1705. try {
  1706. textout = proqcb(textout);
  1707. } catch (e) {}
  1708. try {
  1709. textout = proqcc(textout);
  1710. } catch (e) {}
  1711. try {
  1712. textout = prunerm3u8(textout);
  1713. } catch (e) {}
  1714. try {
  1715. textout = removeprunerm3u8e(textout);
  1716. } catch (e) {}
  1717. try {
  1718. textout = removeprunerm3u8b(textout);
  1719. } catch (e) {}
  1720. try {
  1721. textout = removeprunerm3u8c(textout);
  1722. } catch (e) {}
  1723. try {
  1724. textout = removeprunerm3u8d(textout);
  1725. } catch (e) {}
  1726. try {
  1727. textout = durationtaragt(textout);
  1728. } catch (e) {}
  1729. try {
  1730. textout = taragtduration(textout);
  1731. } catch (e) {}
  1732. try {
  1733. textout = endlist(textout);
  1734. } catch (e) {}
  1735. /*console.log("originalOpen测试广告:\n"+textout);*/
  1736. try {
  1737. if (M3umatch(textout)) {
  1738. return;
  1739. }
  1740. } catch (e) {}
  1741. if (textout !== textin) {
  1742. Reflect.defineProperty(thisArg, 'response', {
  1743. value: textout
  1744. });
  1745. Reflect.defineProperty(thisArg, 'responseText', {
  1746. value: textout
  1747. });
  1748. } else {
  1749. return;
  1750. }
  1751. }
  1752. }
  1753. }
  1754. }
  1755. } catch (e) {
  1756. return;
  1757. }
  1758. });
  1759. } catch (e) {}
  1760. return Reflect.apply(target, thisArg, args);
  1761. }
  1762. } else {
  1763. return Reflect.apply(target, thisArg, args);
  1764. }
  1765. } else {
  1766. return Reflect.apply(target, thisArg, args);
  1767. }
  1768. } catch (e) {
  1769. return Reflect.apply(target, thisArg, args);
  1770. }
  1771. }
  1772. });
  1773. }
  1774. } catch (e) {}
  1775. }
  1776. } catch (e) {}
  1777. }
  1778. )();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址