Update srv.js
Browse files
srv.js
CHANGED
|
@@ -40,7 +40,7 @@ async function fetchKey(game) {
|
|
| 40 |
const genTxt = genRes.data;
|
| 41 |
const k = genTxt.match(/id="gameKey"[^>]*>([^<]+)<\/p>/);
|
| 42 |
//if (!k) throw new Error('key not found in response');
|
| 43 |
-
return k[1]?.trim()
|
| 44 |
}
|
| 45 |
|
| 46 |
app.get('/key', async (req, res) => {
|
|
|
|
| 40 |
const genTxt = genRes.data;
|
| 41 |
const k = genTxt.match(/id="gameKey"[^>]*>([^<]+)<\/p>/);
|
| 42 |
//if (!k) throw new Error('key not found in response');
|
| 43 |
+
return k[1]?.trim() || k[1] || k || 'error'
|
| 44 |
}
|
| 45 |
|
| 46 |
app.get('/key', async (req, res) => {
|