()
| 131 | } |
| 132 | |
| 133 | function EnvInfo() { |
| 134 | const url = $request.url; |
| 135 | if (typeof ($response) !== 'undefined') { |
| 136 | const raw = JSON.parse($response.body || "{}"); |
| 137 | const data = raw.data || raw.result || {}; |
| 138 | const title = [data.title, data.series && data.series.series_title, data.season_title] |
| 139 | .filter(c => /\u5340\uff09/.test(c))[0] || data.title; |
| 140 | SwitchRegion(title, null, raw) |
| 141 | .then(s => s ? $done({ |
| 142 | status: $.isQuanX ? "HTTP/1.1 307" : 307, |
| 143 | headers: { |
| 144 | Location: url |
| 145 | }, |
| 146 | body: "{}" |
| 147 | }) : QueryRating(raw, data)); |
| 148 | } else { |
| 149 | const res = { |
| 150 | url: url.replace(/%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)&/g, '&') |
| 151 | }; |
| 152 | SwitchRegion(null, url, {}).then(() => $done(res)); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | async function QueryRating(body, play) { |
| 157 | try { |
no test coverage detected