(url, name)
| 2546 | |
| 2547 | //查binary |
| 2548 | async function isBinaryMode(url, name) { |
| 2549 | if (/proto/i.test(name)) { |
| 2550 | return 'true' |
| 2551 | } else if (/(?:tieba|youtube|bili|spotify|wyres|netease|DualSubs\.Subtitles\.Translate\.response)/i.test(url)) { |
| 2552 | if (binaryInfo.length > 0 && binaryInfo.some(item => item.url === url)) { |
| 2553 | for (let i = 0; i < binaryInfo.length; i++) { |
| 2554 | if (binaryInfo[i].url === url) { |
| 2555 | return binaryInfo[i].binarymode |
| 2556 | break |
| 2557 | } |
| 2558 | } |
| 2559 | } else { |
| 2560 | const res = (await http(url)).body |
| 2561 | if (res == undefined || res == null) { |
| 2562 | //$.log(JS_NAME); |
| 2563 | return '' |
| 2564 | } else if (res.includes('.bodyBytes')) { |
| 2565 | binaryInfo.push({ url, binarymode: 'true' }) |
| 2566 | |
| 2567 | $.setjson(binaryInfo, 'Parser_binary_info') |
| 2568 | return 'true' |
| 2569 | } else { |
| 2570 | binaryInfo.push({ url, binarymode: '' }) |
| 2571 | $.setjson(binaryInfo, 'Parser_binary_info') |
| 2572 | return '' |
| 2573 | } |
| 2574 | } //没有信息或者没有url的信息 |
| 2575 | } else { |
| 2576 | return '' |
| 2577 | } |
| 2578 | } //查binary |
| 2579 | |
| 2580 | //获取mock参数 |
| 2581 | function getMockInfo(x, mark, y) { |
no test coverage detected