webpeel 0.20.11 → 0.20.13
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/dist/core/youtube.js +11 -4
- package/package.json +1 -1
package/dist/core/youtube.js
CHANGED
|
@@ -327,10 +327,17 @@ async function getTranscriptViaYtDlp(videoId, preferredLang) {
|
|
|
327
327
|
'--quiet',
|
|
328
328
|
videoUrl,
|
|
329
329
|
];
|
|
330
|
-
|
|
330
|
+
// Pass explicit PATH so yt-dlp is found in Docker containers
|
|
331
|
+
// pip3 installs to /usr/local/bin which may not be in Node's process.env.PATH
|
|
332
|
+
const execEnv = {
|
|
333
|
+
...process.env,
|
|
334
|
+
PATH: `/usr/local/bin:/usr/bin:/bin:${process.env.PATH ?? ''}`,
|
|
335
|
+
};
|
|
336
|
+
const proc = execFile('yt-dlp', args, { timeout: 45000, env: execEnv }, async (err) => {
|
|
331
337
|
try {
|
|
332
338
|
if (err) {
|
|
333
|
-
// yt-dlp not installed or failed
|
|
339
|
+
// yt-dlp not installed, timed out, or failed
|
|
340
|
+
console.error('[webpeel] yt-dlp error:', err.message);
|
|
334
341
|
resolve(null);
|
|
335
342
|
return;
|
|
336
343
|
}
|
|
@@ -438,10 +445,10 @@ async function getTranscriptViaBrowserIntercept(videoId, videoUrl, preferredLang
|
|
|
438
445
|
}
|
|
439
446
|
});
|
|
440
447
|
try {
|
|
441
|
-
await page.goto(videoUrl, { waitUntil: 'domcontentloaded', timeout:
|
|
448
|
+
await page.goto(videoUrl, { waitUntil: 'domcontentloaded', timeout: 35000 });
|
|
442
449
|
// Wait for timedtext request to be intercepted (player auto-fetches captions)
|
|
443
450
|
const startWait = Date.now();
|
|
444
|
-
while (!capturedJson && Date.now() - startWait <
|
|
451
|
+
while (!capturedJson && Date.now() - startWait < 12000) {
|
|
445
452
|
await page.waitForTimeout(200);
|
|
446
453
|
}
|
|
447
454
|
// Also grab page HTML for video metadata
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpeel",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.13",
|
|
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",
|