koishi-plugin-bns-blacklist 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +11 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -224,14 +224,22 @@ async function scrapeSheet(page, url, logger) {
|
|
|
224
224
|
if (logger)
|
|
225
225
|
logger.info(`API endpoints tried: ${apiData.length} responded`);
|
|
226
226
|
for (const item of apiData) {
|
|
227
|
+
const text = item.text || item.body;
|
|
227
228
|
if (logger)
|
|
228
|
-
logger.info(` ${item.endpoint} -> status=${item.status}, len=${
|
|
229
|
+
logger.info(` ${item.endpoint} -> status=${item.status}, len=${text?.length}`);
|
|
229
230
|
try {
|
|
230
|
-
const json = JSON.parse(
|
|
231
|
+
const json = JSON.parse(text);
|
|
232
|
+
// Log sample of JSON structure for debugging
|
|
233
|
+
if (logger && text.length > 100) {
|
|
234
|
+
const keys = Object.keys(json);
|
|
235
|
+
logger.info(` JSON keys: [${keys.join(', ')}]`);
|
|
236
|
+
// Log first 500 chars
|
|
237
|
+
logger.info(` JSON sample: ${text.substring(0, 500)}`);
|
|
238
|
+
}
|
|
231
239
|
const rows = extractRowsFromJson(json);
|
|
232
240
|
if (rows.length > 0) {
|
|
233
241
|
if (logger)
|
|
234
|
-
logger.info(`Found data: ${rows.length} rows
|
|
242
|
+
logger.info(`Found data: ${rows.length} rows`);
|
|
235
243
|
return parseSheetData(rows);
|
|
236
244
|
}
|
|
237
245
|
}
|