(url, name)
| 2142 | |
| 2143 | //查binary |
| 2144 | async function isBinaryMode(url, name) { |
| 2145 | if (/proto/i.test(name)) { |
| 2146 | return 'true' |
| 2147 | } else if (/(?:tieba|youtube|bili|spotify|wyres|netease|DualSubs\.Subtitles\.Translate\.response)/i.test(url)) { |
| 2148 | if (binaryInfo.length > 0 && binaryInfo.some(item => item.url === url)) { |
| 2149 | for (let i = 0; i < binaryInfo.length; i++) { |
| 2150 | if (binaryInfo[i].url === url) { |
| 2151 | return binaryInfo[i].binarymode |
| 2152 | break |
| 2153 | } |
| 2154 | } |
| 2155 | } else { |
| 2156 | const res = (await http(url)).body |
| 2157 | if (res == undefined || res == null) { |
| 2158 | //$.log(JS_NAME); |
| 2159 | return '' |
| 2160 | } else if (res.includes('.bodyBytes')) { |
| 2161 | binaryInfo.push({ url, binarymode: 'true' }) |
| 2162 | |
| 2163 | $.setjson(binaryInfo, 'Parser_binary_info') |
| 2164 | return 'true' |
| 2165 | } else { |
| 2166 | binaryInfo.push({ url, binarymode: '' }) |
| 2167 | $.setjson(binaryInfo, 'Parser_binary_info') |
| 2168 | return '' |
| 2169 | } |
| 2170 | } //没有信息或者没有url的信息 |
| 2171 | } else { |
| 2172 | return '' |
| 2173 | } |
| 2174 | } //查binary |
| 2175 | |
| 2176 | //获取mock参数 |
| 2177 | function getMockInfo(x, mark, y) { |
no test coverage detected