@mks2508/bundlp 0.1.23 → 0.1.25

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/index.mjs CHANGED
@@ -510,7 +510,7 @@ const log$9 = logger.scope("Auth");
510
510
  function makeSidAuth(scheme, sapisid, origin) {
511
511
  const timestamp = Math.floor(Date.now() / 1e3);
512
512
  const input = `${timestamp} ${sapisid} ${origin}`;
513
- return `${scheme} ${timestamp}_${createHash("sha1").update(input).digest("hex")}`;
513
+ return `${scheme} ${timestamp}_${createHash("sha1").update(input).digest("hex")}_u`;
514
514
  }
515
515
  /**
516
516
  * Generates the full Authorization header for YouTube API requests.
@@ -530,7 +530,6 @@ function generateSapisidAuth(cookies, origin = "https://www.youtube.com") {
530
530
  const authorizations = [];
531
531
  const sapisidValue = cookies.sapisid || cookies.secure3Papisid;
532
532
  if (sapisidValue) authorizations.push(makeSidAuth("SAPISIDHASH", sapisidValue, origin));
533
- if (cookies.secure1Papisid) authorizations.push(makeSidAuth("SAPISID1PHASH", cookies.secure1Papisid, origin));
534
533
  if (cookies.secure3Papisid) authorizations.push(makeSidAuth("SAPISID3PHASH", cookies.secure3Papisid, origin));
535
534
  if (authorizations.length === 0) return;
536
535
  const authHeader = authorizations.join(" ");
@@ -764,6 +763,7 @@ var InnerTubeClient = class {
764
763
  if (authHeader) {
765
764
  headers["Authorization"] = authHeader;
766
765
  headers["X-Origin"] = YOUTUBE_BASE_URL;
766
+ headers["X-Goog-AuthUser"] = "0";
767
767
  log$8.info(`Added Authorization with ${authHeader.split(" ").filter((s) => s.includes("HASH")).length} scheme(s)`);
768
768
  log$8.debug(`Authorization: ${authHeader.substring(0, 80)}...`);
769
769
  } else log$8.warn("No SAPISID cookies found - requests will likely fail");
@@ -1622,6 +1622,7 @@ var Player = class {
1622
1622
  if (authHeader) {
1623
1623
  headers["Authorization"] = authHeader;
1624
1624
  headers["X-Origin"] = YOUTUBE_BASE_URL;
1625
+ headers["X-Goog-AuthUser"] = "0";
1625
1626
  log$7.info(`Added Authorization with ${authHeader.split(" ").filter((s) => s.includes("HASH")).length} SAPISID scheme(s)`);
1626
1627
  }
1627
1628
  const htmlResult = await httpClient.get(fetchUrl, { headers });