webpeel 0.21.65 → 0.21.66
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.
|
@@ -4246,14 +4246,9 @@ async function semanticScholarExtractor(_html, url) {
|
|
|
4246
4246
|
const data = await fetchJson(apiUrl);
|
|
4247
4247
|
if (!data)
|
|
4248
4248
|
return null;
|
|
4249
|
-
//
|
|
4249
|
+
// Rate limited — return null so pipeline falls back to browser rendering
|
|
4250
4250
|
if (data.code === '429' || (data.message && String(data.message).includes('Too Many Requests'))) {
|
|
4251
|
-
return
|
|
4252
|
-
domain,
|
|
4253
|
-
type: 'paper',
|
|
4254
|
-
structured: { paperId, rateLimited: true },
|
|
4255
|
-
cleanContent: `# Semantic Scholar — Rate Limited\n\n⚠️ API rate limit reached. View paper directly: https://www.semanticscholar.org/paper/${paperId}`,
|
|
4256
|
-
};
|
|
4251
|
+
return null;
|
|
4257
4252
|
}
|
|
4258
4253
|
if (!data.title)
|
|
4259
4254
|
return null;
|
|
@@ -4321,23 +4316,11 @@ async function semanticScholarExtractor(_html, url) {
|
|
|
4321
4316
|
const fields = 'title,authors,year,citationCount,url,openAccessPdf';
|
|
4322
4317
|
const apiUrl = `https://api.semanticscholar.org/graph/v1/paper/search?query=${encodeURIComponent(query)}&limit=10&fields=${fields}`;
|
|
4323
4318
|
const data = await fetchJson(apiUrl);
|
|
4324
|
-
//
|
|
4319
|
+
// Rate limited or no data — return null so pipeline falls back to browser rendering
|
|
4325
4320
|
if (!data)
|
|
4326
4321
|
return null;
|
|
4327
4322
|
if (data.code === '429' || (data.message && String(data.message).includes('Too Many Requests'))) {
|
|
4328
|
-
|
|
4329
|
-
`# 🔍 Semantic Scholar — "${query}"`,
|
|
4330
|
-
'',
|
|
4331
|
-
'⚠️ **Rate limited by Semantic Scholar API.** The free tier has strict limits.',
|
|
4332
|
-
'',
|
|
4333
|
-
`Try again in a few seconds, or search directly: https://www.semanticscholar.org/search?q=${encodeURIComponent(query)}`,
|
|
4334
|
-
].join('\n');
|
|
4335
|
-
return {
|
|
4336
|
-
domain,
|
|
4337
|
-
type: 'search',
|
|
4338
|
-
structured: { query, total: 0, papers: [], rateLimited: true },
|
|
4339
|
-
cleanContent,
|
|
4340
|
-
};
|
|
4323
|
+
return null;
|
|
4341
4324
|
}
|
|
4342
4325
|
if (!Array.isArray(data.data))
|
|
4343
4326
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpeel",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.66",
|
|
4
4
|
"description": "Fast web fetcher for AI agents - stealth mode, crawl mode, page actions, structured extraction, PDF parsing, smart escalation from simple HTTP to headless browser",
|
|
5
5
|
"author": "Jake Liu",
|
|
6
6
|
"license": "AGPL-3.0-only",
|