@koda-sl/baker-cli 0.200.0-dev.0a9adf6f7 → 0.201.0-dev.0a9adf6f7
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.
|
@@ -5246,8 +5246,10 @@ var CHALLENGE_PHRASES = [
|
|
|
5246
5246
|
"captcha"
|
|
5247
5247
|
];
|
|
5248
5248
|
var NOT_A_BLOCK_PHRASES = ["private video", "video unavailable", "members-only", "this video is available to"];
|
|
5249
|
+
var PROXY_TUNNEL_FAILURE = /tunnel connection failed: 407|proxy authentication required|http error 407/i;
|
|
5249
5250
|
function ytDlpBlockSignal(stderr) {
|
|
5250
5251
|
const text = stderr.toLowerCase();
|
|
5252
|
+
if (PROXY_TUNNEL_FAILURE.test(stderr)) return { status: 407 };
|
|
5251
5253
|
if (NOT_A_BLOCK_PHRASES.some((phrase) => text.includes(phrase))) return {};
|
|
5252
5254
|
const status = HTTP_ERROR.exec(stderr);
|
|
5253
5255
|
if (status) return { status: Number(status[1]) };
|
|
@@ -5289,7 +5291,7 @@ async function runYtDlp(args) {
|
|
|
5289
5291
|
argv.push("--format", format, "--merge-output-format", "mp4");
|
|
5290
5292
|
}
|
|
5291
5293
|
args.onLog?.(`yt-dlp: downloading ${args.audioOnly ? "audio" : "video"}`);
|
|
5292
|
-
const { code, stderr } = await runViaLadder({
|
|
5294
|
+
const { code, stderr, tier } = await runViaLadder({
|
|
5293
5295
|
url: args.url,
|
|
5294
5296
|
argv,
|
|
5295
5297
|
timeoutMs: args.timeoutMs ?? YT_DLP_TIMEOUT_MS,
|
|
@@ -5309,14 +5311,15 @@ async function runYtDlp(args) {
|
|
|
5309
5311
|
info = JSON.parse(await readFile3(infoPath, "utf-8"));
|
|
5310
5312
|
} catch {
|
|
5311
5313
|
}
|
|
5312
|
-
return { filePath: path4.join(args.workDir, downloaded), info };
|
|
5314
|
+
return { filePath: path4.join(args.workDir, downloaded), info, tier };
|
|
5313
5315
|
}
|
|
5314
5316
|
async function walkYtDlpLadder(args) {
|
|
5315
5317
|
const routes = plannedRoutes(args.url, args.credentials);
|
|
5316
|
-
let last = { code: -1, stderr: "" };
|
|
5318
|
+
let last = { code: -1, stderr: "", tier: "direct" };
|
|
5317
5319
|
for (const route of routes) {
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
+
const tier = route.kind === "proxy" ? route.tier : "direct";
|
|
5321
|
+
if (route.kind === "proxy") args.onLog?.(`yt-dlp: retrying via ${tier}`);
|
|
5322
|
+
last = { ...await args.attempt(route), tier };
|
|
5320
5323
|
if (last.code === 0) return last;
|
|
5321
5324
|
if (!shouldEscalate(ytDlpBlockSignal(last.stderr))) return last;
|
|
5322
5325
|
}
|
|
@@ -8808,6 +8811,7 @@ export {
|
|
|
8808
8811
|
elementMentionKeywords,
|
|
8809
8812
|
MAX_REMOTE_IMAGE_BYTES,
|
|
8810
8813
|
fetchExternalBytes,
|
|
8814
|
+
ytDlpBlockSignal,
|
|
8811
8815
|
YtDlpError,
|
|
8812
8816
|
runYtDlp,
|
|
8813
8817
|
toModelSafeImage,
|
|
@@ -8821,4 +8825,4 @@ export {
|
|
|
8821
8825
|
defaultRegistry,
|
|
8822
8826
|
createEngineFromEnv
|
|
8823
8827
|
};
|
|
8824
|
-
//# sourceMappingURL=chunk-
|
|
8828
|
+
//# sourceMappingURL=chunk-CAWFJ5X3.js.map
|